How to check and use serial ports under Linux
How do I check and configure serial ports under Linux for various purposes such as modem, null ing 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.
Task: Display detected system's serial support
Simple run dmesg command
$
dmesg | grep tty
Output:
[ 37.531286] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A[ 37.531841] 00:0b: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A[ 37.532138] 0000:04:00.3: ttyS1 at I/O 0x1020 (irq = 18) is a 16550A
Setserial command
Setserial is a program designed to set and/or report the configuration information associated with a serial port. this information provided des what I/O port and IRQ a particle serial port is using, and whether or not the Break Key shocould be interpreted as
Secure attention key, and so on. Just type the following command:
$
setserial -g /dev/ttyS[0123]
Output:
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4/dev/ttyS1, UART: 16550A, Port: 0x1020, IRQ: 18/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
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:
- Minicom-
The best friendly serial communication program for controlling modems and connecting to dump Devices
- Wvidial
Or other GUI Dial Up Networking Program-a PPP dialer with built-in intelligence.
- Getty/agetty-agetty opens a tty port, prompts for a login name and invokes the/bin/LOGIN command.
- Grub/lilo configuration-to configure serial port as the system console