Tuesday, 10 February 2026

Making a Heltec CubeCell-Board Plus based slan-031 environmental monitor

(Tues 10th Feb 2026) Refactoring the code

This board has a long history. It is labelled slan-031 and sends readings from a BME680 sensor over LoRaWAN.

Currently, it sends temperature, humidity, battery level and atmospheric pressure every 10 minutes.

slan-031 environmental sensor

However, its charging circuit and antenna connection are broken. So no PV panel input and antenna is glued on.

I have raised Bugzilla bug #2 to track the changes needed http://192.168.1.153/bugzilla/show_bug.cgi?id=2

These being:

1) Code to be refactored into main, display, sensor and comms files.

2) Would like info displayed on reset

3) Would like info display on USER button press

4) Would like red LED to flash when battery below 3.5 V

The transmitted values can be seen by anyone at site: 

https://shannontownwetlands.ie/environmental-sensors/drumgeely-polytunnels


Website view of data

I tried the Claude Code generated files but they would compile so doing the refactoring by hand. But first to add code to GitHub

https://www.geeksforgeeks.org/git/how-to-fix-support-for-password-authentication-was-removed/

 1449  git commit -m "2nd commit, still not on GitHub"
 1450  git branch -M main
 1451  git remote add origin https://github.com/kilnageer2/HTCCAB02_LORA_DISPLAY_BME680.git
 1452  git push -u origin main
 1453  git status .
 1454  nano README.md 
 1455  git status .
 1457  git add .
 1458  git status .
 1459  git commit -m "Updated README.md"
 1460  git status .
 1461  git tag
 1462  git tag -a v1.08 -m "Initial working baseline before moving code"
 1463  git tag
 1464  git show v1.08
 1465  git status .
 1466  git push -u origin main
 1467  # Nice that remote repo is now Private!

Successfully pushed code from rhubarb laptop to GitHub using above but now need GitHub to accept it!




(17:01) Next to start messing with the code!


(18:50) Code looking good now have displays at start of device info and before first transmission of sensor data


Display after a reset of device info

Display at first transmission of sensor data

So just three things to do now:

1) Move LoRaWAN code to lorawan.cpp and lorawan.h

2) Show last sensor data and number of transmission since reset when USER button pressed

3) Flash RGB LED as red if battery below 3.5 V

(20:24) Well that's me done for the day. Tag v1.12b just has USER button code to add,

Red LED flashed and this is displayed on low battery (< 3.5 V)
















No comments:

Post a Comment