You can use a combination of
socat. For example, I have a robot connected to a raspberry pi through a serial port. The raspberry pi is connected to my local network (equivalent to your 2nd PC). And my laptop is connected to the same local network (equivalent to your 1st PC). Then I use ser2net to forward the serial port via TCP from the 2nd PC, and create a proxy serial device file using
socat on the 1st PC.
This setup may work for you as well. Proposed solution:
Step 1: Install ser2net package on your 2nd PC (following your diagram)
sudo apt-get install ser2net
ser2net listens to a TCP port and is able to pipe data to and from a serial port via the TCP port. You can set up which serial ports you want to create "proxies" for via its configuration file
Step 2: configure ser2net in the 2nd PC
For example, if you have a device connected at
/dev/ttyACM0 with baudrate
115200 and want to serve it from localhost port 3333, then you can add the following line to
Having created the configuration file, then either start ser2net by running on the second PC:
or (if it's already running, then just restart it as below)
One important thing here is the remctl option. It allows the client side (1st PC in your diagram) to connect to the device and choose the serial connection options freely. I think this way the serial communication is completely transparent from the data collection workspace perspective. See more details here.
Step 3: Set up proxy serial device file on the data collection workstation (1st PC)
(if you don't have socat, then
sudo apt-get install socat)
Finally, in a terminal on the 1st PC let
socat create a proxy serial port that will listen from the tcp port:
socat pty,link=$HOME/MyProxySerialPort,waitslave tcp:$ip:$port,forever,reuseaddr,keepalive
Where, in this example
port=3333 (or whatever you chose when setting up
/etc/ser2net.conf on the 2nd PC).
Step 4: Connect to MyProxySerialPort
Now you should be able to open a serial connection normally to the device located at
$HOME/MyProxySerialPort on the 1st PC.
This blog post has some more information about this setup too: http://techtinkering.com/2013/04/02/connecting-to-a-remote-serial-port-over-tcpip/