h4ckst0ck / dbus-solaredge

Victron Venus integration for SolarEdge Inverters
MIT License
7 stars 8 forks source link

FIX: Empty messages from modbus #9

Open cicatrix87 opened 1 year ago

cicatrix87 commented 1 year ago

To get rid of the empty modbus reply messages you can add some parameters to the definition of the modbusClient.

@40000000644bed7f317235f4 2023-04-28 15:59:49,828 - DbusSolarEdge - INFO - Connected to dbus, and switching over to GLib.MainLoop() (= event based) @40000000644bed87321b08b4 2023-04-28 15:59:57,839 - DbusSolarEdge - ERROR - regs.isError: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 8 bytes (0 received) @40000000644bed8732277464 2023-04-28 15:59:57,840 - DbusSolarEdge - ERROR - exception in _update. @40000000644bed8a3ac5305c 2023-04-28 16:00:00,985 - DbusSolarEdge - INFO - Startup, trying connection to Modbus-Server: ModbusTCP 192.168.178.137:502, UNIT 1 @40000000644bed8a3b19f77c 2023-04-28 16:00:00,990 - DbusSolarEdge - INFO - Connected to Modbus Server. @40000000644bed8b003f415c 2023-04-28 16:00:01,002 - root - INFO - registered ourselves on D-Bus as com.victronenergy.grid.grid_id00 @40000000644bed8b0327a3dc 2023-04-28 16:00:01,051 - root - INFO - registered ourselves on D-Bus as com.victronenergy.pvinverter.pv0.pvinverter_id00 @40000000644bed8b07577a7c 2023-04-28 16:00:01,121 - root - INFO - registered ourselves on D-Bus as com.victronenergy.temperature.temp_pvinverter_id00 @40000000644bed8b0a0423ec 2023-04-28 16:00:01,167 - root - INFO - registered ourselves on D-Bus as com.victronenergy.digitalinput.limit_pvinverter_id00 @40000000644bed8b0c77084c 2023-04-28 16:00:01,208 - DbusSolarEdge - INFO - Connected to dbus, and switching over to GLib.MainLoop() (= event based)

Add "retry_on_empty=True" for the modbusClient definition to get rid of the above errors.

modbusClient = ModbusClient(SERVER_HOST, port=SERVER_PORT, retry_on_empty=True)