Linux下COM口连接使用程序 minicom

用途:Linux下调试交换机等需要COM口操作的情况
软件:minicom
操作:

  1. 安装minicom

    dnf install minicom -y
    apt install minicom -y
  2. 配置minicom

    minicom -s 
    
    +-----[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        |
            +--------------------------+
    #选择 Serial port setup
    
    +-----------------------------------------------------------------------+
    | A -    Serial Device      : /dev/ttyUSB0                              |
    |                                                                       |
    | C -   Callin Program      :                                           |
    | D -  Callout Program      :                                           |
    | E -    Bps/Par/Bits       : 9600 8N1                                  |
    | F - Hardware Flow Control : Yes                                       |
    | G - Software Flow Control : No                                        |
    | H -     RS485 Enable      : No                                        |
    | I -   RS485 Rts On Send   : No                                        |
    | J -  RS485 Rts After Send : No                                        |
    | K -  RS485 Rx During Tx   : No                                        |
    | L -  RS485 Terminate Bus  : No                                        |
    | M - RS485 Delay Rts Before: 0                                         |
    | N - RS485 Delay Rts After : 0                                         |
    |                                                                       |
    |    Change which setting?                                              |
    +-----------------------------------------------------------------------+
    #A: 修改com端口,一般机器自带的是 /dev/ttyS0 这里是USB设备,所以是 /dev/ttyUSB0
    #E: 修改波特率等信息,选择后会弹窗,根据需求选择即可。
            +-----[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        |
            +--------------------------+
    #选择 Save setup as dfl  #保存未默认设置
    #选择 Exit 退出配置
  3. 使用minicom

    minicom
    #直接使用以上命令即可自动连接
    Welcome to minicom 2.8
    #
    OPTIONS: I18n
    Compiled on May 20 2024, 19:11:11.
    Port /dev/ttyUSB0, 16:25:40
    #
    Press CTRL-A Z for help on special keys
    #
    [Quidway]
  4. 退出minicom

    #按下 Ctrl + A
    #然后按 z
    #
    Welcome to minicom 2.8                     +-------------------------------------------------------------------+
                                           |                      Minicom Command Summary                      |
    OPTIONS: I18n                              |                                                                   |
    Compiled on May 20 2024, 19:11:11.         |              Commands can be called by CTRL-A <key>               |
    Port /dev/ttyUSB0, 16:25:40                |                                                                   |
                                           |               Main Functions                  Other Functions     |
    Press CTRL-A Z for help on special keys    |                                                                   |
                                           | Dialing directory..D  run script (Go)....G | Clear Screen.......C |
                                           | Send files.........S  Receive files......R | cOnfigure Minicom..O |
    [Quidway]                                  | comm Parameters....P  Add linefeed.......A | Suspend minicom....J |
    <Quidway>                                  | Capture on/off.....L  Hangup.............H | eXit and reset.....X |
    <Quidway>                                  | send break.........F  initialize Modem...M | Quit with no reset.Q |
                                           | Terminal settings..T  run Kermit.........K | Cursor key mode....I |
                                           | lineWrap on/off....W  local Echo on/off..E | Help screen........Z |
                                           | Paste file.........Y  Timestamp toggle...N | scroll Back........B |
                                           | Add Carriage Ret...U                                              |
                                           |                                                                   |
                                           |             Select function or press Enter for none.              |
                                           +-------------------------------------------------------------------+
    #按下x即可退出,其他配置可以自己查看上面的介绍

发表回复

登录... 后才能评论