I'm working in a project in which I will have to deal with serial communications. For testing, I want make to 2 computers speak to each other (with my interaction) via RS232.

Will the next thing work?

in computer A:

# cat /dev/ttyS0

in computer B:

# echo <something> >> /dev/ttyS0

Will computer A, receive data from B, or not?

If I'm wrong, what would be the easiest way to send something to the other computer?

Ideas are welcome!

  • This is probably a question better asked at stack overflow
    – Falmarri
    Oct 16, 2010 at 8:43
  • 1
    @falmarri: this isn't a programming question, so why?
    – delete
    Oct 18, 2010 at 10:24
  • @falmarri: Toadette is right, and my question is related only to unix enviroments.
    – Tomas
    Oct 18, 2010 at 21:59

2 Answers 2


An easier way, if you know how to program in python, might be for you to use an API available for python called PYSERIAL so that you don't have to worry about doing any of the dirty work of setting up flags or passing parameters to the driver that handles the serial port on your computer. Pyserial takes care of all this for you in the background.

You would have to specify the baud rate at most, and leave the rest as default for a working serial connection between the 2 computers.

The entire code for enabling such a connection could be at the most a few lines or half a page long.

  • This is why I suggested this might be better on stackoverflow =P
    – Falmarri
    Oct 18, 2010 at 22:14

Well, if you want to communicate via the serial port you have to setup the right parameters (baud, stop bit, parity,handshake etc.).

I used minicom in the past for stuff like using a computer as a serial console terminal to another.

The cu command is an alternative.

  • I tried that way yesterday, but it didn't work... Could it be the cable? Don't know if it had crossed TX and RX, because I borrowed it.
    – Tomas
    Oct 16, 2010 at 19:47
  • Well, I am no fortune teller ... Sure, the cable could always be the problem. But serial cables are easy to check via a continuity tester (usually available in every voltmeter). Just buy a new cable, they are really cheap ... Oct 16, 2010 at 20:48

You must log in to answer this question.

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