1. minicom 使用
无特别说明,下边操作均在 ubuntu20.4 上操作
1.1. 挂载设备目录
➜ ls /dev/ | grep USB
ttyUSB0
ttyUSB1
➜ minicom --version
minicom version 2.7.1 (compiled Dec 23 2019)
➜ minicom --help
Usage: minicom [OPTION]... [configuration]
A terminal program for Linux and other unix-like systems.
-b, --baudrate : set baudrate (ignore the value from config)
-D, --device : set device name (ignore the value from config)
-s, --setup : enter setup mode
-o, --noinit : do not initialize modem & lockfiles at startup
-m, --metakey : use meta or alt key for commands
-M, --metakey8 : use 8bit meta key for commands
-l, --ansi : literal; assume screen uses non IBM-PC character set
-L, --iso : don't assume screen uses ISO8859
-w, --wrap : Linewrap on
-H, --displayhex : display output in hex
-z, --statline : try to use terminal's status line
-7, --7bit : force 7bit mode
-8, --8bit : force 8bit mode
-c, --color=on/off : ANSI style color usage on or off
-a, --attrib=on/off : use reverse or highlight attributes on or off
-t, --term=TERM : override TERM environment variable
-S, --script=SCRIPT : run SCRIPT at startup
-d, --dial=ENTRY : dial ENTRY from the dialing directory
-p, --ptty=TTYP : connect to pseudo terminal
-C, --capturefile=FILE : start capturing to FILE
-F, --statlinefmt : format of status line
-R, --remotecharset : character set of communication partner
-v, --version : output version information and exit
-h, --help : show help
configuration : configuration file to use
These options can also be specified in the MINICOM environment variable.
This variable is currently unset.
The configuration directory for the access file and the configurations
is compiled to /etc/minicom.
Report bugs to <minicom-devel@lists.alioth.debian.org>.
1.2. 加载新设备 save as 使用
sudo 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/modem |
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
| E - Bps/Par/Bits : 115200 8N1 |
| F - Hardware Flow Control : Yes |
| G - Software Flow Control : No |
| |
| Change which setting? |
+-----------------------------------------------------------------------+
# 通过字母选择制定选项,比如选择 A 修改挂载为 /dev/ttyUSB0,回车退出
# 输入 E,然后一直输入 A 选择下一个,直到出现 150000 为止,回车退出
+---------[Comm Parameters]----------+----------------+
| | |
| Current: 115200 8N1 | |
| Speed Parity Data | |
| A: <next> L: None S: 5 | |
| B: <prev> M: Even T: 6 | |
| C: 9600 N: Odd U: 7 | |
| D: 38400 O: Mark V: 8 | |
| E: 115200 P: Space | |
| | |
| Stopbits |----------------+
| W: 1 Q: 8-N-1 |
| X: 2 R: 7-E-1 |
| |
| |
| Choice, or <Enter> to exit? |
+------------------------------------+
# 然后选择 save setup as ... 输入文件名回车保存,比如 xxx1 然后退出, 会生成 /etc/minicom/minirc.xxx1 文件
➜ cat /etc/minicom/minirc.x4b
# Machine-generated file - use "minicom -s" to change parameters.
pu port /dev/ttyUSB0
pu baudrate 1500000
pu bits 8
pu parity N
pu stopbits 1
# 下次直接通过 sudo minicom xxx1 来登录保存的参数