I am trying to understand how an application is communicating with a Modbus RTU Master through a virtual COM (serial port over USB).
The device is a Raspberry Pi 3, but unfortunately it is not running Raspian OS, but OpenWRT (v. 22.03). So I have limited commands available, however, socat and minicom are present. Furthermore, I also have the option to run custom Python scripts and through pip install external Python packages. I have root-access and can also install binaries.
Is it possible to sniff/listen in on the data packages between the application (basically a Modbus RTU Master) and the serial port running on /dev/ttyACM0 wired to a Modbus RTU Slave? I want to be able to see the Modbus function code, modbus registers and the values which are written. The Modbus RTU Slave vendor has limited documentation around how to communicate and connect to the slave, hence, we are trying to reverse engineer the communication through an existing application integration.
Is it possible to not disturb the current integration, and through a program (e.g., socat or sniffer) dump/sniff the data package and read it in human readable format to understand the modbus commands and values used? Or is it only possible through setting up a kind of a proxy?
I have tried to install "sniffer" from https://github.com/alerighi/modbus-sniffer, but I have not successfully cross-compile it to run on the Raspberry Pi - aarch64_cortex-a53.
Thanks.