mkaiser / Sungrow-SHx-Inverter-Modbus-Home-Assistant

Sungrow SH Integration for Home Assistant for SH3K6, SH4K6, SH5K-20, SH5K-V13, SH3K6-30, SH4K6-30, SH5K-30, SH3.RS, SH3.6RS, SH4.0RS, SH5.0RS, SH6.0RS, SH5.0RT, SH6.0RT, SH8.0RT, SH10RT, SH5.0RT-20, SH6.0RT-20, SH8.0RT-20, SH10RT-20, SH5.0RT-V112, SH6.0RT-V112, SH8.0RT-V112, SH10RT-V112, SH5.0RT-V122, SH6.0RT-V122, SH8.0RT-V122, SH10RT-V122, SH4.6R
310 stars 80 forks source link

Index out of range issue #119

Closed lampi84 closed 9 months ago

lampi84 commented 1 year ago

Since some weeks i'm getting the following error. It was working fine before and i didn't change anything. Does anyone have an idea what is causing this issue?

Here are some logs: 2023-07-01 22:10:25.669 ERROR (SyncWorker_2) [pymodbus.factory] index out of range 2023-07-01 22:10:25.671 ERROR (SyncWorker_2) [pymodbus.transaction] Modbus Error: [Input/Output] Unable to decode request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pymodbus/transaction.py", line 208, in execute self.client.framer.processIncomingPacket(response, File "/usr/local/lib/python3.10/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket self._process(callback) File "/usr/local/lib/python3.10/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process raise ModbusIOException("Unable to decode request") pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request 2023-07-01 22:10:25.671 ERROR (SyncWorker_2) [homeassistant.components.modbus.modbus] Pymodbus: SungrowSHx: Modbus Error: [Input/Output] Unable to decode request 2023-07-01 22:10:25.681 ERROR (SyncWorker_0) [pymodbus.factory] index out of range 2023-07-01 22:10:25.681 ERROR (SyncWorker_0) [pymodbus.transaction] Modbus Error: [Input/Output] Unable to decode request

mkaiser commented 1 year ago

Hi,

can you give us more information? e.G., which inverter you are using and which versions (inverter, Home assistant, etc.)

are you using a modbus proxy or directly accessing via TCP ?

lampi84 commented 1 year ago

Hi,

I`m using a Sungrow sh6.0rt Inverter. I'm connecting via TCP using your ModBus Home Assistant Integration. It was working fine, but all of a sudden it stopped working.

mkaiser commented 1 year ago

hmm no clue at the moment - standard support question: did you make a clean restart with some minutes power down of the inverter?

lampi84 commented 11 months ago

I restarted everything, but i'm still getting the following error:

2023-08-04 22:11:08.081 ERROR (SyncWorker_0) [pymodbus.factory] index out of range 2023-08-04 22:11:08.083 ERROR (SyncWorker_0) [pymodbus.transaction] Modbus Error: [Input/Output] Unable to decode request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pymodbus/transaction.py", line 208, in execute self.client.framer.processIncomingPacket(response, File "/usr/local/lib/python3.10/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket self._process(callback) File "/usr/local/lib/python3.10/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process raise ModbusIOException("Unable to decode request") pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request 2023-08-04 22:11:08.083 ERROR (SyncWorker_0) [homeassistant.components.modbus.modbus] Pymodbus: SungrowSHx: Modbus Error: [Input/Output] Unable to decode request 2023-08-04 22:11:08.092 ERROR (SyncWorker_4) [pymodbus.factory] index out of range 2023-08-04 22:11:08.092 ERROR (SyncWorker_4) [pymodbus.transaction] Modbus Error: [Input/Output] Unable to decode request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pymodbus/transaction.py", line 208, in execute self.client.framer.processIncomingPacket(response, File "/usr/local/lib/python3.10/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket self._process(callback) File "/usr/local/lib/python3.10/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process raise ModbusIOException("Unable to decode request")

Is there any possibility to adjust the code so that i can see why it is failing. Somehow a way to get more advanced logging.

mkaiser commented 11 months ago

here is something about logging. Can you try it? https://community.home-assistant.io/t/modbus-detailed-error-information/584790

My other approach would be to comment a bunch of sensors and do try/error

LapplandsCohan commented 9 months ago

The error looks very similar to what I got when I upgraded Home Assistant Core from 2023.9.2 to 2023.10.2. Didn't have time for troubleshooting so I restored the 2023.9.2 backup and everything worked again. I will try to upgrade next time I can take the time for troubleshooting in case I get the same problem again.

Edit: After writing this I continued to the main page of the project and noticed that 2023.10 breaks things and needs the latest git version…