小编Adr*_*aub的帖子

Socat串口嗅探

我目前正在尝试访问连接到应用程序的串行端口的两个方向上的数据。
我想做的是:
ttymxc0 <-----> socat sniff <--------> ttyV0 <------> 应用程序
ttymxc0 是真实端口,ttyV0 是虚拟端口。

我发现 socat 命令适用于 Ubuntu 16.04: http://www.iheartrobotics.com/2010/02/debugginng-serial-interfaces.html

但是当我使用 buildroot 在嵌入式系统上使用它时,我收到此错误:

socat -d /dev/ttymxc0,raw,echo=0 SYSTEM:'tee input.txt | socat - "PTY,link=/tmp/ttyV0,raw,echo=0,waitslave" | tee output.txt'
 socat[3167.1996369920] E address "GOPEN..." in intermediate context, leftdirs=4, rightdirs=7, with 1 parameter(s) is not available
 socat[3167.1996369920] W cannot restore terminal settings on fd 3: Bad file descriptor
Run Code Online (Sandbox Code Playgroud)

我尝试查看文件的访问属性,但没有成功。当您不要求打印输入和输出时它可以工作,但这对我的使用没有用

在这种情况下,buildroot 和 Ubuntu 之间有什么不同吗?

serial-port socat buildroot

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

buildroot ×1

serial-port ×1

socat ×1