0

I have a server with 8 COM ports which I would like to make accessible via TCP ports, I've done quite a bit of research and tried numerous solutions including ser2net etc. All of which unfortunately don't support multiple concurrent connections, I want to be able to connect more than one client to each port.

I'm using a VM so I'm open to any OS, but was hoping to use a lightweight Linux distro.

Appreciate any help, thanks

1
  • Sorry I probably should of made it clearer, so I am trying to communicate with AV equipment over the network to serveral serial devices connected to my server, e.g. a denon amp. The amp has RS-232 and I want to be able to send commands to it using a TCP/IP port. Basically I'm after emulating something like a Moxa NPORT or Global Cache.
    – Jack
    Commented Sep 15, 2014 at 22:25

1 Answer 1

1

It isn't entirely clear what you want to do but it may be possible that socat will enable you to access a serial port on one computer from a TCP connection from another computer.

See EXAMPLE FOR REMOTE TTY (TTY OVER TCP) USING SOCAT

You have a host with some serial device like a modem or a bluetooth interface (modem server) You want to make use of this device on a different host. (client)

1) on the modem server start a process that accepts network connections and links them with the serial device /dev/tty0:

$ socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock

2) on the client start a process that creates a pseudo tty and links it with a tcp connection to the modem server:

$ socat pty,link=$HOME/dev/vmodem0,waitslave tcp:modem-server:54321

socat supports forking and has other features that may be useful in achieving multiple concurrent connections.

The above example assumes you have some client application which works with a serial connection, the client instance of socat provides the local end of a relay for a local virtual serial port to a remote real serial port.

If you have an application that doesn't expect a local serial port but which communicates over TCP direcly, you wouldn't need the local instance of socat.

For multiple serial ports you could start multiple instances of socat, each of which can handle multiple consecutive connections.

1
  • I've added a comment above.
    – Jack
    Commented Sep 15, 2014 at 22:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .