Re: USB not assining port number

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



On Tue, 2020-05-05 at 13:31 +0100, pete via arch-general wrote:
> On Tue, 5 May 2020 13:13:52 +0200
> Damjan Georgievski via arch-general <arch-general@xxxxxxxxxxxxx>
> wrote:
> 
> > >  but no USB port given
> > > 
> > > lsusb gives
> > > Bus 002 Device 011: ID 1781:0c9f Multiple Vendors USBtiny
> > 
> > what is this "usb port" that you expect?
> > 
> > USBtiny is a HID device as far as I can remember.
> > 
> 
> Well i was expecting something like /dev/ttyusb2 or some other such
> device for
> the programmer to pick up 
> this is the sort of thing i was expecting 
> 
> [ 9290.292465] usb 7-1: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [ 9290.292469] usb 7-1: Product: CP2102 USB to UART Bridge Controller
> [ 9290.292471] usb 7-1: Manufacturer: Silicon Labs
> [ 9290.292474] usb 7-1: SerialNumber: 0001
> [ 9290.348975] usbcore: registered new interface driver cp210x
> [ 9290.349003] usbserial: USB Serial support registered for cp210x
> [ 9290.349090] cp210x 7-1:1.0: cp210x converter detected
> [ 9290.359683] usb 7-1: cp210x converter now attached to ttyUSB1
>                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> an actual usb  list to tell the programmes to connet to the device on
> 
> 
> 
> Pete .

lsusb does not give you this information. If it is just a HID device as
Damjan hinted it will not show up as ttyUSB* anyway. Perhaps it exposes
a serial interface, in this case a tty device node would be exposed.

Assuming the device does indeed expose a serial interface, I suggest
you write a udev rule that will just rename the device node. This means
when you plug it in it will not show up ad ttyUSB* or whatever, it
will always show up as ttyMyCustomDevice, which will in turn make it
easier for you to identify it.

Something like this would work (/etc/udev/rules.d/99-my-custom-
device.rules):

SUBSYSTEM=="tty", ATTRS{idVendor}=="1781", ATTRS{idProduct}=="1781", ATTRS{serial}=="XXXX", SYMLINK+="ttyMyCustomDevice"

If you will only have one of those plugged in you can remove the serial
field, if not you will need to figure out wich ttyUSB/ACM* device is it
and the run:

udevadm info -a /dev/ttyUSB* | grep serial

And filling out the serial field in the rule.

Cheers,
Filipe Laíns

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


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux