Linux 串口工具 minicom


minicom 是 linux下 一款常用的串口調試工具。

安裝 minicom

ubuntu 環境下,使用如下命令安裝

apt-get install minicom

配置 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                     |
        +--------------------------+

鍵盤方向鍵,到 Serial port setup,回車

命令輸出內容,一個選擇界面

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

鍵盤輸入 A,光標跳到第一行最后,編輯想要連接的串口設備,我這次的設備使用的串口是 /dev/ttymxc3,編輯完回車。
鍵盤輸入 E,彈出波特率選項,輸入選項的字母,回車,或者ESC退出。
鍵盤輸入 F,改為 No,再次鍵入 F,改為 Yes。默認是 Yes,要改為 No。

設置完后,回車,返回設置界面,使用方向鍵,切換到 Exit

就可以輸入命令了,如果串口一直輸出命令,也會接收到。

minicom 是基於窗口的。要彈出所需功能的窗口,可按下 Ctrl + A

按住 Ctrl + A

再輸入 Z,打開幫助窗口

幫助內容

+-------------------------------------------------------------------+
|                      Minicom Command Summary                      
|                                                                   
|              Commands can be called by CTRL-A <key>               
|                                                                   
|               Main Functions                  Other Functions     
|                                                                   
| Dialing directory..D  run script (Go)....G | Clear Screen.......C 
   
| Send files.........S  Receive files......R | cOnfigure Minicom..O 
   
| comm Parameters....P  Add linefeed.......A | Suspend minicom....J 
   
| Capture on/off.....L  Hangup.............H | eXit and reset.....X 
   
| 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                                              
|                                                                   
+-------------------------------------------------------------------+  

Ctrl + A 命令

Ctrl + A

按 E,回顯,即輸入了什么命令會顯示,默認是不顯示的。

按 X,提示退出 minicom,Yes 選項,回車。

+----------------------+
|    Leave Minicom?    |                                          
|     Yes       No     |
+----------------------+

直接命令

minicom -D /dev/ttymxc3

我的設備設置了一直輸出 GPS 信息


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM