如何确定哪个 tty 文件指向哪个 USB 转串口设备?
我有两台旧机器通过 USB 使用 ftdi_sio 驱动程序连接到 /dev/ttyUSB0
和 /dev/ttyUSB1
。 Linux 盒子正在中继和分析机器之间的流量。 当 Linux 机器启动时,机器几乎随机地连接到文件。 问题是要知道哪个是哪个。
当然,我可以只询问设备,但我想避免由于将错误数据发送到错误设备而导致故障的风险。 有没有办法找出例如连接到 tty 文件的设备的 id?
I have two legacy machines connected to a Linux box with USB using the ftdi_sio driver, to /dev/ttyUSB0
and /dev/ttyUSB1
. The Linux box is relaying and analyzing the traffic between the machines. When the Linux box boots up, the machines are connected to the files pretty much randomly. The problem is to know which one is which.
I could just ask the devices, of course, but I'd like to avoid the risk of malfunction due to sending wrong data to the wrong device. Is there a way to figure out, for example, the id of the device connected to a tty file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看此使用 Linux USB 页面。
Check this Using Linux USB page.
也许您可以使用
lsusb -v
的输出并查看iProduct
+iSerial
来确定设备的连接顺序。Maybe you can use the output from
lsusb -v
and look atiProduct
+iSerial
to determine the order the devices are attached.