How to Connect to the Serial Console RS-232 on Linux Terminal

Most embedded Linux/BSD Systems such as router, switch, servers, and NAS device comes with console port interface (RS-232). RS-232 is used for communicating to headless server, where no monitor or keyboard installed during boot when operating system is not running yet and therefore no network connection is possible. You need to use serial cable between your computer and embedded system server or router. On this post, i will share to you how to make it connect with terminal linux command. There are many commands that can use it.

If you want to connect your computer with serial port devices, first you must find out information about your serial port.

Type the following dmesg command :

$ dmesg | egrep --color 'serial|ttyS'

Sample outputs:

[ 1.245258] serial8450: tty0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 1.265727] serial8450: tty1 at I/O 0x2f8 (irq = 3) is a 16550A
[ 1.286713] 00:07: tty0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 1.307321] 00:08: tty1 at I/O 0x2f8 (irq = 3) is a 16550A

Okay, now you have an informations about your serial console. So let’s connect.

  1. cu CommandYou can use it as follows :
    cu -l /dev/device -s baud-rate-speed
    In this example, i’ll use /dev/tty0 with 9600 baud-rate :
    cu -l /dev/tty0 -s 9600

    Sample outputs : Selection_001

  2. screen CommandYou can use it as follows :
    screen /dev/device baud-rate-speed
    In this example, i’ll use /dev/tty0 with 9600 baud-rate :
    screen /dev/ttyUSB0 9600

    Sample outputs : Selection_002

  3. PuttyYou can use putty in linux, just install with apt-get install putty or yum install putty

    Sample outputs : Selection_005

  4. minicomIt’s very simple, you just install minicom with apt-get or yum install minicom, and then you must set minicom configuration

    Configuration minicom : Selection_003It’s outputs after configuring minicom and then connect to the serial port cisco switch : Selection_004

    Oke, that it’s all. Enjoy your day geek 😀 . Thank you

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s