How to check and use serial ports under Linux

Source: Internet
Author: User
Tags dmesg
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:

  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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.