Timeout from HA Modbus Proxy?

Hi!

I’ve installed and set up HA Modbus Proxy (GitHub - Akulatraxas/ha-modbusproxy: Hassio Addon packaging modus-proxy) on my Raspberry Pi running Home Assistant in order to get data from my Sungrow inverter.

I know that the inverter can and will deliver modbus data over TCP since I can query it using qModMaster (QModMaster download | SourceForge.net) and get data like this:

2024-05-05_14-19-16

I can also see in the log from modbus proxy that my Home Assistant machine (192.168.1.60) can contact the modbus server (192.168.1.75) but it always ends in a write_read error in the form of a timeout error. In the log below you see that I upped the delay after connect from the default 0.1 to to 2 but it doesn’t seem to matter.

Thought I’d just leave it overnight to see if it stabilizes, but would appreciate any pointers and suggestions regarding this. I’m not sure that the proxy is the only source making modbus queries though since the Sungrow inverter is connected to iSolarCloud (Sungrows cloud platform) that serves data to an app.

2024-05-06 21:07:49,193     INFO modbus-proxy: Starting...
2024-05-06 21:07:49,209     INFO modbus-proxy.ModBus(192.168.1.75:502): Ready to accept requests on 0:502
2024-05-06 21:07:49,366     INFO modbus-proxy.Client(192.168.1.60:51490): new client connection
2024-05-06 21:07:54,133     INFO modbus-proxy.ModBus(192.168.1.75:502): connecting to modbus...
2024-05-06 21:07:54,145     INFO modbus-proxy.ModBus(192.168.1.75:502): connected!
2024-05-06 21:07:54,146     INFO modbus-proxy.ModBus(192.168.1.75:502): delay after connect: 2.0
2024-05-06 21:08:06,149    ERROR modbus-proxy.ModBus(192.168.1.75:502): write_read error [1/2]: TimeoutError()
2024-05-06 21:08:06,150     INFO modbus-proxy.ModBus(192.168.1.75:502): closing connection...
2024-05-06 21:08:06,151     INFO modbus-proxy.ModBus(192.168.1.75:502): connection closed
2024-05-06 21:08:06,151     INFO modbus-proxy.ModBus(192.168.1.75:502): connecting to modbus...
2024-05-06 21:08:06,155     INFO modbus-proxy.ModBus(192.168.1.75:502): connected!
2024-05-06 21:08:06,156     INFO modbus-proxy.ModBus(192.168.1.75:502): delay after connect: 2.0
2024-05-06 21:08:06,241     INFO modbus-proxy.Client(192.168.1.60:36512): new client connection
2024-05-06 21:08:18,162    ERROR modbus-proxy.ModBus(192.168.1.75:502): write_read error [2/2]: TimeoutError()
2024-05-06 21:08:18,163     INFO modbus-proxy.ModBus(192.168.1.75:502): closing connection...
2024-05-06 21:08:18,163     INFO modbus-proxy.ModBus(192.168.1.75:502): connection closed
2024-05-06 21:08:18,164     INFO modbus-proxy.Client(192.168.1.60:51490): closing connection...
2024-05-06 21:08:18,164     INFO modbus-proxy.ModBus(192.168.1.75:502): connecting to modbus...
2024-05-06 21:08:18,165     INFO modbus-proxy.Client(192.168.1.60:51490): connection closed
2024-05-06 21:08:18,170     INFO modbus-proxy.ModBus(192.168.1.75:502): connected!
2024-05-06 21:08:18,170     INFO modbus-proxy.ModBus(192.168.1.75:502): delay after connect: 2.0
2024-05-06 21:08:26,242     INFO modbus-proxy.Client(192.168.1.60:37608): new client connection
2024-05-06 21:08:30,177    ERROR modbus-proxy.ModBus(192.168.1.75:502): write_read error [1/2]: TimeoutError()
2024-05-06 21:08:30,177     INFO modbus-proxy.ModBus(192.168.1.75:502): closing connection...
2024-05-06 21:08:30,177     INFO modbus-proxy.ModBus(192.168.1.75:502): connection closed
2024-05-06 21:08:30,178     INFO modbus-proxy.ModBus(192.168.1.75:502): connecting to modbus...
2024-05-06 21:08:30,184     INFO modbus-proxy.ModBus(192.168.1.75:502): connected!
2024-05-06 21:08:30,184     INFO modbus-proxy.ModBus(192.168.1.75:502): delay after connect: 2.0

Did you got any solution? Have the same Problem.

I have the same problem too.

I have exactly the same problem. Any Idea?

1 Like

Sadly this appears to be a typical issue.
I have the Proxy running now. With 0.1 second delay it didn’t work with my Huawei Inverter at all, upping the delay to 1 Second and it is now working reliably, but still dropping the connection very regularly. It always managed to put itself together again, but it’s far from perfect.

Sorry for the very late reply!

I haven’t had any issues with the modbus data for almost a year now. The fact that it’s been a long time since I thought about it makes it difficult to pinpoint exactly what I changed to make it work though.

If I’m not mistaken, I think the problems were related to the network configuration rather than the actual integration. In the process of connecting the Sungrow inverter to Home Assistant I had to replace the existing router with new ones (a mesh system) and when doing so I configured the new network in a way that created problems with the IP series (I used the wrong subnet mask). On top of that it turned out that two of the units in my new mesh network had issues related to speeds on some of their ethernet ports.

The solution was to replace the mesh routers with a new set (claim the warranty) and configure the subnet mask correctly.

After that there has been no problems.