Raspberry Pi Serial Port Connection

by

I want to use my Raspberry Pi as a serial-to-TCP converter. The Raspberry Pi should be a TCP-server that accept one TCP client (because more connections would end in a complete mess on the serial port!). I want to connect to the Raspberry Pi from a computer that reads out data from a device that is connected to the Raspberry Pi with a serial converter. The serial converter already works, and I've also set up a WLAN access point. Are there built-in tools in that help me doing this? I don't want that the Raspberry Pi connects to another computer and redirects the serial port to a port on the computer. I want the Raspberry Pi to act as a server where clients can connect to the port and talk to the device that is connected to the serial port.

For basic network communication nc or netcat, as suggested by, is sufficient. However, if you for example want to forward a serial console or encrypt the connection socat is probably more convenient. For inspiration here are two working examples of the mentioned applications. Serial console via TCP To connect directly to the serial port with socat the following command can be used: socat -,raw,echo=0,escape=0x1d /dev/ttyUSB0,b115200,echo=0,raw The escape char is set to Ctrl-. This can be expanded into a tcp-server like this: socat tcp-listen:54321,reuseaddr /dev/ttyUSB0,b115200,raw,echo=0 This will allow only one client to connect, as per the OPs request.

Use the Raspberry Pi Serial Port to Connect to a Device. Origin mac games. This example shows how to create a connection to a serial device, write data to the device, and read data from the device. By default, the serial console in the customized version of Raspbian Wheezy on your Raspberry Pi™ hardware is enabled.