Newbies may not find its output easy to understand, but it offers more in-depth information about USB devices. Virtual USB Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2. lsusb -v is a good command, however, it can work well for advanced users. usbutils-git/lsusb -version lsusb (usbutils) 006 sudo. usbutils-0.87/lsusb -version lsusb (usbutils) 0.87. Since all USB ports can be accessed via /dev/bus/usb//įor the ID generated, even if you unplug the device and reattach it. So finally, here are the results of calling of these versions of lsusb against the device (note, under Ubuntu sudo has to be used, otherwise a 'cannot read device status, Operation not permitted (1)' may be generated). If someone can please just tell that on what operating system he is using what USB Library and what version of PyUSB I think it will solve my problems. That's why I get Device (dev.filename) string empty. Second, I guess there was some UID of every USB device, or I should use both Vendor or Product id?ĮDIT: Apparently I have some setup issues, I think I am using wrong USB Library. Bad return status for module build on kernel: 5.15.11-arch2-1 (x8664) Consult /var/lib/dkms. I am assuming it is the /dev/ttyACM0 etc part. lsusb Bus 002 Device 003: ID 17e9:ff0b DisplayLink ASUSTEK MB169B+. The problem is I don't get desired output, will paste one example: įirst I don't get filename, it's most important to me. As hinted, you may find information using lsusb.However assuming you don't know how plug and play works on USB the 'why' lsusb is that every removable device, that you plug into the USB connector, signals to the system (amongst other information) identifiers for the vendor and product, respectively idVendor and idProduct, both of which you can see in lsusb output. Print " idProduct: %d (0x%04x)" % (dev.idProduct, dev.idProduct) To list all devices attached to USB use lsusb to list all devices attached to PCI use lspci. Print " idVendor: %d (0x%04x)" % (dev.idVendor, dev.idVendor)
#Lsusb status code
I want to get UID Device Name (ex: SonyEricsson W660), path to device (ex: /dev/ttyACM0)Īnd also what would be the best Parameter out of above info to be used as identifying the device whenever it's connected again? (UID?)ĪTM I have this code (using pyUSB) busses = usb.busses() How can we query connected USB devices info in Python?