1

I have two USB devices which present them selves with the exact same information.

root@nordlys:/$ dmesg

[27428.655362] usb 1-2: new full-speed USB device number 18 using xhci_hcd
[27428.678006] usb 1-2: New USB device found, idVendor=09d8, idProduct=0320
[27428.678013] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[27428.678017] usb 1-2: Product: RFID Device (COM)
[27428.678020] usb 1-2: Manufacturer: OEM
....
....
[27428.751580] usb 3-1.2: new full-speed USB device number 16 using ehci_hcd
[27428.850532] usb 3-1.2: New USB device found, idVendor=09d8, idProduct=0320
[27428.850539] usb 3-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[27428.850544] usb 3-1.2: Product: RFID Device (COM)
[27428.850547] usb 3-1.2: Manufacturer: OEM

I tried finding differences by comparing the two using root@nordlys:/$ lsusb -v. Also here they are exactly the same.

I need the ability to know with certainty which of the two devices I am communicating with. So far the only things I can think of is to connect the devices in a certain sequence or connect the devices in specific USB ports on the computer. I find these two to be bad solutions and am wondering if any of you know other ways to distinguish USB devices?

A third solution which I find best so far is to communicate with the devices and try to find differences there that can uniquely identify them.

Added at a later time: I see that one device is USB2 while the other is USB3, meaning they use eHCI and xHCI. Is it possible to make UDEV see the difference and make persistent symlinks in /dev depending on this?

Mogget
  • 1,353

1 Answers1

1

You should try to use their UUID

A universally unique identifier (UUID) is an identifier standard used in software construction. A UUID is simply a 128-bit value. The meaning of each bit is defined by any of several variants.

With the command blkid

sudo blkid -sUUID

you will print the list block device attributes with the UUID e.g.

...
/dev/sdc1: UUID="F414C7DD74B7FFAA" 
...

then you can chose to write a line on the /etc/fstab file

UUID={YOUR-UID} {/path/to/mount/point} {file-system-type} defaults,errors=remount-ro 0 1

it should seems like

UUID=F414C7DD74B7FFAA /where/you/want/ ntfs-3g defaults,auto,umask=000,users,rw 0 0

or to follow a procedure sketched in other answers (Use UUID in udev rules and mount usb drive on /media/$UUID or this answer to Linux flash drives , ... )

References

Hastur
  • 19,483
  • 9
  • 55
  • 99