gogoer Posted April 29, 2021 Posted April 29, 2021 Hello. I have orange pi system with 3 USB-UART converters. After system boot i can find them in /dev as /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2. But after system reboot converters can be not at same positions. Is there any way to make first converter /dev/ttyUSB0, second /dev/ttyUSB1 etc. ?
arox Posted April 29, 2021 Posted April 29, 2021 Good question ! The name depends not only on boot but also change if you plug / unplug devices ... I have the same problem when I try to work with 2 micro-controllers at the same time. This can certainly be done with an "udev rule". There is some response here : https://www.domoticz.com/wiki/PersistentUSBDevices In section : filtering by "devpath" : SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", ATTRS{devpath}=="1.2", SYMLINK+="ttyUSB-arduino1" SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", ATTRS{devpath}=="1.5", SYMLINK+="ttyUSB-arduino2" The solution will depend on usage and usb hub configuration. And writing and debugging udev rules is not easy.
gogoer Posted April 30, 2021 Author Posted April 30, 2021 thank you for your answer!!! my problem that uart adapters are the same! they are totally identical, their serial numbers are the same) is there any way to resolv this issue?? or it better to you different adapters and write rules as you advised?
tparys Posted April 30, 2021 Posted April 30, 2021 Would a USB to quad serial adapter work? Those tend to be consistent boot-to-boot. https://www.amazon.com/dp/B08P24ZQ1B/
arox Posted May 1, 2021 Posted May 1, 2021 22 hours ago, gogoer said: thank you for your answer!!! my problem that uart adapters are the same! they are totally identical, their serial numbers are the same) is there any way to resolv this issue?? or it better to you different adapters and write rules as you advised? The method "filtering by devpath" I have indicated before is targeted at providing a solution in that case. The match is done for a type of (identical) devices (same idVendor/idProduct) and the device name chosen according to the index of USB port.
lanefu Posted May 1, 2021 Posted May 1, 2021 2 hours ago, arox said: The method "filtering by devpath" I have indicated before is targeted at providing a solution in that case. The match is done for a type of (identical) devices (same idVendor/idProduct) and the device name chosen according to the index of USB port. This is great! I had a similar problem to solve
arox Posted May 1, 2021 Posted May 1, 2021 3 hours ago, lanefu said: This is great! I had a similar problem to solve I would like DT overlay could handle that sort of thing. (I may suggest here something completely stupid because I know nothing about DT). Using an overkilled dynamic system configuration system like udev to make a static configuration is somewhere strange ...
lanefu Posted May 1, 2021 Posted May 1, 2021 9 minutes ago, arox said: Using an overkilled dynamic system configuration system like udev to make a static configuration is somewhere strange .. I think udev is appropriate.. its a situation that could just as easily be needed on a x86 machine w/o device tree to enforce enumeration
Recommended Posts