Linux Serial

From Braindisconnect
Jump to: navigation, search

Connect to a Router via Debian Linux Serial

Install minicom, very nice Linux serial terminal

apt-get update && apt-get install minicom

Check to make sure your serial port(s) are seen

# dmesg | grep ttyS
[    0.755617] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A   <--- COM 0
[    0.836174] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A   <--- COM 1

Go into the minicom menu

minicom -s

Using your arrow keys, highlight Serial port setup and press enter

           +-----[configuration]------+
           | Filenames and paths      |
           | File transfer protocols  |
           | Serial port setup        |
           | Modem and dialing        |
           | Screen and keyboard      |
           | Save setup as dfl        |
           | Save setup as..          |
           | Exit                     |
           | Exit from Minicom        |
           +--------------------------+

Type the letter a

   +-----------------------------------------------------------------------+
   | A -    Serial Device      : /dev/modem                                |
   | B - Lockfile Location     : /var/lock                                 |
   | C -   Callin Program      :                                           |
   | D -  Callout Program      :                                           |
   | E -    Bps/Par/Bits       : 9600 8N1                                  |
   | F - Hardware Flow Control : Yes                                       |
   | G - Software Flow Control : No                                        |
   |                                                                       |
   |    Change which setting?                                              |
   +-----------------------------------------------------------------------+

Change the serial device to /dev/ttyS0 or whatever your serial is and press enter:

   +-----------------------------------------------------------------------+
   | A -    Serial Device      : /dev/ttyS0                                |
   | B - Lockfile Location     : /var/lock                                 |
   | C -   Callin Program      :                                           |
   | D -  Callout Program      :                                           |
   | E -    Bps/Par/Bits       : 9600 8N1                                  |
   | F - Hardware Flow Control : Yes                                       |
   | G - Software Flow Control : No                                        |
   |                                                                       |
   |    Change which setting?                                              |
   +-----------------------------------------------------------------------+

You can change the baud rate, data bits, parity, and stop bits if needed by typing in the letter e:

   +-----------------------------------------------------------------------+
   | A -    Serial Device      : /dev/ttyS0                                |
   | B - Lockfile Location     : /var/lock                                 |
   | C -   Callin Program      :                                           |
   | D -  Callout Program      :                                           |
   | E -    Bps/Par/Bits       : 9600 8N1                                  |
   | F - Hardware Flow Control : Yes                                       |
   | G - Software Flow Control : No                                        |
   |                                                                       |
   |    Change which setting?                                              |
   +-----------------------------------------------------------------------+

Hit enter when you are done modifying the settings

   +-----------------+---------[Comm Parameters]----------+----------------+
   | A -    Serial De|                                    |                |
   | B - Lockfile Loc|     Current:  9600 8N1             |                |
   | C -   Callin Pro| Speed            Parity      Data  |                |
   | D -  Callout Pro| A: <next>        L: None     S: 5  |                |
   | E -    Bps/Par/B| B: <prev>        M: Even     T: 6  |                |
   | F - Hardware Flo| C:   9600        N: Odd      U: 7  |                |
   | G - Software Flo| D:  38400        O: Mark     V: 8  |                |
   |                 | E: 115200        P: Space          |                |
   |    Change which |                                    |                |
   +-----------------| Stopbits                           |----------------+
           | Screen a| W: 1             Q: 8-N-1          |
           | Save set| X: 2             R: 7-E-1          |
           | Save set|                                    |
           | Exit    |                                    |
           | Exit fro| Choice, or <Enter> to exit?        |
           +---------+------------------------------------+

Hit enter to get back to the main menu and then select Save setup as dfl.

           +-----[configuration]------+                                     
           | Filenames and paths      |                                     
           | File transfer protocols  |                                     
           | Serial port setup        |                                     
           | Modem and dialing        |                                     
           | Screen and keyboard      |                    
           | Save setup as dfl        |                    
           | Save setup as..          |                    
           | Exit                     |                    
           | Exit from Minicom        |                    
           +--------------------------+

Selecting Exit will take you into the terminal, and there is a bar on the bottom with information and CTRL-A then Z for help.
CTRL-A and then Q to quit.