I have a problem with monitoring data transferred between 3D printer and software over TCP.
I have 3D printer that is connected to Raspberry pi with usb cable. I'm using ser2net in rasbperry to forward the serial port data from printer through tcp to my laptop where I'm running the printer software and which is in the same network as Rasperry. In my laptop I use socat to mount virtual serial port (ttyACM1) which listens the data from forwarded serial port in rasberry. So far this works pretty well and I'm able to use software in my laptop to use printer remotely.
But now I have problem when I'm trying to monitor the data that I'm sending from the software to the printer. I have tried to use different softwares to sniff serial port data, but every time I run these softwares it disconnects the connection between printer software and virtual serial port.
So how can I at the same time use software and sniff the data that I'm sending from the software to printer without canceling the connection between virtual port and the software.
Here are the command and softwares I'm using in this setup:
In rasperry printer is connected to ttyACM0
In my laptop:
$sudo socat pty,raw,echo=0,link=/dev/ttyACM1 tcp:10.1.1.107:3333
(in /dev/ there is now ttyACM1->/dev/pts/30 appeared)
And when I try for example interceptty:
$sudo interceptty /dev/ttyACM1
to sniff data when the printer software is running it says that printer is disconnected. I can still read the data from the ttyACM1 using interceptty. And when I close interceptty it will find the printer again.
Is there a way to sniff the data while using printer?