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

Eureka! Re: udev rules help with usb>serial adapters +attach



Oh my oh my, it works!

Thanks to both for chiming in.  I finally did copy/paste and then
started searching for strings and pasting them in.  As the sun sets on
the pacific rim of the USA, my udev rule file finally makes the devices!

Also, I failed to mention the other pages I have been using:
https://inegm.medium.com/persistent-names-for-usb-serial-devices-in-linux-dev-ttyusbx-dev-custom-name-fd49b5db9af1

https://www.min.at/prinz/?x=entry:entry210910-114849

https://www.rigacci.org/wiki/doku.php/doc/appunti/linux/sa/renaming_usb_devices

http://reactivated.net/writing_udev_rules.html

Finger will be crossed when I move the new mini PC into the shack and
copy over the files.

One small step . . .

Thank you so much, 73

Jaye ke6sls

On 11/19/24 11:15 PM, MJ Inabnit wrote:
> 
> Hello Dave MM0RFN & John AC6SL
> 
> Thank you so much for chiming in.
> 
> I will admit much of this is beyond my understanding.  However, I'm
> going to add the output files from this end.
> 
> As you can see, the rule for my Kenwood radio port works perfectly.  Yet
> every iteration I've tried for the dual port has failed.
> 
> I have difficulty trying to understand this syntax, or really
> understanding it.  Bugger.  But I have to be close.  Since I posted my
> first message, the new "Bmax Mini PC B3" has arrived!  So I really need
> to dial this in so I can port it to the replacement computer.
> 
> I had to reboot the computer several times during power outages. So
> understand that some commands might look at one port then another port
> for same device.  The devices change places each boot.  The glory is at
> least my Kenwood now stays working!
> 
> I'll need both ports of the dual port USB>serial cable; one for my aprs
> Igate, the other for my packet.
> 
> If either of you can cobble a rule for this adapter, I'm MORE THAN
> WILLING to try it!
> 
> Thank you!  73
> 
> Jaye ke6sls
> 
> On 11/7/24 4:13 PM, Dave Hibberd wrote:
>> 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
>>
> 
> 


-- 

wishing you well
Jaye, ke6sls--via the toshiba w/thunderchicken
#name ports at boot so ports don't change 21Nov2024
#
SUBSYSTEM=="tty", ATTRS{product}=="CP2102 USB to UART Bridge Controller", ATTRS{serial}=="05670043DF4A", SYMLINK+="ts590"
#
#dual port usb>serial adapter
SUBSYSTEMS=="usb", ENV{.LOCAL_ifNum}="$attr{bInterfaceNumber}"
SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{serial}=="FTWHB159", ENV{.LOCAL_ifNum}=="00",  SYMLINK+="APRS", GROUP="dialout", MODE="0660"
SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{serial}=="FTWHB159", ENV{.LOCAL_ifNum}=="01",  SYMLINK+="PACKET", GROUP="dialout", MODE="0660"

jaye@ham:/dev$ ls -al ttyUSB* 
crw-rw---- 1 root dialout 188, 0 Nov 21 16:27 ttyUSB0
crw-rw---- 1 root dialout 188, 1 Nov 21 16:27 ttyUSB1
crw-rw---- 1 root dialout 188, 2 Nov 21 16:27 ttyUSB2
jaye@ham:/dev$ ls -al APRS PACKET ts590 
lrwxrwxrwx 1 root root 7 Nov 21 16:27 APRS -> ttyUSB0
lrwxrwxrwx 1 root root 7 Nov 21 16:27 PACKET -> ttyUSB1
lrwxrwxrwx 1 root root 7 Nov 21 16:27 ts590 -> ttyUSB2


Reply to: