grid-x / modbus

BSD 3-Clause "New" or "Revised" License
78 stars 26 forks source link

Modbus errors are misleading #46

Closed andig closed 2 years ago

andig commented 2 years ago

Consider this:

[modbus] TRACE 2022/01/07 19:41:45 modbus: send 00 01 00 00 00 06 01 04 13 88 00 01
[modbus] TRACE 2022/01/07 19:41:47 modbus: recv 00 01 00 00 00 06 01 84 04 00 01 00
Power: read failed: modbus: exception '4' (server device failure), function '132'

"Function" 132 is actually 84, which is really 4 plus the error bit. I'd suggest to show the function code minus the error bit in the message here.