如何确定哪个 tty 文件指向哪个 USB 转串口设备?

发布于 2024-07-30 14:56:02 字数 247 浏览 1 评论 0原文

我有两台旧机器通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

久光 2024-08-06 14:56:02

查看此使用 Linux USB 页面。

/proc/bus/usb/devices 列出当前连接到 USB 总线的设备的信息。 当尝试确定设备是否正确枚举时,这非常有用。

Check this Using Linux USB page.

/proc/bus/usb/devices lists information about the devices currently attached to the USB bus. This is very useful when trying to figure out if the device is correctly enumerated.

我是有多爱你 2024-08-06 14:56:02

也许您可以使用 lsusb -v 的输出并查看 iProduct + iSerial 来确定设备的连接顺序。

Maybe you can use the output from lsusb -v and look at iProduct + iSerial to determine the order the devices are attached.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文