microcom
使用方法
在嵌入式平台下,实现串口调试功能,如果使用的是 buildroot
会很方便,因为 buildroot
已经集成了 minicom
,所以只需要重新配置 buildroot
,使能 minicom
即可。如果使用的是有 busybox
,是不会被集成 minicom
软件的,但会有一个更加简单的串口工具 microcom
,用法如下:
$ microcom --help
BusyBox v1.24.1 (2022-08-11 07:53:14 UTC) multi-call binary.
Usage: microcom [-d DELAY] [-t TIMEOUT] [-s SPEED] [-X] TTY
Copy bytes for stdin to TTY and from TTY to stdout
-d Wait up to DELAY ms for TTY output before sending every
next byte to it
-t Exit if both stdin and TTY are silent for TIMEOUT ms # -t: 单位毫秒,无操作自动退出时间。
-s Set serial line to SPEED # -s: 单位 bps,串口波特率。
-X Disable special meaning of NUL and Ctrl-X from stdin
示例:调试 4G
模块
# 波特率 9600,10S 内无操作就会退出
$ microcom -t 10000 -s 9600 /dev/ttyUSB1
AT+CPIN?
+CPIN: READY
OK
AT+DIALMODE?
+DIALMODE: 0
OK
AT$MYCONFIG?
$MYCONFIG: "usbnetmode",0
OK
AT+CPSI?
+CPSI: LTE,Online,460-01,0xE867,9395740,16,EUTRAN-BAND8,3745,3,0,13,32,32,0
OK