Linux comes with many serial text and gui based serial communication programs. My favorite is minicom - friendly menu driven serial communication program.
Let us see how to configure minicom on Redhat Enterprice Linux
1. First we have to to check Serial Ports.
1. First we have to to check Serial Ports.
Linux uses ttySn for a serial port device name. For example, COM1 (DOS/Windows name) is ttyS0, COM2 is ttyS1 and so on. And if you are using USB to Serial converters then it will be ttyUSBn
To 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 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]
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.
Once serial ports identified you can configure Minicom
2. Install minicom
Use apt-get under Debian / Ubuntu Linux, enter:
$ sudo apt-get install minicom
If you are using Red hat Linux (RHEL) / CentOS / Fedora Linux, enter:# yum install minicom
3. Setup minicom
The -s option use to setup minicom. Some terminals such as the Linux console support color with the standard ANSI escape sequences. Type the following command start minicom with colours:$ minicom -s -c on
Configure serial port
You need to configure serial port. Use up and down arrows to select menus. Press down and select Serial port setup:
- Press A to setup serial device name such as /dev/ttyS1
- Press E to setup Bps/Par/Bits
- Press F to setup Hardware Flow Control
- Press [ESC] to exit
- Save setup as DFL
- Exit
More on shortcut keys
To activate help menu press [CTRL+A] followed by [Z] for help on special keys:
minicom in action
You need to connect your serial device such as router using consol cable. Once connected power on device and type minicom command without -s option:
$ minicom -c on
0 comments:
Post a Comment