saidlm / Domoticz-Solax-plugin

Plugin to monitor and control Solax inverter from Domoticz via ModBUS over TCP/IP
MIT License
1 stars 0 forks source link

Modbus Error: [Input/Output] [Errno 104] Connection reset by peer #7

Closed averter closed 1 month ago

averter commented 1 month ago

Error as described in the title. The plugin cannot connect to the inverter/read its values. Example debug log below. Pymodbus version: 3.0.0-7 Domoticz version: 2024.7

2024-07-28 09:19:11.009 Solax: Pushing 'onHeartbeatCallback' on to queue
2024-07-28 09:19:11.060 Solax: Processing 'onHeartbeatCallback' message
2024-07-28 09:19:11.060 Solax: Acquiring GIL for 'onHeartbeatCallback'
2024-07-28 09:19:11.060 Solax: Calling message handler 'onHeartbeat' on 'module' type object.
2024-07-28 09:19:11.060 Solax: onHeartbeat
2024-07-28 09:19:11.060 Solax: Connecting to: 192.168.1.3:502
2024-07-28 09:19:11.504 Solax: Modbus Error: [Input/Output] [Errno 104] Connection reset by peer
2024-07-28 09:19:11.504 Solax: Connecting to: 192.168.1.3:502
2024-07-28 09:19:12.604 Solax: Modbus Error: [Input/Output] [Errno 104] Connection reset by peer
2024-07-28 09:19:12.604 Solax: Connecting to: 192.168.1.3:502
2024-07-28 09:19:12.703 Solax: Modbus Error: [Input/Output] [Errno 104] Connection reset by peer
2024-07-28 09:19:12.703 Solax: Connection has not been established.
2024-07-28 09:19:12.704 Solax: Acquiring GIL for 'onHeartbeatCallback'
2024-07-28 09:19:16.007 Solax: Pushing 'onHeartbeatCallback' on to queue
2024-07-28 09:19:16.057 Solax: Processing 'onHeartbeatCallback' message
2024-07-28 09:19:16.058 Solax: Acquiring GIL for 'onHeartbeatCallback'
2024-07-28 09:19:16.058 Solax: Calling message handler 'onHeartbeat' on 'module' type object.
2024-07-28 09:19:16.058 Solax: onHeartbeat
2024-07-28 09:19:16.058 Solax: Connecting to: 192.168.1.3:502
2024-07-28 09:19:16.104 Solax: Modbus Error: [Input/Output] [Errno 104] Connection reset by peer
2024-07-28 09:19:16.104 Solax: Connecting to: 192.168.1.3:502
2024-07-28 09:19:16.212 Solax: Modbus Error: [Input/Output] [Errno 104] Connection reset by peer

Seems to be a common/general issue related to pymodbus. Any advice? https://github.com/home-assistant/core/issues/52734 https://github.com/pymodbus-dev/pymodbus/issues/420 https://github.com/thingsboard/thingsboard-gateway/issues/412

averter commented 1 month ago

After reading a bit here and there it seems that the issue occurs when the server (inverter?) is overloaded with requests. It happens frequently enough, perhaps 4-5 times per day, during a sufficiently long time (approximately 30 minutes) to be annoying or even dangerous. It can be seen in the figure below (the occasional straight line segments). I'm saying that this can be dangerous because I intend to use a smart EV charger, which relies on the data from the inverter, read at every 6 seconds, to adjust the loading (it could increase it without control if the values become frozen in time).

image

averter commented 1 month ago

@saidlm I believe that this issue is because I am using the pocket wifi dongle from solax which tends to be quite unreliable with modbus. Would this plugin work with waveshare products? Also, my serial baudrate is currently set at 115200, should it be instead 19200?

averter commented 1 month ago

For anyone having connectivity issues with the wifi dongle, I suggest to use a waveshare RS485 to RJ45 Ethernet Module. I've followed these instructions for the assembly, although I have used the device webinterface rather than the vircom software. My configuration is shown below. Hope this helps.

image