Closed rgov closed 4 years ago
I'm using umodbus 1.0.3 with Python 2.7 (due to an environment that doesn't support Python 3). I started with the example code but then simplified it to tell me if any message is received:
@app.route() def any_message(*args, **kwargs): print(args, kwargs)
I use the modbus_cli command-line program to read coil 3:
modbus_cli
client -> server: b9 54 00 00 00 06 ff 01 00 03 00 01 .T...... ....
The server replies back without my route function being invoked:
server -> client: b9 54 00 00 00 03 ff 81 02 .T...... .
The 81 byte represents an exception, and 02 is "Illegal data address".
81
02
The issue is that modbus_cli uses a slave ID of 255 (-1) by default, which the route was not configured to accept.
I'm using umodbus 1.0.3 with Python 2.7 (due to an environment that doesn't support Python 3). I started with the example code but then simplified it to tell me if any message is received:
I use the
modbus_cli
command-line program to read coil 3:The server replies back without my route function being invoked:
The
81
byte represents an exception, and02
is "Illegal data address".