상세 컨텐츠

본문 제목

Socat Redirect Serial To Usb

카테고리 없음

by moeruelumtispaucir 2020. 11. 5. 08:30

본문



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.

Active5 years, 1 month ago

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?

slm
5,25112 gold badges44 silver badges61 bronze badges
SerialSocat Redirect Serial To Usb
wxfieldwxfield

2 Answers

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.

polar32700polar32700

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.

ToddTodd

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

Active2 years, 4 months ago

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.

Serial

Thanks.

TobiaTobia
1,1287 gold badges21 silver badges49 bronze badges

closed as off-topic by DavidPostillApr 27 '17 at 8:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • 'Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question.' – DavidPostill
If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

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).

artistoex

9 Pin Serial To Usb Adapter

artistoex
3,1281 gold badge19 silver badges35 bronze badges

I think socat has the functionality you are looking for as well.

IanIan

The thing is that you can redirect your serial port with the software, like this , for example https://www.eltima.com/serial-port-redirector/

Serial To Usb

But, still it will redirect the data from the serial port to another machine without serial connection, thus creating a virtual serial com.

Rocky BeltsRocky Belts

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