Monday, 2 February 2026

Making a ESP32-CAM into a Smart Home sensor

This device couldn't be programmed with a Tasmota binary https://ota.tasmota.com/tasmota32/release/ from the Webinstaller https://tasmota.github.io/install/ 

Maybe I'm not holding the RST and PRG buttons properly to enable programming>




But let's try the factory binary...




Making an ESP32-C6-LCD a Smart Home monitor

This device can be programmed wit the factory C6 binary.. and use SVGL to control LCD display







Making a ESP32-C3 based Smart Home Monitor

This device is well supported by Tasmota so the easiest path is to FLASH the binary image from https://ota.tasmota.com/tasmota32/release/tasmota32c3.bin on to it using the Tasmota Web based Installer at: https://tasmota.github.io/install/


Remember to press and HOLD the bott button when plugging in the cable so the USB serial port can be seen. Also remember to erase device first and load tasmota32c3.factory.bin before loaded the above binary and check wiith the LOG & CONSOLE option and RESET that it has booted OK.


Then ensure the IP address of 192.168.1.156 is reserved for it by the router and set up MQTT (Configure > MQTT) and rename it TasmotaESP32C3156 using the menus (Configure > Other > Device Name & Friendly Name) the device will reset itself after each setting change and you can use the WebInstaller to check its logs.


You are now ready to make it a MQTT connected Smart Home sensor!



Here are a few screen shots from the Linux Mint 22 laptop during the flashing process...

















Sunday, 1 February 2026

Making an ESP32-C6-GEEK smart home monitor

I will use ESPHome to create a device that shows RED / YELLOW / GREEN depending on my Smart Home status posted to a MQTT topic.




First I will install docker. on my Linux Mint 22 laptop :

coderdojo@rhubarb:~$ cat /etc/os-release | grep PRETTY
PRETTY_NAME="Linux Mint 22"

https://itsfoss.gitlab.io/post/how-to-install-docker-on-linux-mint-22-or-21-step-by-step/

Next used docker to install ESPHome :

https://esphome.io/guides/getting_started_command_line/


oderdojo@rhubarb:~$ docker pull ghcr.io/esphome/esphome

Using default tag: latest



..
coderdojo@rhubarb:~$ 
coderdojo@rhubarb:~$ nano livingroom.yaml 
coderdojo@rhubarb:~$ 
coderdojo@rhubarb:~$ docker run --rm --privileged -v "${PWD}":/config --device=/dev/ttyACM0 -it ghcr.io/esphome/esphome run kitchen.yaml
INFO ESPHome 2026.1.3
INFO Reading configuration kitchen.yaml...
WARNING 'esp32c6geek_monitor': Using the '_' (underscore) character in the hostname is discouraged as it can cause problems with some DHCP and local name services. For more information, see https://esphome.io/guides/faq/#why-shouldnt-i-use-underscores-in-my-device-name
INFO Generating C++ source...
..


Hash of data verified.
Wrote 3072 bytes (134 compressed) at 0x00008000 in 0.0 seconds (934.8 kbit/s).
Hash of data verified.
Wrote 8192 bytes (31 compressed) at 0x00009000 in 0.0 seconds (2075.3 kbit/s).
Hash of data verified.

Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyACM0 with baud rate 115200

[14:04:01.286][I][app:087]: Running through setup()
[14:04:01.286][C][wifi:475]: Starting
[14:04:01.286][D][wifi:1098]: Starting scan
[14:04:01.286][C][component:249]: Setup wifi took 70ms
[14:04:01.286][I][app:134]: setup() finished successfully!
[14:04:01.286][W][component:395]: wifi set Warning flag: scanning for networks
[14:04:04.028][D][wifi:1227]: Found networks:
[14:04:04.029][I][wifi:1188]: - 'Tola Park' (48:5D:35:F6:D1:AA) ▂▄▆█ Ch: 1 -66dB P:0
[14:04:04.030][D][wifi:1259]: - 7 non-matching (VERBOSE to show)
[14:04:04.031][D][wifi:1563]: Retry phase: INITIAL_CONNECT → SCAN_CONNECTING
[14:04:04.032][I][wifi:899]: Connecting to 'Tola Park' (48:5D:35:F6:D1:AA) (priority 0, attempt 1/2 in phase SCAN_CONNECTING)...
[14:04:04.227][W][component:543]: safe_mode took a long time for an operation (158 ms)
[14:04:04.227][W][component:546]: Components should block for at most 30 ms
[14:04:06.083][I][wifi:1329]: Connected
[14:04:06.083][D][wifi:1346]: Disabling AP
[14:04:06.084][C][wifi:1037]:   IP Address: 192.168.1.162
[14:04:06.084][C][wifi:1048]:   SSID: 'Tola Park'
[14:04:06.085][C][wifi:1048]:   BSSID: 48:5D:35:F6:D1:AA
[14:04:06.085][C][wifi:1048]:   Hostname: 'esp32c6geek_monitor'
[14:04:06.086][C][wifi:1048]:   Signal strength: -66 dB ▂▄▆█
[14:04:06.086][C][wifi:1048]:   Channel: 1
[14:04:06.086][C][wifi:1048]:   Subnet: 255.255.255.0
[14:04:06.086][C][wifi:1048]:   Gateway: 192.168.1.1
[14:04:06.086][C][wifi:1048]:   DNS1: 192.168.1.1
[14:04:06.087][C][wifi:1048]:   DNS2: 0.0.0.0
[14:04:06.087][W][component:426]: wifi cleared Warning flag
[14:05:00.962][I][safe_mode:066]: Boot seems successful; resetting boot loop counter
[14:05:02.204][D][esp32.preferences:155]: Writing 1 items: 0 cached, 1 written, 0 failed


This worked OK and I managed to program it. But I think Tasmota might be easier.. as Web interface and console log make it easier to modify, maintain and debug  :)

https://tasmota.github.io/install/  "Tasmota32 LVGL (english)"


Blast! ESP32-C6 not yet supported!
https://ota.tasmota.com/tasmota32/release/
https://ota.tasmota.com/tasmota32/release/tasmota32c6.bin


NOTE: I tried Tasmota WebInstaller https://tasmota.github.io/install/ and factory binary (tasmota32c6.factory.bin)  but it still just said waiting for download after a reset.

Ha! This was actually working and I could connect to its WiFi hotspot and configure it! Happy Days :)

Now how to I control the display? LVGL or Berry or both?
I see its menu offers "Tools > Extension Manager" with a "LVGL Panel v25.10.1.0" option.

https://tasmota.github.io/docs/Tasmota-Extension/

https://docs.waveshare.com/ESP32-C6-GEEK

But maybe I must define its GPIO first? I see "Tools > GPIO Viewer" looks good but no entry for this board. Do I make one?

Board schematic:
https://files.waveshare.com/wiki/ESP32-C6-GEEK/ESP32-C6-GEEK.pdf

https://documentation.espressif.com/esp32-c6_datasheet_en.pdf
https://files.waveshare.com/wiki/common/ST7789P3.pdf

The schematic shows 5 control pins for LCD1 (the ST 7789 P3 display?) named:

GPIO2 a red box shows this mapping LCD MOSI goes to display pin SDA
GPIO1                                                  LCD CLK                                  SCL
GPIO3                                                  LCD DC                                     RS
GPIO4                                                  LCD RST                                   RESET
GPIO5                                                  LCD CS                                     CS
and
GPIO6                                                  LCD BL    separate Back Light (BL) circuit

So first test is to toggle BL on/off using GPIO6


Yep. Defined GPIO6 ad a Relay using "Configuration > Module" menus (Module Type was "ESP32C6(1)"

Then after reset I had a TOGGLE button at 192.168.1.162 which toggled the very faint back light ON and OFF :)


Now trying ESP-IDF build following instructions at..

https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/linux-macos-setup.html

 1186  cd esp

 1187  ls

 1188  git status .

 1189  cd esp-idf/

 1190  git status .

 1191  ./install.sh esp32c6

 1192  ./install.sh all

 1193  . $HOME/esp/esp-idf/export.sh








Saturday, 31 January 2026

Improving Smart Home Resilience

The other day I noticed the button on my Android MQTT Dash app wasn't turning my kitchen sink LEDs on and off.

That night my smart home failed to charge up my LFP batteries on cheap rate electricity.

The next morning I investigated and found that the sionnach RPi3 whose Node-Red program was responsible for both kitchen LEDs and LFP charging was off line.

Power cycling this computer fixed everything.

However, I decided after this that I must monitor my smart home better.

This blog post tracks my actions to achieve this!


DESIGN GOALS

1) Monitor all machines and services

2) Provide a fail safe RED / YELLOW / GREEN display

3) Provide hourly detailed status reports.

4) Write code in object oriented Python3 (or on ESP32 MicroPython)


DETAILED BREAKDOWN

My smart home is based on an LTE router for Internet access which is connect to a Fritz!Box router for local LAN/WiFi access.

The later has DHCP running to assign IP addresses to the various devices (i.e. RPi3s. Zigbee routers, etc.)


So what do we want to check on?

a) Is the LTE router connected to the internet?

b) Is the Fritz!Box connected to the internet?

c) Are the N devices with IP addresses online?

d) Are the M services supplied by the N devices running?

How can we do this?

Let's make every device and service created and update a MQTT topic periodically

Let's have the RPi4 devices check these topics for updates using object oriented Python3 scripts

Let's update a ESP32-C6-GEEK display with RED / YELLOW / GREEN every 10 secs based on the results of our checks

Let's publish details of these checks to other MQTT topics








Thursday, 15 January 2026

Battery monitoring over BLE

 Well, it's been a minute. So this post details how to talk to three 24V LFP batteries over bluetooth.




The goal is to run a Python3 script as a system service on a Raspberry Pi to update via MQTT the battery voltages, currents and SoC % every few minutes.

The BMS run by each battery is below:

 BLE MAC              Name                     Type
'A4:C1:37:10:00:D2', 'SP10S009-L8S-100A-B-U', 'JK?'
'04:7F:0E:00:1A:7C', 'BR2262e-s',             'Xiaoxiang'
'40:18:04:01:23:34', 'DL-401804012334',       'Daly'

 

Here's the pseudo code:

For each of the three batteries {
    connect to battery (MAC_ADDDRESS, BMS_TYPE )
    get_voltages()
    get_current()
    get_SoC()
    disconnect()
    publish_to_MQTT()
}

This will use object orientated Python3 code and timeouts if async calls need to be used in blocking function calls.

So, examining the https://github.com/KrystianD/smart_bms.git code which works with the "JK?" type BMS lets see how it get the job done...

The smart_bms/TransportBLE.py code makes a BLE connection to the battery using the Bleak library to provide a client.










Tuesday, 2 April 2024

Installed 2x 100W panels on 40' shipping container for Shannon Tidy Towns

 I did install one last year. See https://shannontidytowns.blogspot.com/2023/06/we-now-have-solar-powered-light-in-our.html

And that blog has the installation details. This blog concentrates more on the design.


So I have used Scratch to draw a system diagram overlaying photos of the components.


1) Two 100W PV panels wired in parallel to give 20V @ 10A max. (So a 200Wp system)

2) An isolation switch to disconnect both PV cables from the charge controller (inside the container)

3) An Epever LS2024B charge controller. NOTE: external fuses for battery and PV have been added

4) A 12V lead acid car battery (Exide Excell RB442 44Ah @ 12v) So when 100% charge can supply 12v @ 1A for 22 hours before it reaches 50% charge.

5) A LED lamp. This is a white LED strip fitted behind the white diffusion layer of a flat TV screen.

6) A rocker switch to turn the LED lamp ON and OFF








And below is a more traditional system diagram :)