Udev does not capture information (number of missing attributes) for usb device

I have two systems, one of which runs Ubutu 14.04, one that works with raspbian. When I connect a USB printer to my Ubuntu machine, I can get a lot of information about udevadm:

:~$ udevadm info -q property --export -n /dev/usb/lp2 DEVNAME='/dev/usb/lp2' DEVPATH='/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2.1/3-2.1.1/3-2.1.1:1.0/usbmisc/lp2' ID_BUS='usb' ID_MODEL='DYMO_LabelWriter_450' ID_MODEL_ENC='DYMO\x20LabelWriter\x20450' ID_MODEL_ID='0020' ID_REVISION='0112' ID_SERIAL='DYMO_DYMO_LabelWriter_450_09041413125694' ID_SERIAL_SHORT='09041413125694' ID_TYPE='printer' ID_USB_DRIVER='usblp' ID_USB_INTERFACES=':070102:' ID_USB_INTERFACE_NUM='00' ID_VENDOR='DYMO' ID_VENDOR_ENC='DYMO' ID_VENDOR_ID='0922' MAJOR='180' MINOR='2' SUBSYSTEM='usbmisc' USEC_INITIALIZED='873171356' 

But when I do the same command on another system (raspbian), I get almost no information:

 :~$ udevadm info -q property --export -n /dev/usb/lp0 DEVNAME='usb/lp0' DEVPATH='/devices/platform/bcm2708_usb/usb1/1-1/1-1.4/1-1.4:1.0/usbmisc/lp0' MAJOR='180' MINOR='0' SUBSYSTEM='usbmisc' UDEV_LOG='3' 

On the second (raspbian) system, I can see information in the syslog about the device when I connect it:

 Jun 3 17:24:06 raspberryPi kernel: [ 2517.897717] usb 1-1.4: new full-speed USB device number 9 using dwc_otg Jun 3 17:24:06 raspberryPi kernel: [ 2518.001031] usb 1-1.4: New USB device found, idVendor=0922, idProduct=0020 Jun 3 17:24:06 raspberryPi kernel: [ 2518.001049] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Jun 3 17:24:06 raspberryPi kernel: [ 2518.001061] usb 1-1.4: Product: DYMO LabelWriter 450 Jun 3 17:24:06 raspberryPi kernel: [ 2518.001072] usb 1-1.4: Manufacturer: DYMO Jun 3 17:24:06 raspberryPi kernel: [ 2518.001083] usb 1-1.4: SerialNumber: 12092215544125 Jun 3 17:24:06 raspberryPi kernel: [ 2518.003113] usblp 1-1.4:1.0: usblp0: USB Bidirectional printer dev 9 if 0 alt 0 proto 2 vid 0x0922 pid 0x0020 

Given that udev does not report anything useful (no serial number, provider, type, etc.), it would seem impossible to write udev rules in raspbian.

I am also trying lsusb to get device information, but:

 :~$ sudo lsusb -D /dev/usb/lp0 Cannot open /dev/usb/lp0 

However, lsusb -v provides some information that I would expect (along with a bunch of information that I do not need for other devices):

 :~$ lsusb -v .... Bus 001 Device 008: ID 0922:0020 Dymo-CoStar Corp. LabelWriter 450 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x0922 Dymo-CoStar Corp. idProduct 0x0020 LabelWriter 450 bcdDevice 1.12 iManufacturer 1 DYMO iProduct 2 DYMO LabelWriter 450 iSerial 3 14040809283557 .... 

So, I know that the information is available, but not udev. Any ideas on how to make this information available to udev?

EDIT I tried the same command on a new installation of Ubuntu 14.04 and reports the same short list of information as the raspbian device. So, this tells me that something interesting happens in the first field of Ubuntu 14.04, which does not happen on other devices.

+6
source share

Source: https://habr.com/ru/post/988468/


All Articles