Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR:pymodbus.factory:index out of range #4

Open
mistaoh opened this issue Oct 28, 2021 · 8 comments
Open

ERROR:pymodbus.factory:index out of range #4

mistaoh opened this issue Oct 28, 2021 · 8 comments

Comments

@mistaoh
Copy link

mistaoh commented Oct 28, 2021

I get the following issue when I try this addon.

INFO:root:Modbus connected
INFO:root:Configured MQTT Client
INFO:root:Publish Home Assistant Discovery message
DEBUG:pymodbus.transaction:Current transaction state - IDLE
DEBUG:pymodbus.transaction:Running transaction 1
DEBUG:pymodbus.transaction:SEND: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x4 0x13 0x88 0x0 0x64
DEBUG:pymodbus.client.sync:New Transaction state 'SENDING'
DEBUG:pymodbus.transaction:Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
DEBUG:pymodbus.transaction:Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
DEBUG:pymodbus.transaction:RECV: 0x0 0x1 0x0 0x0 0x0 0x2 0x1 0x84 0x2
DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0x1 0x0 0x0 0x0 0x2 0x1 0x84 0x2
DEBUG:pymodbus.factory:Factory Response[132]
ERROR:pymodbus.factory:index out of range
ERROR:pymodbus.transaction:Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pymodbus/transaction.py", line 190, in execute
    self.client.framer.processIncomingPacket(response,
  File "/usr/lib/python3.9/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "/usr/lib/python3.9/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
WARNING:root:Modbus connection failed
WARNING:root:Failed to scrape inverter, sleeping until next scan
DEBUG:pymodbus.transaction:Current transaction state - TRANSACTION_COMPLETE
DEBUG:pymodbus.transaction:Running transaction 2
DEBUG:pymodbus.transaction:Clearing current Frame : - 0x0 0x1 0x0 0x0 0x0 0x2 0x1 0x84 0x2
DEBUG:pymodbus.transaction:SEND: 0x0 0x2 0x0 0x0 0x0 0x6 0x1 0x4 0x13 0x88 0x0 0x64
DEBUG:pymodbus.client.sync:New Transaction state 'SENDING'
DEBUG:pymodbus.transaction:Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
DEBUG:pymodbus.transaction:Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
DEBUG:pymodbus.transaction:RECV: 0x0 0x2 0x0 0x0 0x0 0x2 0x1 0x84 0x2
DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0x2 0x0 0x0 0x0 0x2 0x1 0x84 0x2
DEBUG:pymodbus.factory:Factory Response[132]
ERROR:pymodbus.factory:index out of range
ERROR:pymodbus.transaction:Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pymodbus/transaction.py", line 190, in execute
    self.client.framer.processIncomingPacket(response,
  File "/usr/lib/python3.9/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "/usr/lib/python3.9/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
WARNING:root:Modbus connection failed
WARNING:root:Failed to scrape inverter, sleeping until next scan

Any ideas on what is wrong.

It´s a Sungrow SG10RT connected via a sungrow WiNet-S wifi module.
Please let me know what additional information I should provide.
Addon version is 0.2

@bohdan-s
Copy link

bohdan-s commented Nov 1, 2021

Hi, I have the same issues meltaxa/solariot#53
I am guessing it is an issue with the new WiNet-S dongles? They may be using a new encryption?

@bohdan-s
Copy link

bohdan-s commented Nov 4, 2021

I raised a issue over here: rpvelloso/Sungrow-Modbus#8
It seems to be an issue with the WiNet-S dongle.
Would you be able to check what firmware your dongle is? mine is: M_WiNet-S_V01_V01_A

@mistaoh
Copy link
Author

mistaoh commented Nov 8, 2021

Would you be able to check what firmware your dongle is? mine is: M_WiNet-S_V01_V01_A

My wifi dongle version is M_WiNet-S_V01_V01_A as well.

@MarkGardiner
Copy link

Just to kick things along,

@bohdan-s I notice you have managed to work some magic in https://github.com/bohdan-s/SungrowModbusWebClient .
I assume that is the best fix we can hope for for this specific issue at the moment?

Any change that @bohdan-s 's approach could be a configuration option for this addon where direct modbus access is blocked?

@bohdan-s
Copy link

bohdan-s commented Dec 6, 2021

I will submit a PR this week to enable using the HTTP request module :)

@MarkGardiner
Copy link

Thank you! Very excited to try it out.

@cartman10
Copy link

Did somebody resolve the issue ? I'm having the same problem...
Or are you using the fix from bohdan-s ?

@MarkGardiner
Copy link

MarkGardiner commented Aug 29, 2022

I am essentially using the fix from @bohdan-s above in the SunGather release https://github.com/bohdan-s/SunGather which works perfectly for what I want. I had to set the "connection: http" which as I understand uses his fix above and gets the registers over a websocket connection rather than actually via the Modbus TCP connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants