To install socat on Ubuntu (I'm using 12.04) just run the following command:
- # sudo apt-get install socat
Setting up two serial lines
now on a terminal window run socat
- # socat -d -d PTY PTY
The output should look like the following one:
- 2013/09/20 14:07:10 socat[6871] N PTY is /dev/pts/5
- 2013/09/20 14:07:10 socat[6871] N PTY is /dev/pts/6
- 2013/09/20 14:07:10 socat[6871] N starting data transfer loop with FDs [3,3] and [5,5]
Now you have two "serial" ports connected back to back
Testing the ports
open a new terminal and issue the following command
- # sudo cat /dev/pts/5
open a new terminal and issue the following command
- # sudo echo "Hello World" > /dev/pts/6
On the first terminal you should see the string "Hello World".
That's all,nothing more.