Linux 中串口工具 microcom 的用法

  串口工具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,串口波特率。
  另外两个没多大用

   ----------------------------------*/

举例:

  microcom -t 15000 -s 115200 /dev/ttyS0

 

    -t 单位毫秒,无操作自动退出时间,这里是15000ms。

 

    -s 单位bps,串口波特率。

 

    ttyS0 要操作的串口

  

  举例:设置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后自动退出

 

posted @ 2021-07-22 13:53  白菜没我白  阅读(2892)  评论(0编辑  收藏  举报