How to check and use the serial port on Linux

Source: Internet
Author: User
Tags dmesg

Original translation to: http://www.cyberciti.biz/faq/find-out-linux-serial-ports-with-setserial/

How do I check and configure the serial port for various purposes (such as a modem, connecting an empty module, or connecting to a dumb terminal) under Linux?

Linux offers a variety of tools. Linux uses Ttysx as the name of a serial device. For example, COM1 (dos/windows name) is ttyS0, COM2 is ttyS1 and so on.

Task: Display the detected system serial port support

Simply run the 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 = 16550A) is a
setserial command

Setserial is a program used to set and/or report configuration information associated with a serial port. This information includes the I/O port and interrupt number used by the serial port, and whether the break key should be interpreted as secure Attention key, and so on. Just output 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, Po Rt:0x03e8, Irq:4/dev/ttys3, Uart:unknown, Port:0x02e8, Irq:3

The setserial with the-G option helps find the physical serial port on your Linux board.

Linux Serial Console Program

Once the serial port is identified, you can use a number of tools to configure the Linux board:

    1. minicom-The best serial communication program for controlling the modem and connecting to the dump device.
    2. wvidial or other GUI dial Up Networking program-a built-in smart PPP dialer.
    3. Getty/agetty -Agetty opens a TTY port, prompts for the login name and invokes the/bin/login command.
    4. Grub/lilo Configuration-Configuring the serial port for 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.