Getting access to TTYs
There're several ways to get access to a serial port in a GNU/Linux system, starting from the minicom
program we used to interact with the system's serial console from the host PC. However, since in a UNIX system, everything is a file, we can use generic tools such as echo
and cat
too! However, they are not enough due the fact that we have to set up several communication settings before starting the data transmission. To do this, we can use the stty
command already introduced earlier, which allow us to set up all tty devices' parameters.
Its usage is not as tricky as we may think. However, after the first approach, everything should become easier. For instance, if we wish to display the current serial port settings, we can use the following command where we use the -F
option argument to specify the device to operate on:
root@bbb:~# stty -F /dev/ttyS2 speed 9600 baud; line = 0; -brkint -imaxbel
Tip
The long and complete form is the one we can get using the -a
command...