Friday, 26 June 2026

Moving Zigbee smart home sensors to Python3 monitoring (from Node-Red)

So I though a more punchy system service with journal logging might be better than using the web portal or Node-Red logging.

This is the current state of play of all my smart home Zigbee devices:

Sonoff ZbBridge Tasmota_ZbBridge router (192.168.1.151) running Tasmota 12.2.0 by Theo Arends that knows of these devices..


Front Door 🕗19h

Front Presence SNZB06P 🕗95d

Kitchen Door 🕗56m

kitchen window 🕗04h

TRV Frontroom 🕗48d ┆ ☀️ 0.5°C 🎯 6.2°C ⚙️ 0%

TRV James Bedroom 🕗28m ┆ ☀️ 0.5°C 🎯 3.5°C

unknown device ┆ Off

Yard Presence SNZB06P

 back_bedroom 🕗72d ┆ ☀️ 17.8°C 💧 84%

Bathroom 🕗06m ┆ ☀️ 27.0°C 💧 74%

bathroom window 🕗11h

electric blanket 🕗43m┆ Off

Electric Heater ┆ ☀️ 12.1°C

Front Room Ceiling Light  ┆ On 🔅 0% #FF0000

front_bedroom ┆ ☀️ 16.3°C 💧 77%

front_room_3x_power ┆ On

Frontroom ┆ ☀️ 20.2°C 💧 68%

Hallway 🕗39m ┆ ☀️ 18.5°C 💧 78%

Kitchen 🕗48m┆ ☀️ 23.7°C 💧 89%

Kitchen Repeater  ðŸ•—23h

kitchen_led 🕗10m┆ Off 🔅 0% #FF0000

Office 🕗04m┆ ☀️ 25.1°C 💧 75%

PIR Pergola  

PIR Porch 🕗31d

PIR Studio  

Shower Pump Switch 🕗01h

SNZB02D Front room window ┆ ☀️ 19.2°C 💧 50%

SNZB02D James Bedroom 🕗03m┆ ☀️ 24.7°C 💧 68%

Tony Bedroom Door  

tony_LED ┆ Off 🔅 0% #FF0000

tonys window 🕗62d

TRV Front Room ┆ ☀️ 17.0°C 🎯 15.0°C ⚙️ 0%

TRV Kitchen 🕗08m┆ ☀️ 0.5°C 🎯 3.5°C ⚙️ 0%

TRV Office 🕗00m┆ ☀️ 0.5°C 🎯 3.5°C

TRV Seans Bedroom 🕗06m┆ ☀️ 0.5°C 🎯 3.5°C

TRV Tonys Bedroom ┆ ☀️ 18.5°C 🎯 15.0°C ⚙️ 0%

Upstairs Repeater 🕗19h

Device 0x130C  

Device 0x135E 🕗06m

Device 0x16AD  

Device 0x3794 ┆ Off 🔅 0% #FF0000

Device 0x4B3E

Device 0x6568

Device 0x6640

Device 0x803A 🕗62d┆ On

Device 0x8826  

Device 0x894A  

Device 0xABAD  

Device 0xCFF7  

Device 0xEE12  

Device 0xF394

 

So this is a mess! So I will audit every mentioned device and checking its still communicating and changing its name to include its adress, location and function.. e.g  0xXXXX_kitchen_TRV

zblist command on web consule returns


10:31:45.936 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0xEE12":{"Device":"0xEE12","IEEEAddr":"0xBC33ACFFFE37F766","Endpoints":[],"Config":[],"Reachable":false,"LastSeen":43334975,"LastSeenEpoch":1739131330,"LinkQuality":92}}}

10:31:45.954 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0x130C":{"Device":"0x130C","IEEEAddr":"0x0000000000000000","Endpoints":[1],"Config":["I01"],"Occupancy":0,"Reachable":false,"LastSeen":13798156,"LastSeenEpoch":1768668149,"LinkQuality":76}}}

10:31:45.971 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0x6640":{"Device":"0x6640","IEEEAddr":"0x00124B001CD60DD6","ModelId":"TH01","Manufacturer":"eWeLink","Endpoints":[1],"Config":[],"Reachable":false,"LastSeen":37289674,"LastSeenEpoch":1745176631,"LinkQuality":89}}}

10:31:45.988 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0x8826":{"Device":"0x8826","IEEEAddr":"0x00124B001F918A6E","ModelId":"TH01","Manufacturer":"eWeLink","Endpoints":[1],"Config":[],"Reachable":false,"LastSeen":37288605,"LastSeenEpoch":1745177700,"LinkQuality":63}}}

10:31:46.002 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0x894A":{"Device":"0x894A","IEEEAddr":"0x00124B001F91D531","ModelId":"TH01","Manufacturer":"eWeLink","Endpoints":[1],"Config":[],"Reachable":false,"LastSeen":37288485,"LastSeenEpoch":1745177820,"LinkQuality":81}}}

10:31:46.017 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0x16AD":{"Device":"0x16AD","IEEEAddr":"0x00124B001F918CBF","ModelId":"TH01","Manufacturer":"eWeLink","Endpoints":[1],"Config":[],"Reachable":false,"LastSeen":37288166,"LastSeenEpoch":1745178140,"LinkQuality":84}}}

10:31:46.034 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0xF394":{"Device":"0xF394","IEEEAddr":"0x00124B001CD5956C","ModelId":"TH01","Manufacturer":"eWeLink","Endpoints":[1],"Config":[],"Reachable":false,"LastSeen":37287943,"LastSeenEpoch":1745178363,"LinkQuality":128}}}

10:31:46.049 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0xCFF7":{"Device":"0xCFF7","IEEEAddr":"0x00124B001F91991B","ModelId":"WB01","Manufacturer":"eWeLink","Endpoints":[1],"Config":[],"Reachable":false,"LastSeen":37286879,"LastSeenEpoch":1745179427,"LinkQuality":63}}}

10:31:46.066 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0xABAD":{"Device":"0xABAD","IEEEAddr":"0x00124B001FAF2ACC","ModelId":"MS01","Manufacturer":"eWeLink","Endpoints":[1],"Config":[],"Reachable":false,"BatteryPercentage":100,"BatteryLastSeenEpoch":1745179511,"LastSeen":37237312,"LastSeenEpoch":1745228994,"LinkQuality":50}}}

10:31:46.084 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0x4B3E":{"Device":"0x4B3E","IEEEAddr":"0x00124B001FAF4F89","ModelId":"ms01","Manufacturer":"eWeLink","Endpoints":[1],"Config":[],"Reachable":false,"BatteryPercentage":100,"BatteryLastSeenEpoch":1745179507,"LastSeen":37237312,"LastSeenEpoch":1745228994,"LinkQuality":48}}}

10:31:46.103 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0x3794":{"Device":"0x3794","IEEEAddr":"0x0000000000000000","Endpoints":[1],"Config":["L01","O01"],"Dimmer":1,"Hue":0,"Sat":254,"X":45874,"Y":19660,"CT":500,"ColorMode":2,"RGB":"FF0000","RGBb":"010000","Power":0,"Reachable":false,"LastSeen":12825219,"LastSeenEpoch":1769641087,"LinkQuality":29}}}

10:31:46.121 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0x6568":{"Device":"0x6568","IEEEAddr":"0x0000000000000000","Endpoints":[],"Config":[],"Reachable":false,"LastSeen":9646458,"LastSeenEpoch":1772819848,"LinkQuality":58}}}

10:31:46.138 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbInfo":{"0x135E":{"Device":"0x135E","IEEEAddr":"0x0000000000000000","Endpoints":[1],"Config":["I01"],"Occupancy":0,"Reachable":true,"LastSeen":443,"LastSeenEpoch":1782465863,"LinkQuality":115}}}

10:31:46.152 MQT: stat/tasmota_zbbridge_0576A9/RESULT = {"ZbInfo":"Done"}


We need a list by device address !

10:33:54.401 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbReceived":{"0xEF0E":{"Device":"0xEF0E","Name":"Bathroom","BatteryPercentage":64,"Endpoint":1,"LinkQuality":102}}}

10:34:21.904 MQT: tele/tasmota_zbbridge_0576A9/SENSOR = {"ZbReceived":{"0xE1B9":{"Device":"0xE1B9","Name":"Office","Temperature":25.3,"Endpoint":1,"LinkQuality":102}}}


0xEF0E Bathroom 



Sonoff  SNZB-01P Switch

Sonoff SNZB-02    Temperature and Humidity


Fresh audit..

Tonys Bedroom  SNZB-02"Device":"0x9AFE","Name":"back_bedroom" needs CR2450 battery

now online


Saturday, 20 June 2026

How to provide remotely accessible graphs on a Raspberry Pi

(27/6/2026)

Let's command line test accessing TTN data form slan-093 in the polytunnel in Drumgeely..


pi@drumgeely:~ $ 
pi@drumgeely:~ $ 
pi@drumgeely:~ $ date
Sat 27 Jun 14:06:54 IST 2026
pi@drumgeely:~ $ uptime
 14:06:57 up 18 days, 10:27,  3 users,  load average: 0.21, 0.11, 0.04
pi@drumgeely:~ $ df -m .
Filesystem     1M-blocks  Used Available Use% Mounted on
/dev/mmcblk0p2     14351 12563      1040  93% /
pi@drumgeely:~ $ 
pi@drumgeely:~ $ mosquitto_sub -h ###URL### -p 1883 -u ###USER### -P ###PASSWORD### -t \# -F %I%J
2026-06-27T14:13:44+0100{"tst":"2026-06-27T14:13:44.715422Z+0100","topic":"v3/tola-park-environment@ttn/devices/slan-093/up","qos":0,"retain":0,"payloadlen":1712,"payload":{"end_device_ids":{"device_id":"slan-093","application_ids":{"application_id":"tola-park-environment"},"dev_eui":"70B3D57ED0069C07","join_eui":"0000000000000000","dev_addr":"260BE272"},"correlation_ids":["gs:uplink:01KW4KDX844SM3HXK9TNR7JCAD"],"received_at":"2026-06-27T13:13:44.658361992Z","uplink_message":{"session_key_id":"AZ2DKWrsvLI34SF6BYC4fw==","f_port":8,"f_cnt":10863,"frm_payload":"FS4TUAABizYNyAAAAHsQiA==","decoded_payload":{"battery":3528,"battery_level":0,"gas_resistance":8065.16,"humidity":49.44,"pressure":1011.74,"temperature":24.22},"rx_metadata":[{"gateway_ids":{"gateway_id":"stt-drumgeely-gateway-id","eui":"B827EBFFFEBC60E1"},"time":"2026-06-27T13:13:44.356957912Z","timestamp":1593785500,"rssi":-97,"channel_rssi":-97,"snr":11.25,"location":{"latitude":52.699723918918075,"longitude":-8.8875639438629168,"source":"SOURCE_REGISTRY"},"uplink_token":"CiYKJAoYc3R0LWRydW1nZWVseS1nYXRld2F5LWlkEgi4J+v//rxg4RCc+fz3BRoMCIiZ/9EGEOeW2tcBIOCCk6ixmQc=","received_at":"2026-06-27T13:13:44.363999711Z"}],"settings":{"data_rate":{"lora":{"bandwidth":125000,"spreading_factor":9,"coding_rate":"4/5"}},"frequency":"867100000","timestamp":1593785500,"time":"2026-06-27T13:13:44.356957912Z"},"received_at":"2026-06-27T13:13:44.453013498Z","confirmed":true,"consumed_airtime":"0.226304s","version_ids":{"brand_id":"heltec","model_id":"cubecell-1-2-aa-node-class-a-otaa","hardware_version":"_unknown_hw_version_","firmware_version":"1.0","band_id":"EU_863_870"},"network_ids":{"net_id":"000013","ns_id":"EC656E0000000181","tenant_id":"ttn","cluster_id":"eu1","cluster_address":"eu1.cloud.thethings.network"},"last_battery_percentage":{"f_cnt":10769,"value":0,"received_at":"2026-06-26T21:28:24.174897133Z"}}}}

So lets put this into a Python script next..

pi@drumgeely:~ $ mkdir mqtt_python3

pi@drumgeely:~ $ python3 -m venv ./mqtt_python3

pi@drumgeely:~ $ source ./mqtt_python3/bin/activate

(mqtt_python3) pi@drumgeely:~ $ pwd

/home/pi

(mqtt_python3) pi@drumgeely:~ $ cd mqtt_python3/

(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ pip3 install paho-mqtt

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple

Collecting paho-mqtt

  Obtaining dependency information for paho-mqtt from https://www.piwheels.org/simple/paho-mqtt/paho_mqtt-2.1.0-py3-none-any.whl.metadata

  Downloading https://www.piwheels.org/simple/paho-mqtt/paho_mqtt-2.1.0-py3-none-any.whl.metadata (23 kB)

Downloading https://www.piwheels.org/simple/paho-mqtt/paho_mqtt-2.1.0-py3-none-any.whl (67 kB)

   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 67.2/67.2 kB 504.2 kB/s eta 0:00:00

Using cached https://www.piwheels.org/simple/paho-mqtt/paho_mqtt-2.1.0-py3-none-any.whl (67 kB)

Installing collected packages: paho-mqtt

Successfully installed paho-mqtt-2.1.0

(mqtt_python3) pi@drumgeely:~/mqtt_python3 $


And write the script..

Got from https://www.emqx.com/en/blog/how-to-use-mqtt-in-python


(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ 
(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ cat ./test.py 
from paho.mqtt import client as mqtt_client
import random
broker = '###URL###'
port = 1883
topic = '#'  # Want everything so escape \ for \# topic
client_id = f'python-mqtt-{random.randint(0, 1000)}'
username = '###USERNAME###'
password = '###PASWORD###'




def connect_mqtt() -> mqtt_client:
    def on_connect(client, userdata, flags, reason_code, properties):
        if reason_code == 0:
            print("Connected to MQTT Broker!")
        else:
            print(f"Failed to connect, return code {reason_code}")
    client = mqtt_client.Client(
        client_id=client_id,
        callback_api_version=mqtt_client.CallbackAPIVersion.VERSION2,
    )
    client.username_pw_set(username, password)
    client.on_connect = on_connect
    client.connect(broker, port)
    return client

def subscribe(client: mqtt_client):
    def on_message(client, userdata, msg):
        print(f"Received `{msg.payload.decode()}` from `{msg.topic}` topic")
    client.subscribe(topic)
    client.on_message = on_message

def run():
    client = connect_mqtt()
    subscribe(client)
    client.loop_forever()

if __name__ == '__main__':
    run()


(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ 

(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ 
(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ python3 ./test.py 
Connected to MQTT Broker!
Received `{"end_device_ids":{"device_id":"slan-093","application_ids":{"application_id":"tola-park-environment"},"dev_eui":"70B3D57ED0069C07","join_eui":"0000000000000000","dev_addr":"260BE272"},"correlation_ids":["gs:uplink:01KW4PWM05KPRKH14ACZ6AENDP"],"received_at":"2026-06-27T14:14:12.437386512Z","uplink_message":{"session_key_id":"AZ2DKWrsvLI34SF6BYC4fw==","f_port":8,"f_cnt":10869,"frm_payload":"FJoEFQABi7kNygAAAEKGCg==","decoded_payload":{"battery":3530,"battery_level":0,"gas_resistance":4359.69,"humidity":10.45,"pressure":1013.05,"temperature":22.740000000000002},"rx_metadata":[{"gateway_ids":{"gateway_id":"stt-drumgeely-gateway-id","eui":"B827EBFFFEBC60E1"},"time":"2026-06-27T14:14:12.135459899Z","timestamp":926595667,"rssi":-84,"channel_rssi":-84,"snr":8,"location":{"latitude":52.699723918918075,"longitude":-8.887563943862917,"source":"SOURCE_REGISTRY"},"uplink_token":"CiYKJAoYc3R0LWRydW1nZWVseS1nYXRld2F5LWlkEgi4J+v//rxg4RDT9Oq5AxoLCLS1/9EGEKGdu20guKif6/uCCA==","received_at":"2026-06-27T14:14:12.102755295Z"}],"settings":{"data_rate":{"lora":{"bandwidth":125000,"spreading_factor":7,"coding_rate":"4/5"}},"frequency":"868500000","timestamp":926595667,"time":"2026-06-27T14:14:12.135459899Z"},"received_at":"2026-06-27T14:14:12.230395754Z","confirmed":true,"consumed_airtime":"0.071936s","version_ids":{"brand_id":"heltec","model_id":"cubecell-1-2-aa-node-class-a-otaa","hardware_version":"_unknown_hw_version_","firmware_version":"1.0","band_id":"EU_863_870"},"network_ids":{"net_id":"000013","ns_id":"EC656E0000000181","tenant_id":"ttn","cluster_id":"eu1","cluster_address":"eu1.cloud.thethings.network"},"last_battery_percentage":{"f_cnt":10769,"value":0,"received_at":"2026-06-26T21:28:24.174897133Z"}}}` from `v3/tola-park-environment@ttn/devices/slan-093/up` topic


Now lets store this to the sqlite3 database :)


mqtt_python3) pi@drumgeely:~/mqtt_python3 $ ls -al
total 36
drwxr-xr-x  5 pi pi 4096 Jun 27 15:28 .
drwx------ 23 pi pi 4096 Jun 27 15:06 ..
drwxr-xr-x  2 pi pi 4096 Jun 27 15:00 bin
-rw-r--r--  1 pi pi    1 Jun 27 15:27 database.db
drwxr-xr-x  3 pi pi 4096 Jun 27 14:59 include
drwxr-xr-x  3 pi pi 4096 Jun 27 14:59 lib
-rw-r--r--  1 pi pi  160 Jun 27 14:59 pyvenv.cfg
-rw-r--r--  1 pi pi 1262 Jun 27 15:14 test_mqtt.py
-rw-r--r--  1 pi pi  360 Jun 27 15:28 test_sqlite3.py
(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ 
(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ python3 ./test_sqlite3.py 
User: Tobias, Age: 28
(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ ls -al database.db 
-rw-r--r-- 1 pi pi 8192 Jun 27 15:28 database.db
(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ sqlite3
SQLite version 3.40.1 2022-12-28 14:03:47
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open database.db
sqlite> .databases
main: /home/pi/mqtt_python3/database.db r/w
sqlite> .tables
users
sqlite> .schema
CREATE TABLE users (name TEXT, age INTEGER);
sqlite> .exit
(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ 
(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ date
Sat 27 Jun 15:34:08 IST 2026
(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ 
(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ sqlite3 database.db 
SQLite version 3.40.1 2022-12-28 14:03:47
Enter ".help" for usage hints.
sqlite> SELECT * from users;
Tobias|28
sqlite> .exit
(mqtt_python3) pi@drumgeely:~/mqtt_python3 $ 


So we can now write user data to the user table in the databases.db file


Let's decide the table structure to store our Drumgeely sensor data

sensors - name of table

index name (20 chars), time (40 chars), data (JSON data upto 200 chars)

'slan-093 ', '2026-06-27T14:14:12.230395754Z', '{"battery":3530,"battery_level":0,"gas_resistance":4359.69,"humidity":10.45,"pressure":1013.05,"temperature":22.740000000000002}'

So 260 chars per table entry


Let's try that in real life..









(26/6/2026 09:48)

So I couldn't install plotly on drumgeely Rpi (see below) so instead I will capture sensor data locally to a sqlite database and then do 5 minute updates to graphs held on calendula Rpi (which in turn are shared on Shannon Town Community Wetlands website).


Let's start by accessing LoRaWAN sensor data using Python and MQTT ..


First let's log in remotely using a Hyper terminal shell and update the system..

Linux drumgeely 6.12.75+rpt-rpi-v7 #1 SMP Raspbian 1:6.12.75-1+rpt1~bookworm (2026-03-11) armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Jun 20 15:18:24 2026 from 172.28.15.43
pi@drumgeely:~ $ 
pi@drumgeely:~ $ sudo apt update
Get:1 http://raspbian.raspberrypi.com/raspbian bookworm InRelease [15.0 kB]                                 
Get:2 http://archive.raspberrypi.com/debian bookworm InRelease [55.0 kB]


After this let's check on disk space and uptime..





(20/6/2026 12:30)

So in this blog we will provide remotely accessible graphs on a Raspberry Pi. The RPi in question is in the 40' container of Shannon Tidy Towns in Drumgeely. I anticipate accomplishing this by the following steps:

1) Get a NoIp domain name installed on the Rpi (noip2)

2) Install webserver (apache2)

3) Install graphing software (dash_plotly)

4) Install database (sqlite3)

5) Gather (TTN, MQTT, WiFi) and post data to graph to the database

6) Created graph web pages


Most of the above has already been done by me on my RPi smart home host called calendula. So let's go through the stages...


I have an account (kilnageer@gmail.com) at https://my.noip.com/ and a number of free domains already registered. So let's use snntt57.zapto.org (which was last updated as 86.41.249.104 on Jun 17, 2026 09:27:10)


So using SSH over Zerotier I can talk to this remote Rpi and see what code it is running.

pi@drumgeely:~ $ df -m .
Filesystem     1M-blocks  Used Available Use% Mounted on
/dev/mmcblk0p2     14351 12017      1585  89% /
pi@drumgeely:~ $ sudo systemctl status apache2
Unit apache2.service could not be found.
pi@drumgeely:~ $ 


It has less than 2GB left on its 16GB microSD card and no Apache2 webserver running.

pi@drumgeely:~ $ sudo apt install apache2


pi@drumgeely:~ $ date
Sat 20 Jun 12:43:20 IST 2026
pi@drumgeely:~ $

pi@drumgeely:~ $ sudo systemctl status apache2.service 
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enab>
     Active: active (running) since Sat 2026-06-20 12:32:45 IST; 11min ago
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 26473 (apache2)
      Tasks: 55 (limit: 1556)
        CPU: 337ms
     CGroup: /system.slice/apache2.service
             ├─26473 /usr/sbin/apache2 -k start
             ├─26475 /usr/sbin/apache2 -k start
             └─26476 /usr/sbin/apache2 -k start
Jun 20 12:32:45 drumgeely systemd[1]: Starting apache2.service - The Apache HTT>
Jun 20 12:32:45 drumgeely apachectl[26472]: AH00558: apache2: Could not reliabl>
Jun 20 12:32:45 drumgeely systemd[1]: Started apache2.service - The Apache HTTP>
pi@drumgeely:~ $ 



I then tried accessing this RPi using its Zerotier IP address and I saw the Apache2 landing page. So step 2) above achieved.


Next to install the noip client that will periodically inform the No-Ip server which IP address is current assigned to this Drumgeely RPi

https://my.noip.com/dynamic-dns/duc - no good for RPi

https://raspberrytips.com/install-no-ip-raspberry-pi/ - OK

So had to build and install for Rpi using above instructions then run to perform an IP update..


pi@drumgeely:~/noip/noip-2.1.9-1 $ sudo noip2 -c /usr/local/etc/no-ip2.conf


Can then see the update at:
https://my.noip.com/dns/records?jump_to_zone=zapto.org

snntt57     A    188.65.190.74    60    Jun 20, 2026 13:00:20

###TODO Will need to make this noip2 command into a systemctl service.


But the laptop web browser still doe not get the Apache2 landing page at:

http://snntt57.zapto.org/

So may need to map port 22 through the Tenda router. Unfortunately, after logging in to the Tenda portal, via the Android app, I could see the Tenda_D986A0 device and the drumgeely Rpi and Solas WiFi dongle but the portal app gave no port mapping options. 

###TODO So may need to log in to this router locally to do this! And assign a static LAN address to the drumgeely Rpi.

Or log into the drumgeely Rpi over VNC and then launch a browser to the router at 192.168.0.1


Set static DHCP address and DMZ but still cannot remote access Apache2 server. (Also set DDNS to noip http://snntt57.zapto.org/)

###PROBLEM still cannot remotely access via http://snntt57.zapto.org/ buut OK via Zerotier IP address

###SOLUTION webscrape graphical pages and republish to ShannonTownWetlands.ie website for public access.



So I will park this up for now and get the graphing software installed..

https://dash.plotly.com/installation

pi@drumgeely:~ $ mkdir dash_plotly

pi@drumgeely:~ $ python3 -m venv ./dash_plotly/

pi@drumgeely:~ $ source ./dash_plotly/bin/activate

(dash_plotly) pi@drumgeely:~ $ 

(dash_plotly) pi@drumgeely:~ $ pip install dash

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple


###PROBLEM After lots of timeouts installing I then got a runtime error..


(dash_plotly) pi@drumgeely:~/dash_plotly $ python ./app.py 

Traceback (most recent call last):

  File "/home/pi/dash_plotly/./app.py", line 2, in <module>

    import plotly.express as px

  File "/home/pi/dash_plotly/lib/python3.11/site-packages/plotly/express/__init__.py", line 12, in <module>

    raise ImportError(

ImportError: Plotly Express requires numpy to be installed. You can install numpy using pip with:


$ pip install numpy


Or install Plotly Express and its dependencies directly with:


$ pip install "plotly[express]"


You can also use Plotly Graph Objects to create a large number of charts without installing

numpy. See examples here: https://plotly.com/python/graph-objects/


(dash_plotly) pi@drumgeely:~/dash_plotly $ 


Same code runs OK on calendula Rpi!


Tried editing xxxxx/_init_.py see:

https://stackoverflow.com/questions/69866554/trying-to-import-plotly-express-but-get-this-error-even-though-pandas-is-install

but didn't help


Moved on to install sqlite3

https://www.tech-reader.blog/2025/08/installing-and-verifying-sqlite-on.html


pi@drumgeely:~ $ sudo apt install sqlite3


pi@drumgeely:~ $ sqlite3 --version

3.40.1 2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f3alt1

pi@drumgeely:~ $ 










Monday, 20 April 2026

How to use an ESP32-C6-GEEK as a WiFi Light Switch

 I wanted to allow WiFi controlled lights to be turned ON/OFF easily if someone presses a switch.


To do this I used an ESP32-C6-GEEK running micropython to monitor is GPIOx line and publish ON or OFF to MQTT topic XXX


I also made it into a presence sensor and issue an ON every 20 secs if there is WiFi disturbances


First, I went to https://micropython.org/download/ESP32_GENERIC_C6/ and downloaded the image to my board using my laptop


You can connect to the device by plugging it into the laptop and following the instructions at https://circuitpython.org/board/seeed_xiao_esp32c6/ to flash it.


I need the code to connect to WiFi SSID: Tenda_D98860 and then to the Tola Park MQTT broker. After this it should send a status every 30 secs of its uptime in seconds

Then if GPIOx goes low it should turn on teh light by posting ON to MQTT topic ...




Turning a Rpi and RAK2245 into a LoRaWAN TTN Gateway

(Mon 20th Apr 2026 18:57)

Amazing how straightforward the process is. I have done both a RPi3 (drumgeely) and a RPi4 (tarbh) over the last two days.

Here are the steps:

1) Use the RPi Imager on a laptop to flash "Raspberry Pi OS (Legacy 32-bit) Full, Debian Bookworm released 2026-04-13" onto a 16GB microSD card. I confugired it to have SSH enabled and to use the WiFi SSID: Tenda_D98860

2) Install the microSD into a RPi and boot up. Log in using SSH and run "sudo raspi-config" to enable VNC, SPI, I2C and disable terminal but enable hardware over Serial Port. Also do a "sudo apt update" followed by an "sudo apt upgrade"

3) Next install DOCKER using the commands:

$ curl -sSL https://get.docker.com | sh

$ sudo usermod -aG docker $USER

Then log out and back in again.

(See https://raspberrytips.com/docker-on-raspberry-pi/ )

(PS: Handy cheat sheet here: https://docker.how/)

4) After this follow the instructions at: https://github.com/WGLabz/LoRaWAN-Basic-Station-RAK831-

Namely:

4a) Edit the example.env file to have your MQTT and TTN values. I set TTN_API_KEY to one I generated on the TTN gateway site just to shared gateway data. Oh and create a new TTN gateway if you need to. You'll be needing its TTN gatewy_id

4b) The run "set -a; env ./example.env; set +a; env" Check all is OK

4c) Then run "docker compose build gateway-mqtt-publisher" followed by "docker compose up -d"

That's it you should be connected to the TTN gateway and sharing data.

I also installed zerotier on the RPi see: https://pimylifeup.com/raspberry-pi-zerotier/

And I installed the RPi health monitor over MQTT see: https://github.com/RichFesler/rpi-healthmon

After installing "sudo apt install mosquitto-clients" you should see:

pi@tarbh:~/LoRaWAN-Basic-Station-RAK831- $ mosquitto_sub -h BROKER_IP_ADDR -u USER -P PASSWORD -t 'gateways/#' -v

gateways/ttn/uplink_count 2

gateways/ttn/downlink_count 2

gateways/ttn/last_uplink_received_at 2026-04-20T17:11:54.574278383Z

gateways/ttn/last_downlink_received_at 2026-04-20T17:11:55.025295058Z

gateways/ttn/connected 1

gateways/ttn/last_update 2026-04-20T17:15:50.177083



gateways/ttn/uplink_count 2

gateways/ttn/downlink_count 2

gateways/ttn/last_uplink_received_at 2026-04-20T17:11:54.574278383Z

gateways/ttn/last_downlink_received_at 2026-04-20T17:11:55.025295058Z

gateways/ttn/connected 1

gateways/ttn/last_update 2026-04-20T17:16:00.385460

gateways/ttn/uplink_count 2

gateways/ttn/downlink_count 2

gateways/ttn/last_uplink_received_at 2026-04-20T17:11:54.574278383Z

gateways/ttn/last_downlink_received_at 2026-04-20T17:11:55.025295058Z

gateways/ttn/connected 1

gateways/ttn/last_update 2026-04-20T17:16:10.593140


and:

pi@tarbh:~/rpi-healthmon $ mosquitto_sub -h $MQTT_BROKER -u $MQTT_USER -P $MQTT_PASS -t 'health/#' -v

health/drumgeely_rpi3/376f195d8ae4/status online

health/drumgeely_rpi3/376f195d8ae4/state {"ts":"2026-04-20T09:54:22.198247+00:00","node_id":"376f195d8ae4","state":"FAULT","uptime_s":26,"root_ro":false,"failed_units_count":0,"kernel_event_counts":{},"fault_flags":["power_thermal:throttled"],"temp_c":31.1,"throttled":"0x50005","load_1m":2.42,"mem_avail_pct":79.5,"disk_used_pct_root":84}

health/site/376f195d8ae4/status online

health/site/376f195d8ae4/state {"ts":"2026-04-19T17:45:49.917683+00:00","node_id":"376f195d8ae4","state":"FAULT","uptime_s":72973,"root_ro":false,"failed_units_count":0,"kernel_event_counts":{},"fault_flags":["power_thermal:throttled"],"temp_c":49.4,"throttled":"0x50000","load_1m":0.01,"mem_avail_pct":75.0,"disk_used_pct_root":84}

health/site/981195a3cb65/status online

health/site/981195a3cb65/state {"ts":"2026-04-20T16:36:23.744367+00:00","node_id":"981195a3cb65","state":"FAULT","uptime_s":3459,"root_ro":false,"failed_units_count":0,"kernel_event_counts":{},"fault_flags":["power_thermal:throttled"],"temp_c":49.2,"throttled":"0x50000","load_1m":0.21,"mem_avail_pct":94.7,"disk_used_pct_root":83}

health/tarbh_rpi4/981195a3cb65/status online

health/tarbh_rpi4/981195a3cb65/state {"ts":"2026-04-20T16:45:58.302428+00:00","node_id":"981195a3cb65","state":"FAULT","uptime_s":4034,"root_ro":false,"failed_units_count":0,"kernel_event_counts":{},"fault_flags":["power_thermal:throttled"],"temp_c":49.2,"throttled":"0x50000","load_1m":0.31,"mem_avail_pct":94.7,"disk_used_pct_root":83}


Enjoy :)





Thursday, 12 February 2026

Making a Heltec CubeCell Capsule based The Things Stack LoRaWAN sensor

 (Thurs 12th Feb 2026 16:10) What devices have we got?

A quick check shows 4 devices.

CubeCell Capsule devices


What is the status of each? I have a development interface board which allows me to check for any serial output and to do Arduino IDE development.

The one plugged into the interface board is labelled slan-008 and its serial output shows:

16:16:56.174 -> Copyright @2019-2020 Heltec Automation.All rights reserved.
16:16:56.505 -> 
16:16:56.505 -> 
16:16:56.505 -> Sketch: BME680_TTN_V3_slan_008_v1_3
16:16:56.505 -> Version: v1.3 Sat 7th Sept 2024 16:43
16:16:56.505 -> Board: CubeCell-Capsule (HTCC-AC0X)
16:16:56.505 -> 
16:16:56.505 -> 
16:16:56.505 -> AT Rev 1.3
16:16:56.505 -> +AutoLPM=1
16:16:56.505 -> 
16:16:56.505 -> +LORAWAN=1
16:16:56.505 -> 
16:16:56.505 -> +KeepNet=0
16:16:56.505 -> +OTAA=1
16:16:56.505 -> +Class=A
16:16:56.505 -> +ADR=1
16:16:56.505 -> +IsTxConfirmed=1
16:16:56.505 -> +AppPort=8
16:16:56.505 -> +DutyCycle=1740000
16:16:56.538 -> +ConfirmedNbTrials=4
16:16:56.538 -> +ChMask=0000000000000000000000FF
16:16:56.538 -> +DevEui=xxxxxxxxxxxxxxxx(For OTAA Mode)
16:16:56.538 -> +AppEui=xxxxxxxxxxxxxxxx(For OTAA Mode)
16:16:56.538 -> +AppKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(For OTAA Mode)
16:16:56.538 -> +NwkSKey=00000000000000000000000000000000(For ABP Mode)
16:16:56.538 -> +AppSKey=00000000000000000000000000000000(For ABP Mode)
16:16:56.538 -> +DevAddr=00000000(For ABP Mode)
16:16:56.538 -> 
16:16:56.538 -> 
16:16:56.538 -> LoRaWAN EU868 Class A start!
16:16:56.571 -> 
16:16:56.671 -> joining...joined
16:17:03.012 -> Could not find a valid BME680 sensor, check wiring!




So what next? Let's find the BME680_TTN_V3_slan_008_v1_3.ino sketch. Cannot find sketch or entry on Heltec site for these devices (only V3). But found this:

https://iotci.co.uk/product/heltec-lora-node-asr6502-capsule-sensors-cubecell-sensor-for-arduino-lora-iot-waterproof-ip67-soalr-panel/

So lets our existing code and extend it to support more than just the BME680 sensor!

(17:07) That's done and code runs but just reports voltage on the serial line. So I will commit this code to GitHub as version 1.15

Looking at what capsule sensors I have I find four:





The BME680 is know and can be added to slan-008 (good test to reverting code to support BME680 in secrets.h file)


Fortunately, the above website lists all the capsule sensors:


Capsule sensors



So what code is needed?

(22:00) Checked all four Capsules and all have issues:

slan-008 works but battery doesn't charge. Is the battery bad?

slan-009 no serial output and cannot program as timeout waiting for bootloader

slan-013 works but reported battery readings incorrect and erratic

slan-XXX no serial output but red flash when power connected (programmed with slan-009 code by holding USER button but it ignores reset. So I think broken)













Tuesday, 10 February 2026

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

(Thurs 12th Feb 2026 16:03) Housing the units

The sensors and gateway now need to be housed. The following needs to be addressed:

1) Look attractive

2) Allow for display to be seen

3) Be water resistant (assume inside polytunnels will get wet)

4) Facilitate dismantling for maintenance

slan-031 and slan-093 (red tape)



A bit wet today so will return to this and search shed for materials another time.






(Weds 11th Feb 2026 20:10) Finalising the code

So over 24 hours the battery level has dropped from 4008 mV to 3980 mV. That's roughly 1 mV per hour. So will hit 3500 mV in 480 hours or 20 days - if everything keeps linear. Not bad. But what if I turned off the RGB LED after the first transmission? So here our tonight's tasks:

1) Turn off RGB LED after first transmission

2) Make code generic. That is move all secrets and ids to secret.h (don't push this to GitHub)

(21:18) Happy days. All checked in to GitHub and secrets.h.slan031 emailed to myself (this must replace the GitHub secrets.h before an operational slan-031 can be built)

Now to use this code (https://github.com/kilnageer2/HTCCAB02_LORA_DISPLAY_BME680)  to build a slan-093 by just changing secrets.h

The website: https://shannontownwetlands.ie/environmental-sensors/drumgeely-polytunnels can then be used to monitor the polytunnels (once the gateway and two devices have been boxed and deployed).

I searched in spreadsheet "2025 Attic Boxes v4" on my Google Drive to fine more Heltec HTCC-AB02 devices - though I do have one more soldered to RJ45 socket on my desk). 

Only 433 MHz ones on attic list (other attic boxes not yet added to spreadsheet!), So will have a quick look in bedroom before desoldering the one in LoRaWAN draw of my four draw cabinet by my desk. (This draw also has CubeCell Capsules x5 and Vision Master E290 x2 to get going :) )

(21:47) Found slan-031 HTCC-AB02 which successfully transmits every 5 secs but has no pins soldered to it so no sensor attached! But its orange LED charge light is on which is good,

(23:16) got slan-03 online and found great woven 4-wire cable to connect BME680 to HTCC-AB02





After battery is charged I will correct LOW_BATTERY_LEVEL and then commit tweaks to main code (added device name print statement). No need changed it to 3300 which works OK. Great. So 3.3 V low level operation limit rather than 3.5 V from normal 4.1 V.



(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)
















Monday, 9 February 2026

Celestron NexStar 130SLT Telescope automation

(Sun 8th Feb 2026 21:00)

Nearly got scope calibrated but clouds arrived at 10 pm. Need three bright stars and a clear sky now.

So why talk about this here?

Well a WiFi dongle for this scope cost 200 euros. Enough said.

https://www.amazon.co.uk/Celestron-93973-Skyportal-Wifi-Module/dp/B00OJ5Z2NM




Too cold for outside and no 12V power

12V power and star finder fixed