How To Check and Use Serial Ports Under Linux

2019-01-14 18:17:51 flykan 36

How do I check and configure serial ports under Linux for various purposes such as modem, connecting null modems or connect a dumb terminal? Linux offers various tools. Linux uses ttySx for a serial port device name. For example, COM1 (DOS/Windows name) is ttyS0, COM2 is ttyS1 and so on.

setserial command
setserial is a program designed to set and/or report the configuration information associated with a serial port. This information includes what I/O port and IRQ a particular serial port is using, and whether or not the break key should be interpreted as the Secure Attention Key, and so on. Just type the following command:

$ setserial -g /dev/ttyS[0123]

setserial with -g option help to find out what physical serial ports your Linux box has.

Linux serial console programs
Once serial ports identified you can configure Linux box using various utilities:
1. minicom– The best friendly serial communication program for controlling modems and connecting to dump devices
2. wvidial or other GUI dial up networking program – a PPP dialer with built-in intelligence.
3. getty / agetty – agetty opens a tty port, prompts for a login name and invokes the /bin/login command.
4. grub / lilo configuration – To configure serial port as the system console


Mon - Friday 09:00~18:00