Modbus/RTU python monitor: check serial frame between devices.
Format modbus RTU serial frames receive from a serial port to console stdout.
Test with python3.
RS-485
RS-422 bus -> FTDI cable -> /dev/ttyUSBx -> this_script -> CSV out
RS-232
DATE=2015-11-05T17:31:27.977;ERR=NO;FRAME=01-03-50-00-00-04-55-09;SLAVE=1;
E.g. in Debian based dists, install package:
$ sudo apt-get install python3-setuptools
$ sudo python3 setup.py install
Help
$ modbus-scan-serial -h
See frame only for slave 1
$ modbus-scan-serial -d /dev/ttyUSB2 | grep SLAVE=1
Store all traffic on modbus.log file
$ modbus-scan-serial > modbus.log
$ docker build -t modbus-serial-monitor .
$ docker run -it --device=/dev/ttyUSB2:/dev/ttyUSB2:rwm -e "DEVICE=/dev/ttyUSB2" -e "BAUDRATE=460800" modbus-serial-monitor