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?


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.

| improve this answer | |

You can use the software redirector Serial/IP from Tactical Software to accomplish this.

Serial/IP will create a virtual COM port that can be linked to the TCP/IP address of the endpoint.

After installing Serial/IP, pick a virtual COM port number, then enter the IP address of the Raspberry PI, the TCP port (23 in this case), and select Telnet as the Protocol.

Now when an application on the Windows PC opens the virtual COM port it will be connected to the USB simulator.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.