My project has largely been a trial and error figuring out states, triggers, etc. High level is is three components: An relay board with input switches and MODBUS (Waveshare ESP32 S3 8RO 8DI), a small refrigerator controller (T-display S3) and an ESP32P4 display with touch (m5stack tab5). I don’t use homeassistant (but will eventually): everything communicates via packet_transport binary/sensors
The system largely works but wireless communications break and I am clueless why. I suspect some sort of busy loop preventing some processes to run. Specifically now I have these problems:
1, cannot update OTA
2, Web page works, but the ON/OFF switches for the relays don’t work
3, udp.packet_transport and logging work wirelessly
INFO Connecting to 10.0.0.36 port 3232...
INFO Connected to 10.0.0.36
INFO Uploading C:\Development\esphome-dev\.esphome\build\vancontroller\.pioenvs\vancontroller\firmware.bin (1009200 bytes)
ERROR Error receiving version: [WinError 10053] An established connection was aborted by the software in your host machine
WARNING Failed to upload to ['vancontroller.local']
PS C:\Development\esphome-dev>
Sometimes even the built in web page fails. I errors like this each time I try to load:
[10:32:07.692][I][Switch:057]: ExteriorLights OFF
[10:32:21.289][I][safe_mode:042]: Boot seems successful; resetting boot loop counter
[10:33:17.391][I][esp-idf:000][httpd]: E (116202) httpd: httpd_accept_conn: error in accept (23)
Any hints where to look? I am using udp packet_transport and that continues to work throughout all this. Fortunately serial loads always work.
Through experimentation I found that referencing a template binary sensor that returns the state of a relay trashes both uploads, logs and web pages.
# Relay outputs -> packet transport
- platform: template
id: Starlink
# lambda: return id(relay1).state;
So I convey state like this:
switch:
...
- id: !extend relay1
name: Relay 1 Starlink
on_state:
- lambda: 'id(Starlink).publish_state(x);'
which seems to work.
Anyway the config is 500+ lines, so I didn’t post it here.