-
Notifications
You must be signed in to change notification settings - Fork 13
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
WiNet-S dongle 'unable to decode request' #8
Comments
did you try using unencrypted connection? |
Yes, I have tried both solariot and ModbusTCP2MQTT. Both with the standard and the sungrow-modbus library options. Below log is using "ModbusTcpClient" bohdans@Bohdans-MBP solariot % ./solariot.py -vv |
@tjhowse do you have any idea what this might be? I've read somewhere that sungrow uses a 'custom modbus' with peculiarities. Maybe that's it. Those packets don't seem to be encrypted. |
Thank you, it didn't look encrypted. Maybe they dropped it in the new dongles. |
I think you will need to debug pymodbus with your inverter and code a custom client for it. |
I'd suggest running a wireshark/tshark capture of the traffic to/from the inverter and posting the capture file here. It looks as though the inverter is responding with a malformed, but unencrypted, response. I hope this doesn't mean Sungrow have released a new variant of their interface >.< |
Thanks, i'll run a wireshark dump and post it here shortly. I'll post the Modbus4MQTT log below as well for completeness. 2021-11-04 14:51:17 INFO Starting modbus4mqtt v0.5.0 During handling of the above exception, another exception occurred: Traceback (most recent call last): |
WiNet-S Captured.pcapng.zip |
@tjhowse I can see you have been active in this area (and whirlpool). I downloaded ComTest Pro and had a bit of a play around using the Modbus map Sungrow supplied. What I have found out is I can read the holding registers (4x) without issue: So this seems to be an issue only with the read-only registers (3x type). I will keep playing around and see what I can find. |
Ok, lots of learning about modbus, Sungrow communication protocol PDF says "Address of 3x is read-only register, supporting the CMD code inquiry of 0x04" So long story short, it seems with the WiNet-S dongles you can no longer access the read-only register of modbus. :( |
Last thought, could there be some sort of "auth" packet or key transfer that has to take place first before it will respond to the 3x (0x04) read-only enquiries? |
That is some excellent investigation. I think it would be worthwhile poking at the other tables on the device (holding, coils and input) and see if any of them are readable. In the wireshark log you provided it looks like the dongle responds with a completely malformed message, rather than a modbus-compliant rejection. |
@tjhowse any hints on how to downgrade the firmware?
|
If I log into the dongles web interface, Select Device Monitoring > General Parameters > Read-Back of Address type 3x I can read the values. |
Hm! Interesting! I would love to get my hands on one of these. I would dig
into the page script and see what interface the website is using to query
data from the registers.
I assume you meant "but I am UNable to read those values" instead of "but I
am able to read those values"?
…On Mon, 15 Nov 2021 at 10:01, bohdan-s ***@***.***> wrote:
If I log into the dongles web interface, Select Device Monitoring >
General Parameters > Read-Back of Address type 3x I can read the values.
So the dongle is reading the values, but I am able to read those values
over the Modbus TCP interface presented by the dongle.
:(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHWDUL7H55AILFP2RPO5N3UMBEW3ANCNFSM5HH3SU6Q>
.
|
Let me have a look at the web interface a little more. |
Nothing interesting in the requests,
Edit: interestingly the token is the same from any browser or PC and works without logon to the web interface first. |
Yes, I have the option (its in a slightly different location now). |
Ok, So I have learnt a lot about Modbus that I didn't know a few days ago. First, I tried sending the "Public key" request as per https://whrl.pl/Rf8BQT I have scanned (to the best of my skills) as much of ModBus as I can, and everything returns the error except the holding registers. So it looks like the Modbus protocol has been crippled on the WiNet-S dongle. Now, off the modbus part, I have spent some time pulling apart the app. I have tried some MITM and some reverse engineering of the app, but I have been unable to locate a way to list or download previous firmwares. @tjhowse if you can dig up the URL for firmwares, downgrading is the only real option left at the moment. Otherwise looks like unless Sungrow push a firmware with it enabled again WiNet-S dongle users are out of luck :( |
I got a response back from my solar system installer - I asked for a quote on a WiNet-S dongle so I could experiment on it. Apparently it's incompatible with my SH5k-20 and they don't want to sell me one, :( |
I am going to close this issue, as it seems the WiNet-S dongle has a broken Modbus TCP implementation. |
the list of firmware comes through https://augateway.isolarcloud.com/v1/devService/getDeviceTypeAndModelInfoByPage |
Hi,
I have a SunGrow SG7.0RT with a new WiNet-S dongle. I have been unable to connect using any of the scripts. It looks like they may be using a new encryption key?
EDIT: Full log using "SungrowModbusTcpClient"
bohdans@Bohdans-MBP solariot % ./solariot.py -vv
INFO:root:Loaded config sungrow-sg7rt
INFO:root:Creating SungrowModbusTcpClient
INFO:root:Connecting
DEBUG:pymodbus.client.sync:Connection to Modbus server established. Socket ('192.168.1.148', 55739)
DEBUG:pymodbus.client.sync:Connection to Modbus server established. Socket ('192.168.1.148', 55740)
INFO:root:Connected
INFO:root:No MQTT configuration detected
INFO:root:No InfluxDB configuration detected
INFO:root:No PVOutput configuration detected
DEBUG:pymodbus.client.sync:Connection to Modbus server established. Socket ('192.168.1.148', 55741)
DEBUG:pymodbus.client.sync:Connection to Modbus server established. Socket ('192.168.1.148', 55742)
DEBUG:pymodbus.client.sync:Connection to Modbus server established. Socket ('192.168.1.148', 55743)
DEBUG:pymodbus.client.sync:Connection to Modbus server established. Socket ('192.168.1.148', 55744)
DEBUG:pymodbus.transaction:Current transaction state - IDLE
DEBUG:pymodbus.transaction:Running transaction 1
DEBUG:pymodbus.client.sync:Connection to Modbus server established. Socket ('192.168.1.148', 55745)
DEBUG:pymodbus.client.sync:Connection to Modbus server established. Socket ('192.168.1.148', 55746)
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 "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pymodbus/transaction.py", line 208, in execute
self.client.framer.processIncomingPacket(response,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
self._process(callback)
File "/Library/Frameworks/Python.framework/Versions/3.9/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
The text was updated successfully, but these errors were encountered: