SunSynk / Pylontech RS485

No, unfortunately not. I gave up a couple months ago in disgust and will just have to live with the painful solar man app.
If anyone can shed some light on this it would be great, but I’m convinced there is more than just a software issue here.
My Sunsynk did get a few firmware updates a couple weeks ago, so I might try revisit this.
(it was having an issue with the touchscreen not responding correctly / delayed and those firmware updates fixed it.)

ok cool, thanks for getting back to me. someone also mentioned that they had a firmware update on their Sunsynk inverter and the modbus ID changed to 00 they said that they changed it to 01 and that resolved some of their issues. It’s under advanced settings. I have a Deye 8KW inverter and my ID also changed to 00 after they did a firmware update last week. I did change it in my settings however i get the same issue. it just keeps flipping between “active” “initialise” “init” “Opened” “connected” “queing” “sending” and “reconnecting”. I’m running Node-Red in homeassistant and I’ve tried so many different settings and no luck. The only thing i haven’t managed to do is change the permissions on the /dev/ttyUSB0 i’m not sure if that’s the issue because if i type it out in terminal i get access denied.

Have you tried the guide and the node red flow that I posted in this thread.

The first step is to try and debug within nodered itself. Add a debug node and check what data is being sent and received.

Which 485 adapter are you using. I found that the cheap ones (R30) don’t work. I posted links to the one I’m using.

thanks, I’ve followed most of the info on the powerforum guide. I’ll take a look at yours. I’m using this USB adepter. https://www.robotics.org.za/RS485-3P?search=rs485 it’s the R107 one from Robotics. I got 2 of them delivered yesterday.

Okay. I’m using that same adapter. Well, I have one hat, and the 1 usb.

Let me know if you still get stuck.

thanks a mil for the assistance

Does that mean you got it working

no I mean thanks for the response and the instructions.

Also been struggling with this.
Modbus RTU addresses are 1-255, with 0 being reserved for broadcast messages.
However, the 0 address is rarely used since there is no confirmation that the message was properly received at the slave node.
Try using the broadcast slave address
Change unit=1 to unit=0

r = modbus.read_holding_registers(register, count, unit=1)

I’m not a python expert… there may have been a change on pymodbus to the return type.
For pymodbus 2.5.3, the return type when there is a error is:
<class 'pymodbus.exceptions.ModbusIOException'>
When there is no error the return type is:
<class 'pymodbus.register_read_message.ReadHoldingRegistersResponse'>
here is a corrected version for use with 2.5.3:

import sys
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
from pymodbus.register_read_message import ReadHoldingRegistersResponse

def main():
    if len(sys.argv) < 5:
        print ("Usage: {} port read|write register count")
        return

    modbus = ModbusClient(method='rtu', port=sys.argv[1], baudrate=9600, timeout=1)

    if not modbus.connect():
        logger.error("Cannot connect to modbus")
        return

    action = sys.argv[2]
    if action not in ("read", "write"):
        print ("Read or Write?")
        return
    register = sys.argv[3]
    if register.startswith('0x'):
        register = int(register, 16)
    else:
        register = int(register)

    count = int(sys.argv[4])
    if action == "read":
        r = modbus.read_holding_registers(register, count, unit=0) # NOTE: Change Unit to match your Inverter
        print (type(r))
        if not isinstance(r, ReadHoldingRegistersResponse):
            print (r)
        else:
            print (r.registers)
            total = 0
            for _ in reversed(r.registers):
                total <<= 16
                total |= _
            print ("{} (0x{:X})".format(total, total))
    elif action == "write":
        v = int(sys.argv[5])
        payload = []
        while v > 0:
             payload.append(v & 0xFFFF)
             v >>=16
        while len(payload) < count:
            payload.append(0)
        print ("Writing {} to register {:X}".format(payload, register))
        if len(payload) > 1:
            r = modbus.write_registers(register, payload, unit=1)
        else:
            r = modbus.write_register(register, payload[0], unit=1)
        print (r)

main()

I did try addresses 0-255, seems SunSynk only responds to the broadcast address 0.
EDIT:
You can change SunSynk modbus ID from 0 (broadcast) in Advanced->Multi-Inverter
image

Hi there must be some HW error with the device connecting to the inverter. I’ve tried everything as mentioned in the post above mentioned by @Vassen and no luck. My MQTT connects but the Inverter just keeps switching between connected, queueing, timeout, reconnecting, initialise, init, opened. Like i said i tried 2 different USB adapters and also 2 different RPI’s and the same thing happens.

the debug just shows this the whole time.
24/03/2022, 10:11:20node: Invertermsg : error

“Error: Client Not Ready To Read At State reconnecting”

24/03/2022, 10:11:20node: Invertermsg : error

“Error: Client Not Ready To Read At State reconnecting”

24/03/2022, 10:11:21node: Invertermsg : error

“Error: Client Not Ready To Read At State reconnecting”

24/03/2022, 10:11:21node: Invertermsg : error

“Error: Client Not Ready To Read At State init”

24/03/2022, 10:11:21node: Invertermsg : error

“Error: Client Not Ready To Read At State init”

24/03/2022, 10:11:21node: Inverter

I also added a debug node to the inverter and it says the following below

24/03/2022, 10:50:13node: Invertermsg : error
“Error: Client Not Ready To Read At State reconnecting”
24/03/2022, 10:50:13node: afaf55917b573172Solar_PV1_Power : msg.payload : Object
{ fc: 3, unitid: 1, address: 186, quantity: 1 }
24/03/2022, 10:50:13node: Invertermsg : error
“Error: Client Not Ready To Read At State reconnecting”
24/03/2022, 10:50:13node: afaf55917b573172Solar_PV2_Power : msg.payload : Object
{ fc: 3, unitid: 1, address: 187, quantity: 1 }
24/03/2022, 10:50:14node: Invertermsg : error
“Error: Client Not Ready To Read At State reconnecting”
24/03/2022, 10:50:14node: afaf55917b573172battery_output_current : msg.payload : Object
{ fc: 3, unitid: 1, address: 191, quantity: 1 }
24/03/2022, 10:50:14node: Invertermsg : error
“Error: Client Not Ready To Read At State reconnecting”
24/03/2022, 10:50:14node: afaf55917b573172Solar_PV1_Amps : msg.payload : Object
{ fc: 3, unitid: 1, address: 110, quantity: 1 }
24/03/2022, 10:50:15node: Invertermsg : error
“Error: Client Not Ready To Read At State init”
24/03/2022, 10:50:15node: afaf55917b573172Solar_PV2_Amps : msg.payload : Object
{ fc: 3, unitid: 1, address: 112, quantity: 1 }
24/03/2022, 10:50:15node: Invertermsg : error
“Error: Client Not Ready To Read At State init”
24/03/2022, 10:50:15node: afaf55917b573172Solar_PV_Day : msg.payload : Object
{ fc: 3, unitid: 1, address: 108, quantity: 1 }
24/03/2022, 10:50:16node: Invertermsg : error
“Error: Client Not Ready To Read At State init”
24/03/2022, 10:50:16node: afaf55917b573172battery_soc : msg.payload : Object
{ fc: 3, unitid: 1, address: 184, quantity: 1 }
24/03/2022, 10:50:16node: Invertermsg : error
“Error: Client Not Ready To Read At State init”
24/03/2022, 10:50:16node: afaf55917b573172grid_frequency : msg.payload : Object
{ fc: 3, unitid: 1, address: 79, quantity: 1 }
24/03/2022, 10:50:17node: Invertermsg : error
“Error: Client Not Ready To Read At State opened”
24/03/2022, 10:50:17node: afaf55917b573172voltage_inverter : msg.payload : Object
{ fc: 3, unitid: 1, address: 154, quantity: 1 }
24/03/2022, 10:50:17node: Invertermsg : error
“Error: Client Not Ready To Read At State opened”
24/03/2022, 10:50:17node: afaf55917b573172voltage_grid : msg.payload : Object
{ fc: 3, unitid: 1, address: 150, quantity: 1 }
24/03/2022, 10:50:18node: afaf55917b573172battery_volt : msg.payload : Object
{ fc: 3, unitid: 1, address: 183, quantity: 1 }
24/03/2022, 10:50:18node: afaf55917b573172battery_charge_volts : msg.payload : Object
{ fc: 3, unitid: 1, address: 312, quantity: 1 }
24/03/2022, 10:50:18node: Invertermsg : string[60]

question on the network cable - If i take a normal cat 5e cable and cut the one end off and connect it to the USB as per the diagrams mentioned in the forum will it work or do i have to re-crimp the RJ45 side?



This seems like you’re having EXACTLY the same issue I did - just not getting a response at all from the inverter.

seems like we are. I thought i would attach the diagrams of how I’ve wired mine up. Maybe the network cable is not correct on the RJ45 side. Either way I’m stumped and can’t get it to work.

I just used the 2 connectors for the rj45. Didn’t connect the ground. You can use a standard rj45. Don’t see why it wouldn’t work. Just make sure the correct pairs are used.

thanks, I tried with and without the GRND. I also just tried with a single cable still doesn’t work.

Dit you try swapping them?

let me try that

tried that, no luck