[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: udev rules help with usb>serial adapters



Hi Jaye,

On Thursday, 7 November 2024 22:56:52 GMT MJ Inabnit wrote:
> I am going to retire an old thinkpad with a real serial port.  Found
> some good how-to about writing a udev rule to id and make new device for
> usb to serial adapters.  One rule works great for my TS-590sg, but my
> second adapter (which has two serial ports) rule isn't working.
>

We have been doing similar in my online club - sadly it's 2 TNCs with onboard 
USB/Serial devices not 2 ports on one adaptor. I do have one of those *and* a 
radio that enumerates as 2 serial ports attached just now, so that'll maybe 
help to point you in the right direction!

> Is there anyone here able to assist.  If not, perhaps someone can point
> out where I might get some assistance?  Googled for weeks and not
> finding the key to my rule.

We've been using serial numbers to modify the symlink so the ports have their 
service name on them, see the first part of the linux notes:
https://wiki.oarc.uk/packet:ninotnc?s[]=udev#misc_linux_notes

How is the device enumerating currently - I assume it's connecting and 
presenting new ports in `/dev` ? 

What about somewhere like `/dev/serial/by-id`?
If I look in my raspi's /dev/serial/by-id, I see what is in the attached text 
file. 

Reading `udevadm info -a /dev/ttyUSB0` and `udevadm info -a /dev/tty/USB1` has 
pointed me to ATTRS{bInterfaceNumber}=="00" - I wonder if there is a way to 
combine that, the serial number of the adaptor ATTRS{serial} to create 
different devices.

There was also a hint of this approach here, where the two serial ports showed 
different serial numbers and that was used to give then pretty names: 
https://wiki.oarc.uk/persistent_sound_interface?
s[]=udev#transceiver_device_names 

Hopefully that's enough of a starter for you to break the deadlock! If not, 
feel free to reach out again. 

Cheers,
--  
  Hibby <hibby@debian.org>
  Debian Developer
  Packet Radioist
  MM0RFN
hibby@rpi4-20240904:~$ ls -al /dev/serial/by-id/
total 0
drwxr-xr-x 2 root root 100 Sep 14 23:00 .
drwxr-xr-x 4 root root  80 Aug 25 17:35 ..
lrwxrwxrwx 1 root root  13 Sep 14 23:00 usb-Microchip_Technology_Inc._MCP2221_USB-I2C_UART_Combo-if00 -> ../../ttyACM1
lrwxrwxrwx 1 root root  13 Sep 14 23:00 usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_00BC83E4-if00-port0 -> ../../ttyUSB0
lrwxrwxrwx 1 root root  13 Sep 14 23:00 usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_00BC83E4-if01-port0 -> ../../ttyUSB1

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: