• Re: udev rules help with usb>serial adapters

    From David Ranch@21:1/5 to MJ Inabnit on Fri Nov 8 01:40:01 2024
    This is a multi-part message in MIME format.
    Hello MJ, I can help. Here is something I wrote up a long time ago that
    works well for me:

    https://www.trinityos.com/HAM/CentosDigitalModes/hampacketizing-centos.html#2c.kernelnavigatorudev

    If that doesn't work for you, please post your proposed udev rules in
    which file you're adding them to here and we can review.

    --David
    KI6ZHD


    On 11/07/2024 02:56 PM, 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.

    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.

    Tnx & 73

    Jaye ke6sls



    <html>
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <font size="-1">Hello MJ, I can help.  Here is something I wrote up
    a long time ago that works well for me:<br>
    <br>
      
    <a class="moz-txt-link-freetext" href="https://www.trinityos.com/HAM/CentosDigitalModes/hampacketizing-centos.html#2c.kernelnavigatorudev">https://www.trinityos.com/HAM/CentosDigitalModes/hampacketizing-centos.html#2c.kernelnavigatorudev</a><br>
    <br>
    If that doesn't work for you, please post your proposed udev rules
    in which file you're adding them to here and we can review.<br>
    <br>
    --David<br>
    KI6ZHD<br>
    <br>
    </font><br>
    <div class="moz-cite-prefix">On 11/07/2024 02:56 PM, MJ Inabnit
    wrote:<br>
    </div>
    <blockquote
    cite="mid:[email protected]"
    type="cite">
    <pre wrap="">
    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.

    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.

    Tnx &amp; 73

    Jaye ke6sls

    </pre>
    </blockquote>
    <br>
    </body>
    </html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Hibberd@21:1/5 to All on Fri Nov 8 00:13:38 2024
    Copy: [email protected]

    This is a multi-part message in MIME format.

    --nextPart46817657.fMDQidcC6G
    Content-Transfer-Encoding: 7Bit
    Content-Type: text/plain; charset="us-ascii"

    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 <[email protected]>
    Debian Developer
    Packet Radioist
    MM0RFN
    --nextPart46817657.fMDQidcC6G
    Content-Disposition: attachment; filename="dual-port-serial.txt" Content-Transfer-Encoding: 7Bit
    Content-Type: text/plain; charset="x-UTF_8J"; name="dual-port-serial.txt"

    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

    --nextPart46817657.fMDQidcC6G--

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCgAdFiEEXk9UUZPolpyKWbgKA6H7ehkEdxsFAmctV7IACgkQA6H7ehkE dxuI0QgAqFNx4gn1Ar3/KejZuosYw+abKM0EdM8s3ayShGsfIUVtVSeHPJzvWftA AMUK+AoBY5fzmUmpzZh7bYb62kEgGYSgRPdZCE+ELzOsz4gh9vZ3Z3l2AN+sioPm V7PVaTdPKDuX0PuzLJUhTqxaYmjonmgxhKNV3z+jSYF/G4+4qBQOUoodyZW4Das/ Y334Pj9Lhw6xeCM9+yBbBhcAqGaIXRUsmAtzS9b+WHYoNwVjKr7ttHPtRJq9I4C9 H1i9hbZ3K63+SwPnMrvMfaE23A2zrMwjtuJ8lJJC+fhvQsTcDCCRRKc9m0QNLVto MwgSqCz3IYKHcOImfJ4lEUd3c5c3zQ==
    =PFHN
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Nogatch@1:229/2 to All on Fri Nov 8 16:00:01 2024
    From: [email protected]

    Below is an excerpt from my /etc/udev/rules.d/90-ftdi.rules which
    works with an FTDI 4-port serial USB adapter.
    My thanks to Florian Wolters for documenting this method.

    -John AC6SL

    # FTDI quad USB/serial dongle
    # ref: https://www.florian-wolters.de/posts/udev-rules-for-quad-serial-adapter-ft-4232h/
    SUBSYSTEMS=="usb", ENV{.LOCAL_ifNum}="$attr{bInterfaceNumber}" SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{serial}=="FTWU1K85",
    ENV{.LOCAL_ifNum}=="00", SYMLINK+="k4", GROUP="plugdev", MODE="0666" SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{serial}=="FTWU1K85",
    ENV{.LOCAL_ifNum}=="01", SYMLINK+="kpa500", GROUP="plugdev",
    MODE="0666"
    SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{serial}=="FTWU1K85",
    ENV{.LOCAL_ifNum}=="02", SYMLINK+="kat500", GROUP="plugdev",
    MODE="0666"
    SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{serial}=="FTWU1K85",
    ENV{.LOCAL_ifNum}=="03", SYMLINK+="rc1", GROUP="plugdev", MODE="0666"

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)