Find the answer to your Linux question:
Results 1 to 3 of 3
Hi all, I'm currently trying to figure out how to how to forward serial data from my COM ports on one computer to a server computer for remote accessing. The ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2012
    Posts
    4

    Help with COM Port Forwarding


    Hi all,

    I'm currently trying to figure out how to how to forward serial data from my COM ports on one computer to a server computer for remote accessing. The initial computer runs Lubuntu 10.04 while the server runs Ubuntu 12.10.

    I've read that you can use programs such as ser2net,ttyd, and others to accomplish this but so far I am completely lost as to where to start in this aspect. I haven't found anything akin to a guide or how-to that can help me in this process either (I'm very new to linux).

    Can anybody help me with this?

  2. #2
    Just Joined!
    Join Date
    Jan 2013
    Posts
    3
    Try socat. Works fine.
    Should work similar to this:

    On the server:
    socat TCP4-LISTEN:5555,fork /dev/ttyS0,raw,echo=0,crnl

    On the client:
    socat TCP4:server.example.com:5555 /dev/ttyS0,raw,echo=0,crnl

    There are various optiuns for setting the ttys, so I recomend reading the man page as well for fine tuning.

    Check this howto:
    technostuff.blogspot.ro/2008/10/some-useful-socat-commands.html

  3. #3
    Just Joined!
    Join Date
    Dec 2012
    Posts
    4
    Quote Originally Posted by alexandrubujor View Post
    Try socat. Works fine.
    Should work similar to this:

    On the server:
    socat TCP4-LISTEN:5555,fork /dev/ttyS0,raw,echo=0,crnl

    On the client:
    socat TCP4:server.example.com:5555 /dev/ttyS0,raw,echo=0,crnl

    There are various optiuns for setting the ttys, so I recomend reading the man page as well for fine tuning.

    Check this howto:
    technostuff.blogspot.ro/2008/10/some-useful-socat-commands.html
    I've looked over socat a little more and I think I have the general gist of how to set it up:

    Code:
    socat TCP-LISTEN:27644,fork /dev/ttyS0,raw &
    This command would be open a bi-directional TCP/IP socket at port 27644 which connects to the serial device ttyS0. I would run this on the computer that has the actual serial devices connected to it.

    Code:
    socat pty,link=./com1,echo=0,crnl tcp:remote-server:27644
    This command would be then would be run on the computer that wants to remotely read the serial data. It would allow it to read the data coming from port 27644 as if it were COM1.

    Is my understanding of this correct? Additionally how does the 2nd computer know address of the 1st one in order to read data from it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •