Okay, I’ll try and be detailed as possible, since it might help me and someone else getting this working.
Most of the posts I’ve seen are pretty scant on details / information or are very vague.
So, I’ve tried a couple of RS485 - USB connectors.
https://www.robotics.org.za/RS485-MINI
and
https://www.robotics.org.za/W17286
At the moment, all I’d like to really do is be a able to get data out of my SunSynk Inverter, and then get some data out of the Pylontech battery. Ideally I’m trying to create my own dashboards / graphs without using the solarman app.
Creating a simple cable from a repurposed Ethernet cable, I connected pin 7 to A (D+) and pin 8 to B (D-)
(this is using this straight colour coding / labelling scheme : How To Make An Ethernet Cable - Simple Instructions) (and according to the SunSynk installation manual which I know has an error on the table for pins 7 and 8, but the diagram is correct)
Then using some basic python and minimal Modbus, (attached here)
https://minimalmodbus.readthedocs.io/en/stable/installation.html
#!/usr/bin/python3
import minimalmodbus
instrument = minimalmodbus.Instrument(’/dev/ttyUSB0’, 1)
instrument.serial.baudrate = 9600 # Baud
instrument.serial.bytesize = 8
instrument.serial.parity = ‘N’
instrument.serial.stopbits = 1
instrument.serial.timeout = 0.2 # seconds
print(instrument)
print(instrument.read_register(0))
The above as far as I understand (according to the SunSynk modbus document) should return the device type.
Instead, all I get is
minimalmodbus.Instrument<id=0x10dd9bb50, address=1, mode=rtu, close_port_after_each_call=False, precalculate_read_size=True, clear_buffers_before_each_transaction=True, handle_local_echo=False, debug=False, serial=Serial<id=0x10dd9bbb0, open=True>(port=’/dev/ttyUSB0’, baudrate=9600, bytesize=8, parity=‘N’, stopbits=1, timeout=0.2, xonxoff=False, rtscts=False, dsrdtr=False)>
…
minimalmodbus.NoResponseError: No communication with the instrument (no answer)
So, anyone got any ideas where I’m going wrong or can someone confirm if this works?
Perhaps my cable is damaged? Or am I just going about this the wrong way.
Again, I’ve tried to swap wires, tried two different USB-485 adapters.
Same result.
Please, I’m not looking for anything complex at the moment, just want to see if the hardware is working (and this in theory should work or not?)
If this does / should work, then I’ll get more complicated with Home Assistant.