Some useful socat commands. How can I make the serial to usb send data every second instead of 1 second. Thanks for the answer! Reply Delete. Serial Port Redirector is a software that provides access to remote serial devices over TCP/IP network. The program creates virtual COM ports and redirects all data and signals written to the port to the remote host with specified IP-address and TCP-port. Issue 2: adapted serial communication (RS-232 to USB) I saw two (different vendors) of these, cables with RS-232 and USB connectors and a hardware adapter, usually on the serial connector side. They came with no manual, nor any statment of their behavior but the 'serial-to-usb' phrase.
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.
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?
slmI 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.
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.
I would like to know if exists some utility that connects to serial port and redirect input and output to a tcp port.I need this for a Java application, I need to write and read to a serial port but seems very hard... java will better work with socket connection.
MIND: I found a lot of 'virtual com to tcp' but I have a real com! And I want to connect to its.
Thanks.
TobiaTobiaThis question appears to be off-topic. The users who voted to close gave this specific reason:
It's pretty easy. Under Linux there are serial devices, redirection and netcat for that. On the server you can run a netcat process listening on a given tcp port with stdin and stdout redirected to/from the serial device like that:
Where 9801 in this example is the tcp port to listen on. You can setup the serial port with setserial(8)
.
These device files also exist on cygwin (Windows).
artistoexI think socat has the functionality you are looking for as well.
The thing is that you can redirect your serial port with the software, like this , for example https://www.eltima.com/serial-port-redirector/
But, still it will redirect the data from the serial port to another machine without serial connection, thus creating a virtual serial com.