同じ USB-RS232 チップに基づく 2 つの異なる USB デバイスがあります。それらを USB に接続すると、それらは /dev/ttyUSB0...3 にマウントされます。
私の問題は、スクリプト内で、どれがどの tty にあるかを見つける方法です。
lsusb を使用すると、それらを区別できます。
$> lsusb | grep 0403:f850
Bus 004 Device 002: ID 0403:f850 Future Technology Devices International, Ltd
$> lsusb | grep 0403:6001
Bus 004 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
dmesg を使用すると、それらがどこにマウントされているかがわかります。
$> dmesg | grep 'FTDI USB Serial Device converter now attached'
[36051.393350] usb 4-2: FTDI USB Serial Device converter now attached to ttyUSB1
[36061.823513] usb 4-1: FTDI USB Serial Device converter now attached to ttyUSB0
しかし、「usb 4-1」は「Bus 004 Device 002」に対応していないようです。
「Bus 004 Device 001」は常に「USB ルート ハブ」であり、dmesg は 1 以降、lsusb は 2 以降と見なすことができますか?
または、デバイス ID を (スクリプト内で) マウント ポイントに関連付ける方法について別の提案がありますか?
Ubuntu 10.04 LTS を使用しています。