Closed yogawenno closed 1 year ago
Same problem here, by displaying modbus error, I get this message :
Incomplete message received, expected at least 2 bytes
I updated my Debian but changed nothing else electrically speaking...
I think the driver for ttyACM0 cannot put the device to RS485 mode.
I finally fixed the problem by using the xr driver version 1a instead of 1c... strange ! (I use Dumasto install it)
@bistory Looking into your solution using the specific driver version, but what is "Dumasto" I cannot find a single reference to it. Thank you
I finally fixed the problem by using the xr driver version 1a instead of 1c... strange ! (I use Dumasto install it)
Same here 1A which is in the repo works fine, 1C from the vendor website does not work at all.
I finally fixed the problem by using the xr driver version 1a instead of 1c... strange ! (I use Dumasto install it)
Can you please Elaborate more about this. i don't understand " by using the xr driver version 1a instead of 1c "
Traceback (most recent call last):
File "/home/pi/Desktop/test.py", line 17, in
Facing this error from a long time but unable to understand what exactly mean it or how can i resolve this error???/
I finally fixed the problem by using the xr driver version 1a instead of 1c... strange ! (I use Dumasto install it)
Can you please Elaborate more about this. i don't understand " by using the xr driver version 1a instead of 1c " Traceback (most recent call last): File "/home/pi/Desktop/test.py", line 17, in print(result.registers) AttributeError: 'ModbusIOException' object has no attribute 'registers' pi@raspberrypi:~/Desktop $
Facing this error from a long time but unable to understand what exactly mean it or how can i resolve this error???/
I used driver from the manufacturer that didn't work. The one on this repo works great. But your problem is maybe not related to mine ;-)
Ok. Thanks for your response. if you know any solution for this error please let me know.
I guess this was resolved.
hey guys, please help me to solve this problem i have code
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
client = ModbusClient(method = 'rtu', port = '/dev/ttyACM0', baudrate = 115200) client.connect() result = client.read_input_registers(0x3100,1,unit=1) print("result = ") print (result)
solarVoltage = float(result.registers[0] /100.0) solarCurrent = float(result.registers[1] /100.0) batteryVoltage = float(result.registers[4] /100.0) chargeCurrent = float(result.registers[5] /100.0)
print("solar voltage : ",solarVoltage) print("solar current : ",solarCurrent) print("battery volatage : ",batteryVoltage) print("charge current : ",chargeCurrent) client.close()
when i run this code, i get error like this
result = Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received) Traceback (most recent call last): File "yutub.py", line 9, in
solarVoltage = float(result.registers[0] /100.0)
AttributeError: 'ModbusIOException' object has no attribute 'registers'
i use epever tracer1210A can anybody can help me to fix this problem? thanks :)