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


 

Hmm.. the Microchip parts don’t seem to follow the rules. 

This is what I get when I do ls -lrats in /dev
[snip]
0 drwxrwxrwt   2 root root          40 May 31 07:13 shm
0 crw-rw----   1 root dialout 166,   0 Jun  6 18:14 ttyACM0
0 crw-rw----   1 root dialout 188,   0 Jun  6 18:14 ttyUSB0
0 crw-rw----   1 root dialout 166,   1 Jun  6 18:14 ttyACM1
0 crw-rw-rw-   1 root tty       5,   2 Jun  6 18:16 ptmx
pi@taddnode:/dev $ 

Then here is what I get in /dev/serial/by-id
pi@taddnode:/dev/serial/by-id $ ls -lrats
total 0
0 drwxr-xr-x 4 root root 80 May 31 06:17 ..
0 lrwxrwxrwx 1 root root 13 May 31 06:17 usb-Microchip_Technology_Inc._MCP2221_USB-I2C_UART_Combo-if00 -> ../../ttyACM0
0 lrwxrwxrwx 1 root root 13 May 31 06:17 usb-FTDI_UMFT234XF_FT0O47N0-if00-port0 -> ../../ttyUSB0
0 drwxr-xr-x 2 root root 80 May 31 06:17 .
pi@taddnode:/dev/serial/by-id $ 

Only one of the ttyACM ports is showing in by-id.  Is this because they can’t be distinguished from one another?  


Tadd Torborg 




On Jun 6, 2020, at 6:07 PM, Chuck M via groups.io <cam51mail@...> wrote:

Here's what I mentioned earlier today and the udev rules (need to check those myself)
Info from using command dmesg:
****
usb 1-1.3: Product: CQXIEGUirtual COM Port
usb 1-1.3: Manufacturer: CQXiEGULinzhian
usb 1-1.3: SerialNumber: 48F5673D3234

***
string used in flrig for serial port to radio:
***
/dev/serial/by-id/usb-CQXiEGULinzhian_CQXIEGUirtual_COM_Port_48F5673D3234-if00
***
The usb 1-1.nnnn can change depending on how I have stuff connected.  the string above finds it anyway.  Assuming the "-if00" after serial number is something required by the udev rules.

Hope this example helps.

Chuck
KD9DVB

On Saturday, June 6, 2020, 03:07:36 PM EDT, David Birnbaum <dbirnbau@...> wrote:


What you want is to write udev rules. There's stuff online that shows how to do it; you need two numbers for each device.  Your printout has these: MODEL_ID and VENDOR_ID.  These two hex numbers go into the udev rule which will then always assign a name of your choice for the device regardless of where it's plugged in or in what order.

dave
k2lyv

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