Summary
I'm using this USB-to-RJ45 cable to connect my Windows 10 developer workstation to the EPEver Tracer 3210an solar charge controller.
I'm using Python 3.8.6 with the minimalmodbus
module to attempt to connect to the device, retrieve data, and control the device parameters.
Expected Result
The charge controller returns the input voltage of the photovoltaic (PV) panels.
Actual Result
MinimalModbus debug mode. Create serial port COM4
MinimalModbus debug mode. Will write to instrument (expecting 7 bytes back): '\x01\x041\x00\x00\x01?6' (01 04 31 00 00 01 3F 36)
MinimalModbus debug mode. Clearing serial buffers for port COM4
MinimalModbus debug mode. No sleep required before write. Time since previous read: 105406.00 ms, minimum silent period: 1.75 ms.
MinimalModbus debug mode. Response from instrument: '' () (0 bytes), roundtrip time: 1015.0 ms. Timeout for reading: 1000.0 ms.
Traceback (most recent call last):
File "tempCodeRunnerFile.python", line 17, in <module>
pv_voltage = ins.read_register(PV_VOLTAGE, 2, 4, False)
File "C:\Users\TrevorSullivan\scoop\apps\python\current\lib\site-packages\minimalmodbus.py", line 441, in read_register
return self._generic_command(
File "C:\Users\TrevorSullivan\scoop\apps\python\current\lib\site-packages\minimalmodbus.py", line 1170, in _generic_command
payload_from_slave = self._perform_command(functioncode, payload_to_slave)
File "C:\Users\TrevorSullivan\scoop\apps\python\current\lib\site-packages\minimalmodbus.py", line 1240, in _perform_command
response = self._communicate(request, number_of_bytes_to_read)
File "C:\Users\TrevorSullivan\scoop\apps\python\current\lib\site-packages\minimalmodbus.py", line 1406, in _communicate
raise NoResponseError("No communication with the instrument (no answer)")
minimalmodbus.NoResponseError: No communication with the instrument (no answer)
Code
import minimalmodbus
import serial
ins = minimalmodbus.Instrument('COM4', 1, debug=True)
ins.serial.baudrate = 115200
ins.serial.bytesize = 8
ins.serial.stopbits = 1
ins.serial.parity = serial.PARITY_NONE
ins.serial.timeout = 1
ins.mode = minimalmodbus.MODE_RTU
ins.clear_buffers_before_each_transaction = True
PV_VOLTAGE = 0x3100
pv_voltage = ins.read_register(PV_VOLTAGE, 2, 4, False)
print(pv_voltage)
What I've Tried
- Use
pymodbus
module instead - Tried the
easymodbus
module - Changed the baud rate to
9600
- Tried using
ASCII
mode instead ofRTU
(99% confident it needsRTU
mode though) - Changed the COM port on the serial device from
COM3
toCOM4
- Rebooted computer
- Connected the MT-50 display to the charge controller (works perfectly)
- Changed
parity
setting to other values (even, odd, space, etc.)
Question
- How can I successfully connect my developer workstation to the charge controller?
- Is it possible that this cable is just dead?
- What else can I do to test the cable to ensure it's functional?
- What else can I do to test the charge controller, to ensure it's responding?