Re: Linux scanning USB at boot, assign /dev/ttyUSB labels


Chuck M
 

On my pi it uses a longer text string to find the radio regardless of USB assignment.  

Mobile now, will post details later today.

Chuck
KD9DVB



On Sat, Jun 6, 2020 at 10:48 AM, Tadd KA2DEW in NC via groups.io
<tadd@...> wrote:
When I start my Raspberry PI’s Linux it scans the USB bus and finds FTDI chips.  It assigns them sequential /dev/ttyUSB port numbers in order starting at 0 and based on some port-hardware-use-order.  I think if I swap two FTDI devices between two USB sockets on the Raspberry PI that it will also swap the ttyUSB number it assigns, the next time Linux boots.  I’m not sure of that.  

What I’d like to know first is, is there a way to tell the Raspberry PI to rescan the bus, assigning the ports in order again?   

The scenario is that I have several FTDI devices and they are showing as /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2.   I figure out along the way that the unit on /dev/ttyUSB0 is not needed or defective in some non-USB way so I unplug it.  I want to configure my application so it sees the remaining two USB devices.  Since I know the devices will get new numbers, probably USB0 and USB1 when the PI resets, I want to configure the app appropriate.   It would be really handy if I could get the Raspberry PI to rescan immediately, without having to bring down Linux.  

Second question… is there a description of the Raspbian Buster scheme for scanning the USB bus and assigning the ttyUSB #s? i.e. can I predict the order it will assign?  What if there is a USB hub carrying one or more of the FTDi devices. 

Third question… It would be handy to have a table associating USB chip vendors with the ttyXXXX port numbers.  I have a Microchip MCP2221 USB/serial interface and it gets a /dev/ttyACM0 assignment.  Is there a vendor to port-name association table for Linux?  Is it a Linux-specific thing? Or does it work with BSD-Unix and/or MSWindows as well? 

Fourth question…. Is there a way to force the USB assignment in a particular order based on some universal labelling technique? I found that I can obtain a serial # from genuine FTDI chips and use that to create my own ordering table.  Thanks Erech!  But it doesn’t work if the chips are fake-FTDI, and the scheme has to be completely different for the MCP2221 ports, if it is possible at all.  


Thanks for any help.
   Tadd - KA2DEW - Raleigh NC - tadd@...




Join RaspberryPi-4-HamRadio@groups.io to automatically receive all group messages.