Netcat Serial

Sometimes there is a need to echo a serial port over the network for debugging here is a couple ncat tricks

On the Server

stty -F /dev/ttyUSB0 115200

cat /dev/ttyUSB0 | ncat --broker -l 127.0.0.1 1234 -k

You can change port 1234 to whatever makes sense.

On the Client

nc 127.0.0.1 1234

(client note: change 127.0.0.1 to the server IP)