How to connect to a serial port as simple as using SSH

command lineserial portserial-consoleterminaltty

Is there a way to connect to a serial terminal just as you would do with SSH? There must be a simpler way than tools such as Minicom, like this

$ serial /dev/ttyS0 

I know I can cat the output from /dev/ttyS0 but only one way communication is possible that way, from the port to the console. And echo out to the port is just the same but the other way around, to the port.

How can I realize two way communication with a serial port the simplest possible way on Unix/Linux?

Best Answer

I find screen the most useful program for serial communication since I use it for other things anyway. It's usually just screen /dev/ttyS0 <speed>, although the default settings may be different for your device. It also allows you to pipe anything into the session by entering command mode and doing exec !! <run some program that generates output>.

Related Question