Linux – serial port loopback
Sometimes, usually when programming embedded systems there is a need to test pair of programs communicating each other via serial port.
Serial ports loopback can be created using socat command:
arek@arek-toshiba:~$ socat -d -d pty,raw,echo=0 pty,raw,echo=0
2016/02/05 21:13:30 socat N PTY is /dev/pts/0
2016/02/05 21:13:30 socat N PTY is /dev/pts/17
2016/02/05 21:13:30 socat N starting data transfer loop with FDs [5,5] and [7,7]
Do data sent to /dev/pts/0 will appear on /dev/pts/17 and vice versa.