Akulatraxas / ha-modbusproxy

Hassio Addon packaging modus-proxy
Apache License 2.0
31 stars 3 forks source link

Error reading modbus #6

Closed rzulian closed 1 year ago

rzulian commented 1 year ago

I was experiencing a lot of timeouts and errors, while reading from the modbus using the solaredge_modbus component. Sometime ago I wasn't getting those errors, so I was thinking that the problem was on the HA releases, but I've tried different versions and I still have errors. I've tried to use your proxy, but I'm getting errors as well. A lot less to be fair. Now I think that either I've got a firmware update from Solaredge, that is interfering with the modbus. Or that the new network (Unifi router and switches) is doing something wrong. Do you have suggestions on how I can investigate this?

Those are the errors in the proxy

2022-07-25 16:47:38,792     INFO modbus-proxy.Client(192.168.1.22:53325): new client connection
2022-07-25 16:47:38,796     INFO modbus-proxy.ModBus(192.168.1.6:502): connecting to modbus...
2022-07-25 16:47:38,802     INFO modbus-proxy.ModBus(192.168.1.6:502): connected!
2022-07-25 16:47:38,804     INFO modbus-proxy.ModBus(192.168.1.6:502): delay after connect: 0.1
2022-07-25 16:48:13,800     INFO modbus-proxy.Client(192.168.1.22:36487): new client connection
2022-07-25 16:48:18,801     INFO modbus-proxy.Client(192.168.1.22:50345): new client connection
2022-07-25 16:48:18,822    ERROR modbus-proxy.ModBus(192.168.1.6:502): write_read error [1/2]: TimeoutError()
2022-07-25 16:48:18,823     INFO modbus-proxy.ModBus(192.168.1.6:502): closing connection...
2022-07-25 16:48:18,825     INFO modbus-proxy.ModBus(192.168.1.6:502): connection closed
2022-07-25 16:48:18,829     INFO modbus-proxy.ModBus(192.168.1.6:502): connecting to modbus...
2022-07-25 16:48:28,830    ERROR modbus-proxy.ModBus(192.168.1.6:502): write_read error [2/2]: TimeoutError()
2022-07-25 16:48:28,832     INFO modbus-proxy.Client(192.168.1.22:53325): closing connection...
2022-07-25 16:48:28,836     INFO modbus-proxy.ModBus(192.168.1.6:502): connecting to modbus...
2022-07-25 16:48:28,840     INFO modbus-proxy.Client(192.168.1.22:53325): connection closed
2022-07-25 16:48:38,834    ERROR modbus-proxy.ModBus(192.168.1.6:502): write_read error [1/2]: TimeoutError()
Akulatraxas commented 1 year ago

@rzulian

Do you by any chance have something else in the network that tries to connect to the modbus server? If you have the chance then sniff (tcpdump?) as close to the port of the inverter as possible if there might be something else that tries to connect. Is your inverter connected via wifi or lan? As first step you can run a continuous ping from the system that runs your HA (or even configure a ping sensor) to at least rule out that there is a network problem.

rzulian commented 1 year ago

Thank you for your suggestions. Double checking the inverter I think I've found the problem. For some unknown reason, maybe a firmware update, the inverter was without the subnet mask. Now it's working correctly. Thank you for your support!