minicom (com port, serial port ttyS)

最後更新: 2017-11-16

介紹

 


screen

 

好處: 系統基本上會有的工具來

Usage

screen /dev/ttyS0 19200

 


找出本機的 serial port (dmesg)

 

dmesg | grep tty[SU]

[    0.861593] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    0.862011] 00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

# USB to Serial # CH340

[ 3350.719197] usb 1-1.2: ch341-uart converter now attached to ttyUSB0

 


setserial

 

Get/Set Linux serial port information

安裝

apt-get install setserial

找出本機的 serial port(setserial)

# -g 即是代表之後的是 /dev/tty[SU][0123] =  "list of devices"

setserial -g /dev/tty[S][0123]                 # setserial -g /dev/ttyUSB[0123]

/dev/ttyS0, UART: 16550A,  Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3

Get port info

setserial /dev/ttyUSB0

/dev/ttyUSB0, UART: unknown, Port: 0x0000, IRQ: 0

setserial -a /dev/ttyUSB0

/dev/ttyUSB0, Line 0, UART: unknown, Port: 0x0000, IRQ: 0
        Baud_base: 0, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal

 


minicom

 

介紹:

Minicom is window based

安裝:

apt-get install minicom

使用:

minicom    <-- default 是打開 /dev/modem

Options:

-s   Setup ( /etc/minicom/minirc.dfl )    <-- $HOME/.minirc.*

            +-----[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        |
            +--------------------------+

-b, --baudrate         : set baudrate

-D, --device           : set device name

-C, --capturefile=FILE : start capturing to FILE

-p, --ptty=TTYP        : connect to pseudo terminal

-c, --color=on/off     : ANSI style color usage on or off

Usage

minicom -b 115200 -D /dev/ttyS0

HostKey

"CTRL-A" 再加以下 Key 組合 # "CTRL-a + <key>"

  • Help                     Z
  • Clear Screen          C
  • Capture on/off        L
  • comm Parameters   P
  • eXit and reset         X
  • initialize Modem     M
  • Scroll Back             B (可以按u上卷, 按d下卷)
  • run script (Go)       G

 


 

Creative Commons license icon Creative Commons license icon