{ "version": "https://jsonfeed.org/version/1.1", "user_comment": "This feed allows you to read the posts from this site in any feed reader that supports the JSON Feed format. To add this feed to your reader, copy the following URL -- https://matoken.org/blog/tag/lsusb/feed/json/ -- and add it your reader.", "home_page_url": "https://matoken.org/blog/tag/lsusb/", "feed_url": "https://matoken.org/blog/tag/lsusb/feed/json/", "language": "ja", "title": "lsusb – matoken's blog", "description": "Is there no plan B?", "icon": "https://matoken.org/blog/wp-content/uploads/2025/03/cropped-1865f695c4eecc844385acef2f078255036adccd42c254580ea3844543ab56d9.jpeg", "items": [ { "id": "https://matoken.org/blog/?p=3798", "url": "https://matoken.org/blog/2023/01/07/try-cyme-like-a-modern-lsusb/", "title": "\u30e2\u30c0\u30f3\u306alsusb\u306e\u3088\u3046\u306acyme\u3092\u5c11\u3057\u8a66\u3059", "content_html": "
rust\u88fd\u306e\u30e2\u30c0\u30f3\u306alsusb\u7684\u306acyme\u3068\u3044\u3046\u3082\u306e\u3092\u898b\u304b\u3051\u305f\u306e\u3067\u5c11\u3057\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\uff0e
\ncyme\u306flsusb\u3068\u3082\u4e92\u63db\u6027\u304c\u6709\u308a\uff0cLinux/Windows/macOS\u3067\u52d5\u4f5c\u3059\u308b\u3088\u3046\u3067\u3059\uff0e
\n
$ sudo apt install cargo libudev-dev\n$ cargo install cyme\n$ export PATH=/home/matoken/.cargo/bin:$PATH\n
$ cyme -h\nList system USB buses and devices; a modern and compatible `lsusb`\n\nUsage: cyme [OPTIONS]\n\nOptions:\n -l, --lsusb\n Attempt to maintain compatibility with lsusb output\n -t, --tree\n Dump USB device hierarchy as a tree\n -d, --vidpid <VIDPID>\n Show only devices with the specified vendor and product ID numbers (in hexadecimal) in format VID:[PID]\n -s, --show <SHOW>\n Show only devices with specified device and/or bus numbers (in decimal) in format [[bus]:][devnum]\n -D, --device <DEVICE>\n Selects which device lsusb will examine - supplied as Linux /dev/bus/usb/BBB/DDD style path\n --filter-name <FILTER_NAME>\n Filter on string contained in name\n --filter-serial <FILTER_SERIAL>\n Filter on string contained in serial\n --filter-class <FILTER_CLASS>\n Filter on USB class code [possible values: use-interface-descriptor, audio, cdc-communications, hid, physical, image, printer, mass-storage, hub, cdc-data, smart-cart, content-security, video, personal-healthcare, audio-video, billboard, usb-type-c-bridge, i3c-device, diagnostic, wireless-controller, miscellaneous, application-specific-interface, vendor-specific-class]\n -v, --verbose...\n Verbosity level: 1 prints device configurations; 2 prints interfaces; 3 prints interface endpoints; 4 prints everything and all blocks\n -b, --blocks <BLOCKS>\n Specify the blocks which will be displayed for each device and in what order [possible values: bus-number, device-number, branch-position, port-path, sys-path, driver, icon, vendor-id, product-id, name, manufacturer, product-name, vendor-name, serial, speed, tree-positions, bus-power, bus-power-used, extra-current-used, bcd-device, bcd-usb, class-code, sub-class, protocol]\n --bus-blocks <BUS_BLOCKS>\n Specify the blocks which will be displayed for each bus and in what order [possible values: bus-number, icon, name, host-controller, pci-vendor, pci-device, pci-revision, port-path]\n --config-blocks <CONFIG_BLOCKS>\n Specify the blocks which will be displayed for each configuration and in what order [possible values: name, number, num-interfaces, attributes, icon-attributes, max-power]\n --interface-blocks <INTERFACE_BLOCKS>\n Specify the blocks which will be displayed for each interface and in what order [possible values: name, number, port-path, class-code, sub-class, protocol, alt-setting, driver, sys-path, num-endpoints, icon]\n --endpoint-blocks <ENDPOINT_BLOCKS>\n Specify the blocks which will be displayed for each endpoint and in what order [possible values: number, direction, transfer-type, sync-type, usage-type, max-packet-size, interval]\n -m, --more\n Print more blocks by default at each verbosity\n --sort-devices <SORT_DEVICES>\n Sort devices by value [possible values: branch-position, device-number, no-sort]\n --sort-buses\n Sort devices by bus number\n --group-devices <GROUP_DEVICES>\n Group devices by value when listing [default: no-group] [possible values: no-group, bus]\n --hide-buses\n Hide empty buses when printing tree; those with no devices. When listing will hide Linux root_hubs\n --hide-hubs\n Hide empty hubs when printing tree; those with no devices. When listing will hide hubs regardless of whether empty of not\n --decimal\n Show base16 values as base10 decimal instead\n --no-padding\n Disable padding to align blocks\n --no-colour\n Disable coloured output, can also use NO_COLOR environment variable\n --ascii\n Disables icons and utf-8 charactors\n --headings\n Show block headings\n --json\n Output as json format after sorting, filters and tree settings are applied; without -tree will be flattened dump of devices\n --from-json <FROM_JSON>\n Read from json output rather than profiling system - must use --tree json dump\n -F, --force-libusb\n Force libusb profiler on macOS rather than using/combining system_profiler output\n -c, --config <CONFIG>\n Path to user config file to use for custom icons, colours and default settings\n -z, --debug...\n Turn debugging information on. Alternatively can use RUST_LOG env: INFO, DEBUG, TRACE\n --mask-serials <MASK_SERIALS>\n Mask serial numbers with '*' or random chars [possible values: hide, scramble, replace]\n -h, --help\n Print help information (use `--help` for more detail)\n -V, --version\n Print version information\n
$ cyme\nFailed to open Bus 002 Device 001: ID 1d6b:0003, will be unable to obtain all data: Access denied (insufficient permissions)\nFailed to open Bus 001 Device 003: ID 8087:0a2b, will be unable to obtain all data: Access denied (insufficient permissions)\nFailed to open Bus 001 Device 002: ID 5986:054c, will be unable to obtain all data: Access denied (insufficient permissions)\nFailed to open Bus 001 Device 004: ID 17ef:6047, will be unable to obtain all data: Access denied (insufficient permissions)\nFailed to open Bus 001 Device 001: ID 1d6b:0002, will be unable to obtain all data: Access denied (insufficient permissions)\n 1 3 \uf287 0x8087 0x0a2b Bluetooth wireless interface 12.0 Mb/s\n 1 2 \uf287 0x5986 0x054c 480.0 Mb/s\n 1 4 \uf287 0x17ef 0x6047 ThinkPad Compact Keyboard with TrackPoint 12.0 Mb/s\n 1 1 \uf17c 0x1d6b 0x0002 2.0 root hub 480.0 Mb/s\n 2 1 \uf17c 0x1d6b 0x0003 3.0 root hub 5.0 Gb/s\n
$ sudo ~/.cargo/bin/cyme\n 1 3 \uf287 0x8087 0x0a2b Bluetooth wireless interface 12.0 Mb/s\n 1 2 \uf287 0x5986 0x054c USB HD Webcam 200901010001 480.0 Mb/s\n 1 4 \uf287 0x17ef 0x6047 ThinkPad Compact USB Keyboard with TrackPoint 12.0 Mb/s\n 1 1 \uf17c 0x1d6b 0x0002 xHCI Host Controller 0000:00:14.0 480.0 Mb/s\n 2 1 \uf17c 0x1d6b 0x0003 xHCI Host Controller 0000:00:14.0 5.0 Gb/s\n
$ cyme --lsusb\nFailed to open Bus 002 Device 001: ID 1d6b:0003, will be unable to obtain all data: Access denied (insufficient permissions)\nFailed to open Bus 001 Device 003: ID 8087:0a2b, will be unable to obtain all data: Access denied (insufficient permissions)\nFailed to open Bus 001 Device 002: ID 5986:054c, will be unable to obtain all data: Access denied (insufficient permissions)\nFailed to open Bus 001 Device 004: ID 17ef:6047, will be unable to obtain all data: Access denied (insufficient permissions)\nFailed to open Bus 001 Device 001: ID 1d6b:0002, will be unable to obtain all data: Access denied (insufficient permissions)\nBus 001 Device 003: ID 8087:0a2b Intel Corp. Bluetooth wireless interface\nBus 001 Device 002: ID 5986:054c Acer, Inc\nBus 001 Device 004: ID 17ef:6047 Lenovo ThinkPad Compact Keyboard with TrackPoint\nBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\nBus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub\n
--ascii \u30aa\u30d7\u30b7\u30e7\u30f3\u3092$ sudo ~/.cargo/bin/cyme --tree --ascii\n/: xHCI Host Controller Linux 6.0.0-6-amd64 xhci-hcd\n|__O 4 0x17ef 0x6047 ThinkPad Compact USB Keyboard with TrackPoint\n|__O 2 0x5986 0x054c USB HD Webcam 200901010001\n|__O 3 0x8087 0x0a2b Bluetooth wireless interface\n\n/: xHCI Host Controller Linux 6.0.0-6-amd64 xhci-hcd\n
--verbose \u306f4\u3064\u307e\u3067\u52b9\u304f\u3088\u3046$ sudo ~/.cargo/bin/cyme --ascii --vidpid 0x17ef:0x6047 --verbose --verbose --verbose | wc\n 6 39 271\n$ sudo ~/.cargo/bin/cyme --ascii --vidpid 0x17ef:0x6047 --verbose --verbose --verbose --verbose | wc\n 6 56 389\n$ sudo ~/.cargo/bin/cyme --ascii --vidpid 0x17ef:0x6047 --verbose --verbose --verbose --verbose --verbose | wc\n 6 56 389\n
$ sudo ~/.cargo/bin/cyme --ascii --filter-name cam (1)\n 1 2 0x5986 0x054c USB HD Webcam 200901010001 480.0 Mb/s\n$ sudo ~/.cargo/bin/cyme --ascii --filter-class hid (2)\n$ sudo ~/.cargo/bin/cyme --ascii --filter-serial 14 (3)\n 1 1 0x1d6b 0x0002 xHCI Host Controller 0000:00:14.0 480.0 Mb/s\n 2 1 0x1d6b 0x0003 xHCI Host Controller 0000:00:14.0 5.0 Gb/s\n$ sudo ~/.cargo/bin/cyme --ascii --vidpid 0x17ef:0x6047 (4)\n 1 4 0x17ef 0x6047 ThinkPad Compact USB Keyboard with TrackPoint 12.0 Mb/s\n
sudo lsusb -d 17ef:6047 -vvv \u306e\u4ee3\u308f\u308a?$ sudo ~/.cargo/bin/cyme --ascii --vidpid 0x17ef:0x6047 --verbose --verbose --verbose --verbose --lsusb | head\n\nBus 001 Device 004: ID 17ef:6047 Lenovo ThinkPad Compact Keyboard with TrackPoint\nDevice Descriptor:\n bcdUSB 2.00\n bDeviceClass 0 UseInterfaceDescriptor\n bDeviceSubClass 0\n bDeviceProtocol 0\n bMaxPacketSize0 8\n idVendor 0x17ef Lenovo\n idProduct 0x6047 ThinkPad Compact Keyboard with TrackPoint\n
$ cargo uninstall cyme\n Removing /home/matoken/.cargo/bin/cyme\n
lsusb\u3067\u305d\u3046\u56f0\u3063\u3066\u3044\u307e\u305b\u3093\u304c\uff0ccyme\u306flsusb\u3068\u4e92\u63db\u6027\u304c\u3042\u308b\u3057\u898b\u305f\u76ee\u3082\u4eca\u3069\u304d\u306a\u611f\u3058\u306a\u306e\u3067\u826f\u3055\u305d\u3046\u3067\u3059\uff0e\u305f\u3060\u81ea\u5206\u3067\u5165\u308c\u3066\u307e\u3067\u4f7f\u3046\u304b\u3068\u3044\u3046\u3068\u5fae\u5999\uff0e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u5165\u3063\u305f\u3089\u4f7f\u3046\u304b\u3082\u3068\u3044\u3046\u611f\u3058\u3067\u3057\u3087\u3046\u304b\uff0e
\n$ cyme --version\ncyme 1.2.1\n$ dpkg-query -W cargo libudev-dev\ncargo 0.63.1-3\nlibudev-dev:amd64 252.4-1\n$ lsb_release -a\nDistributor ID: Debian\nDescription: Debian GNU/Linux bookworm/sid\nRelease: n/a\nCodename: bookworm\n$ arch\nx86_64\n