简体   繁体   中英

How to match usb device listed with lsusb with usb serial number displayed with dmesg?

I have a setup here with a lot of USB devices connected this is my lsusb output:

Bus 003 Device 013: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 003 Device 014: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 003 Device 011: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 003 Device 015: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 003 Device 009: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 003 Device 016: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 003 Device 017: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 003 Device 018: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 003 Device 008: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 003 Device 006: ID 08bb:29c6 Texas Instruments PCM2906C Audio CODEC
Bus 003 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 003 Device 002: ID 0424:2517 Standard Microsystems Corp. Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 013: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 001 Device 014: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 001 Device 015: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 001 Device 012: ID 04b4:00f8 Cypress Semiconductor Corp. 
Bus 001 Device 010: ID 04b4:00f3 Cypress Semiconductor Corp. 
Bus 001 Device 016: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 001 Device 017: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 001 Device 004: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 005: ID 8087:0aaa Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

as you can see there are multiple of the same devices and multiple hubs with the same vendor id and all. I am monitoring these with Wireshark (tshark actually) and I get some errors like this:

293549  43.514117       3.17.1 → host         USB 66 URB_BULK in[Malformed Packet]

However, I can't physically identify which device it is without the device's serial number.

I can see this serial number on dmesg

[Wed Feb 17 16:03:29 2021] usb 1-3.2.1: New USB device found, idVendor=16c0, idProduct=05dc
[Wed Feb 17 16:03:29 2021] usb 1-3.2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Wed Feb 17 16:03:29 2021] usb 1-3.2.1: Product: USB BDC
[Wed Feb 17 16:03:29 2021] usb 1-3.2.1: Manufacturer: www.engineeredarts.co.uk
[Wed Feb 17 16:03:29 2021] usb 1-3.2.1: SerialNumber: 345B34673238

My question is: How can I match these two things? or at least, how can I get that same 'SerialNumber' that dmesg displays, of the numbers I get from tshark?

(resetting each device to see which one is which while watching dmesg and lsusb isn't an option)

Got it! Turns out you can see the serial with sudo lsusb -v . It has to be run as root otherwise the files will be empty, then to clean all the useless info did a quick grep like so:

lsusb -v | grep '^Bus\|iSerial'

This is grepping 2 results (separated by \| which is the OR operator), first one are stuff that start(^) with the word Bus and the second one is that it contains the word serial

also stumbled across another command that I didn't know about:

usb-devices

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM