bash给出错误中的串行端口列表:命令太长(允许最大字符= 354)



我正在尝试为嵌入式板创建一个侦听器。它每命令返回多行,我不太确定EOF格式。我为听众使用以下内容:

(stty raw speed 115200 cs8 -cstopb; cat > received.log) < /dev/ttyUSB0

另一个外壳中的命令是

printf "r" > /dev/ttyUSB0

它返回:命令的多个运行和用

格式格式的每行
ERROR: Command is TOO LONG (max chars allowed = 354)
^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^

我使用printf发送所有类型的输入

使用:

printf "n" > /dev/ttyUSB0

给出:

ERROR: Command is TOO LONG (max chars allowed = 354)
^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z^M^J^M^JERROR: Command is TOO LONG (max chars allowed = 354)^M^J^Z

发生了什么事,我该如何解决?串行端口是115200 8N1,没有硬件或软件流控制。

从您的问题中确切清楚地发现ERROR: Command is TOO LONG消息来自何处以及如何查看它。我猜那是您在received.log文件中看到的?

尤其是考虑到您要返回的错误消息包括^M^J(这是说rn(序列的序列,我的猜测是串行连接另一端的设备使用rn用作线路结束的约定,喜欢窗户或dos。(Unix仅使用n,并且还有系统,例如旧的Macintosh OS,仅使用r。(

尝试将第二个命令更改为:

printf "rn" > /dev/ttyUSB0

看看是否有帮助。

最新更新