在Linux下,集成有minicom軟件,可以實現串口調試功能,但是有的不會集成minicom軟件。如果你使用的是busybox的文件系統,有一個更加簡單的串口工具microcom,用法如下:
/ # busybox microcom -h microcom: invalid option -- 'h' BusyBox v1.29.0 (2020-12-23 13:09:27 CST) 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 -s Set serial line to SPEED -X Disable special meaning of NUL and Ctrl-X from stdin
/*----------------------------------
-t 單位毫秒,無操作自動退出時間。
-s 單位bps,串口波特率。
另外兩個沒多大用
----------------------------------*/
舉例:設置5s內無操作退出,且波特率為115200的ttyUSB1
/ # busybox microcom -t 5000 -s 115200 /dev/ttyUSB1 //輸入指令 ati;+cpin?;+csq;+cops?;+cgreg? Quectel EC200S Revision: EC200SCNAAR01A09M16 +CSQ: 23,99 +CGREG: 0,0 +CME ERROR: 10 / # //5S后自動退出