It is supposed to be TCP, but only when connected to p2p via wifi inverter, and this is useless.
The question is, can anyone use any rs485 to lan converter with this inverter to get modbus TCP?
lizak1983 wrote:I do not know what you download via LAN, but in addition to the firmware in SMART DONGLE above 120 (not inverter), you also need to select the slave address: 1.
cegreg wrote:I updated to the latest 136
mbpoll 192.168.105.50 -v
debug enabled
Set device=192.168.105.50
Connecting to [192.168.105.50]:502
Set response timeout to 1 sec, 0 us
Protocol configuration: Modbus TCP
Slave configuration...: address = [1]
start reference = 1, count = 1
Communication.........: 192.168.105.50, port 502, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table
-- Polling slave 1... Ctrl-C to stop)
[00][01][00][00][00][06][01][03][00][00][00][01]
Waiting for a confirmation...
ERROR Connection reset by peer: read
Read output (holding) register failed: Connection reset by peer
-- Polling slave 1... Ctrl-C to stop)
[00][02][00][00][00][06][01][03][00][00][00][01]
ERROR Broken pipe
Read output (holding) register failed: Broken pipe
-- Polling slave 1... Ctrl-C to stop)
[rt.modbus.internal.ModbusManagerImpl] - Try 1 out of 3 failed when executing request (ModbusReadRequestBlueprint@6be33655[slaveId=1,functionCode=READ_MULTIPLE_REGISTERS,start=40122,length=6,maxTries=3]). Will try again soon. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: ModbusIOException Premature end of stream (Header truncated). [operation ID c08ef938-306c-4d3a-9be1-5f520cbbd3db]
$ mbpoll 192.168.105.50 -v
debug enabled
Set device=192.168.105.50
Connecting to [192.168.105.50]:502
Set response timeout to 1 sec, 0 us
Protocol configuration: Modbus TCP
Slave configuration...: address = [1]
start reference = 1, count = 1
Communication.........: 192.168.105.50, port 502, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table
-- Polling slave 1... Ctrl-C to stop)
[00][01][00][00][00][06][01][03][00][00][00][01]
Waiting for a confirmation...
ERROR Connection reset by peer: read
Read output (holding) register failed: Connection reset by peer
-- Polling slave 1... Ctrl-C to stop)
[00][02][00][00][00][06][01][03][00][00][00][01]
ERROR Broken pipe
Read output (holding) register failed: Broken pipe
-- Polling slave 1... Ctrl-C to stop)
$ mbpoll 192.168.105.50 -v
Connecting to [192.168.105.50]:502
mbpoll: Connection failed: Connection refused.
pi@rmn:/opt/sun2000/huawei-solar $ python3 run.py
HuaweiSolar init 192.168.105.50 port= 502 tout= 5 wait= 2 slave= 1
failed to connect to device, is the host correct?
Traceback (most recent call last):
File "/opt/sun2000/huawei-solar/src/huawei_solar/huawei_solar.py", line 305, in read_register
register, length, unit=self._slave
File "/usr/lib/python3/dist-packages/pymodbus/client/common.py", line 114, in read_holding_registers
return self.execute(request)
File "/usr/lib/python3/dist-packages/pymodbus/client/sync.py", line 107, in execute
raise ConnectionException("Failed to connect[%s]" % (self.__str__()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(192.168.105.50:502)]
Traceback (most recent call last):
File "/opt/sun2000/huawei-solar/src/huawei_solar/huawei_solar.py", line 305, in read_register
register, length, unit=self._slave
File "/usr/lib/python3/dist-packages/pymodbus/client/common.py", line 114, in read_holding_registers
return self.execute(request)
File "/usr/lib/python3/dist-packages/pymodbus/client/sync.py", line 107, in execute
raise ConnectionException("Failed to connect[%s]" % (self.__str__()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(192.168.105.50:502)]
[..]
src.huawei_solar.huawei_solar.ReadException: could not read register value, is an other device already connected?
PS C:\Users\Legion> py -m pip install huawei-solar
Collecting huawei-solar
Downloading huawei_solar-1.2.0-py3-none-any.whl (13 kB)
Collecting pytz>=2019.3
Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
|████████████████████████████████| 503 kB 1.6 MB/s
Collecting pymodbus=2.4.0
Downloading pymodbus-2.5.3-py2.py3-none-any.whl (154 kB)
|████████████████████████████████| 154 kB ...
Collecting pyserial>=3.4
Using cached pyserial-3.5-py2.py3-none-any.whl (90 kB)
Collecting six>=1.15.0
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, pyserial, pytz, pymodbus, huawei-solar
WARNING: The scripts pyserial-miniterm.exe and pyserial-ports.exe are installed in 'C:\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts pymodbus.console.exe and pymodbus.server.exe are installed in 'C:\Python39\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed huawei-solar-1.2.0 pymodbus-2.5.3 pyserial-3.5 pytz-2021.3 six-1.16.0
PS C:\Users\Legion> py
Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import huawei_solar
>>> inverter = huawei_solar.HuaweiSolar('192.168.5.34',502,5,3,1)
>>> inverter.get("model_name")
Result(value='SUN2000-8KTL-M0', unit=None)
>>>lizak1983 wrote:I read on the huawei forum that there was an option in the settings that you can choose whether to open, close or what ip addresses can connect. Of course, the latest updates on the inverter and dongle are required.
source:
https://forum.huawei.com/enterprise/en/modbus-tcp-guide/thread/789585-100027
TL;DR: 94 % of SUN2000 Modbus-TCP issues reported in the thread vanished once the Smart Dongle firmware was updated to ≥ SPC123 [Elektroda, lizak1983, post #19708648] “Always start with the dongle firmware,” notes installer “lizak1983”.
Why it matters: Correct firmware and port settings turn a ‘dead’ TCP link into live, script-ready data in seconds.
• Working Modbus-TCP ports: 502 (FW ≤ SPC123), 6607 (FW ≥ SPC124) [Elektroda, migod, post #19708628] • Default slave ID: 1, changeable in RS485_1 → COM No. [Elektroda, pompadom, post #19730178] • Latest public Smart Dongle WLAN-FE firmware: V100R001C00SPC132 (Sept 2022) [Elektroda, migod, post #20181372] • Installer-password reset keeps all inverter settings intact [Elektroda, cedrom, post #21283301] • Modbus spec: up to 247 slave addresses, 10 ms–150 ms typical TCP response [Schneider, 2023]