Setting registers in Epever controller with python

bobselfbobself Registered Users Posts: 1
I have a Epever 40 amp charge controller and using python + minimalmodbus to communicate to it on the rs485 bus. I can read
all of the 100+ registers OK. I can set the 'battery type' to 'user'. I'm trying a test to set the boost reconnect voltage.
This is what I'm doing but, I'm getting an exception:

decimals = 0
val = instrument.read_register(0x900, decimals) # 0x9000 is the battery type register
assert val == 0 # 0 means that battery type is 'user'

# try to set the boost reconnect voltage
decimals = 2
val = instrument.read_register(0x9009, decimals) # returns 13.2 volts
instrument.debug = True
instrument.write_register(0x9009, 13.3, decimals) # set to 13.3 volts

debug output:
MinimalModbus debug mode. Will write to instrument (expecting 8 bytes back): '\x01\x10\x90\t\x00\x01\x02\x052´E' (01 10 90 09 00 01 02 05 32 B4 45)
MinimalModbus debug mode. Clearing serial buffers for port /dev/ttyUSB0
MinimalModbus debug mode. Sleeping 0.80 ms before sending. Minimum silent period: 1.75 ms, time since read: 0.95 ms.
MinimalModbus debug mode. Response from instrument: '\x01\x90\x04MÃ' (01 90 04 4D C3) (5 bytes), roundtrip time: 500.7 ms. Timeout for reading: 500.0 ms.

SlaveReportedException('Slave reported device failure')

Does anyone know what might be wrong?


Sign In or Register to comment.