Windows/Linux socat to share a serial device over IP

redirectserialsocattelnetwindows

I have a scenario where I demonstrated to my group @ work how to share a very expensive USB patient simulator plugged into a Raspberry Pi (Debian) using socat. The group wants to be able to have an on-demand, bi-directional connection to the serial device over Ethernet. Presently I have the device broadcasting via Telnet.

socat tcp-l:23,reuseaddr,fork,crlf file:/dev/ttyUSB0,echo=0,b115200,raw,crnl,icanon=1

I need to setup the consumer side whereby a Windows user connects to the Telnet port, but redirects the I/O to an available COM port on their machine. I was thinking Cygwin & socat on the Windows side, but I'm not a very skilled Windows guy.

Any ideas?

Best Answer

I understood your question so that you want a Windows pc to be able share the serial port in the same way you can make a Linux box to share the port using socat.

There are open source applications for example in sourceforge.net that can connect tcp socket with a serial port in Windows. Also, just google "serial to ip" or "ip to serial". One simple example is "SerialToIP" http://sourceforge.net/projects/serialtoip/?source=directory It is developed in C#. It has command line and GUI versions available, but serial port control is minimal but that might be enough for your needs based on the socat-example.

Depending on how detailed serial port control needs you have and if your application needs to run whether a Windows user is logged in or not, you should select the application that fits your needs. GUI applications in Windows by default require the user to be logged in to work.

BTW, your socat-command has nothing to do with the Telnet-protocol. You are just creating a pure and simple TCP/IP "pipe" that connects to a serial port. Any possible top-layer protocols carried inside that "pipe" are irrelevant to the question and answers.