Modbus connect to Inverter (goodwe GW10K-ET) fails on same port as a Python Script does work

A connection by 'inverter_test.py/inverter_scan.py' by goodwe-library of python3 does work and as far as I have seen, this library is using port 8899 for UDP. There is no user/password authentication or similar as far as I can see.
Nodered v3.1.0

The inverter is configured as following:

And the modbus-read does access the server (inverter) with FC 1 .

What am I doing wrong or may I check?
Kind regards

According to this article from your Inverter's website
the port used for Modbus TCP is 502 not 8899

Related articles for supported hardware

https://community.goodwe.com/solution/Modbus%20TCPIP%20Configuration

Also you need to find the documentation for your Inverter model, with a list of Modbus register addresses.

As unborn says - it very much depends on your WIFI dongle (assuming that is how you are connecting rather than RS485 Modbus) - as such some dongles do support 8899 - (it is dependant on region) - whereas some of them support Port 502 TCP. Some do not support any of that and you have to hard wire into the RS485/COM port on the unit.

I have 3 of the SBP 5000 and they do not support any sort of Modbus over WIFI.

You may want to have a look at the GoodWe Integration in Home Assistant - they have some excellent code in the Python modules to actually query the different models and inverters and report back what they support

Craig

Thanks so far. I was also struggeling through the different documents in the the Internet regarding Port 502/8899 and I did try port 502 before with the same result. I do have sucessful connect by following code out of https://pypi.org/project/goodwe/

Region is czech republic for your information.

import asyncio
import goodwe


async def get_runtime_data():
    ip_address = '192.168.2.80'

    inverter = await goodwe.connect(ip_address)
    runtime_data = await inverter.read_runtime_data()

    for sensor in inverter.sensors():
        if sensor.id_ in runtime_data:
            print(f"{sensor.id_}: \t\t {sensor.name} = {runtime_data[sensor.id_]} {sensor.unit}")


asyncio.run(get_runtime_data())

Within the 'const.py'-File of this package, there is PORT 8899 in usage.

image

Any additional ideas what to check? Kindly, Edward

your python code does not specify a port number so at a guess it is using port 502 by default.

If you are using linux, you may need to use CAP_NET_BIND_SERVICE to grant low-numbered port access to the node process

something like sudo setcap 'cap_net_bind_service=+ep' /usr/bin/node where /usr/bin/node is the result of which node

Thanks for your ideas.

I tried setcap at my Rasbpi 4 instance on /usr/bin/node and doublechecked by getcap with no positive result for tcp port 502

I did add a looging statement and did debug the script which I did post yesterday. The logging statement says, that the goodwe library is connecting via port 8899

grafik

DEBUG:goodwe:Probing inverter at 192.168.2.80.
DEBUG:goodwe.protocol:Connectionport: 192.168.2.80, 8899.
DEBUG:goodwe.protocol:Sending: aa55c07f0102000241
DEBUG:goodwe.protocol:Received: aa557fc001824c303b303b4b475731304b2d4554202000000000000000000000000000000000393031304b4554553231385731313836000000000000000000000000000000000130323034312d32372d53304b0ccc
DEBUG:goodwe:Detected ET/EH/BT/BH/GEH inverter GW10K-ET, S/N:9010KETU218W1186.
DEBUG:goodwe.inverter:Creating lock instance for current event loop.
DEBUG:goodwe.protocol:Connectionport: 192.168.2.80, 8899.
DEBUG:goodwe.protocol:Sending: READ 33 registers from 35000 (f70388b800213ac1)
DEBUG:goodwe.protocol:Received: aa55f703420002271000fe393031304b4554553231385731313836475731304b2d45542020000b000b00b2001b010930343032392d31312d53313130323034312d32372d53303020c1
DEBUG:goodwe.protocol:Connectionport: 192.168.2.80, 8899.

May another idea what will help in nodered to get the connection?

Kindly, Edward

That transmission is an rtu (which is normally serial).
See for your self: Online Modbus RTU Parser & Modbus TCP Parser

At a guess, the device used a built in ethernet-serial convertor

Another clue in your previous post is that port 8889 is using UDP.

Another guess is it might support TCP on port 502.

I don't think the modbus nodes support UDP and I'm not sure they support RTU mode.


My first piece of advice is determine EXACTLY what the device can support (ideally MODBUS TCP) & set up accordingly.

If not & you cannot find settings in the current installed modbus nodes to support RTU over UDP, you could use probably get something going with a combination of alternative modbus RTU nodes, UDP nodes & virtual serial ports.

Nope that is fine what you are getting there - the unit is using a support WIFI/LAN adapter (which is a unit from Solarman) that does Modbus RTU into the inverter

The 8899 port that it is repsonding to is the older communications standard port that they used and is known as the AA55 protocol (because thats the first two bytes of the packets)

Your issue is that your Modbus nodes will not be setup correctly

(Ignore the Starting register in mine as they are a different model)

You are right, the goodwe library is talking via an AA55 protocol as I can see in the code of protocol.py. But I did not find the glue. I changed the configuration and try to read 33 registers beginning from address 35000 as in the debug protocol above of the working python script. This results still in "Error: connect ECONNREFUSED 192.168.2.80:8899".....May I miss where to config the old aa55 protocol!?

Connectionport: 192.168.2.80, 8899.
DEBUG:goodwe.protocol:Sending: READ 33 registers from 35000 (f70388b800213ac1)

Change the register to 3500 (and convert to HEX) rather than 35000 - often they will be written incorrectly

Craig