Open ele-dev opened 1 month ago
POC for a Modbus/TCP client in C++ with libmodbus-dev was successfully tested on WSL2 with a Shelly Pro 3em.
First local build of the energy manager with modbus powermeter support is finished and will undergo testing
Basic tests passed. After some hours sometimes it suddenly receives invalid modbus data and does not auto recover from it yet. Taken measures:
Modbus polling issues remain a consistent problem. After a few hours of stable operation the Invalid Data error reappears without a logical explanation. One more idea would be to set a higher request-response-timeout and hope it will become more durable. It's concerning because I can't even be sure wether it's actually something wrong in my code or if the shelly modbus firmware might need patches. An auto reconnect is planned to at least temporarily have a working system again.
a python modbusclient has proven that is is a connection or firmware problem of the shelly. auto connection recovery and optional TCP keepalive has been implemented for Modbus/TCP
The non blocking UDP listener works very well but is very specialized to my personal setup with the Berry script running the tasmota energy meter. A more generic interfaces class for energy meters would allow implementation of additional protocols such as HTTP or Modbus/TCP for other energymeters (e.g. Shelly Pro 3em)