Lsusb windows
Author: b | 2025-04-23
Cross-platform lsusb command. `cargo install lsusb` - tcr/rust-lsusb. Cross-platform lsusb command. `cargo install lsusb` - tcr/rust-lsusb. Skip to content. Navigation Menu Toggle
lsusb/lsusb at master jlhonora/lsusb - GitHub
O o /---o /---/---oo---/ \---\---o o \---o oCymeList system USB buses and devices. A modern cross-platform lsusb that attempts to maintain compatibility with, but also add new features. Profiles system USB buses and the devices on those buses, including full device descriptors.As a developer of embedded devices, I use a USB list tool on a frequent basis and developed this to cater to what I believe are the short comings of lsusb: verbose dump is mostly too verbose, tree doesn't contain useful data on the whole, it barely works on non-Linux platforms and modern terminals support features that make glancing through the data easier.The project started as a quick replacement for the barely working lsusb script and a Rust project to keep me up to date! Like most fun projects, it quickly experienced feature creep as I developed it into a cross-platform replacement for lsusb. It started as a macOS system_profiler parser, evolved to include a 'libusb' based profiler for reading full device descriptors and now defaults to a pure Rust profiler using nusb.It's not perfect as it started out as a Rust refresher but I had a lot of fun developing it and hope others will find it useful and can contribute. Reading around the lsusb source code, USB-IF and general USB information was also a good knowledge builder.The name comes from the technical term for the type of blossom on a Apple tree: cyme - it is Apple related and also looks like a USB device tree 😃🌸.FeaturesCompatible with lsusb using --lsusb argument. Supports all arguments including --verbose output - fully parsed device descriptors! Output is identical for use with no args (list), tree (excluding drivers on non-Linux) and should match for verbose (perhaps formatting differences).Default build is a native Rust profiler using nusb.Filters like lsusb but that also work when printing --tree. Adds --filter-name, --filter-serial, --filter-class and option to hide empty --hide-buses/--hide-hubs.Improved --tree mode; shows device, configurations, interfaces and endpoints as tree depending on level of --verbose.Controllable display --blocks for device, bus --bus-blocks, configurations --config-blocks, interfaces --interface-blocks and endpoints --endpoint-blocks. Use --more to see more by default.Modern terminal features with coloured output, utf-8 characters and icon look-up based device data. Can be turned off and customised. See --encoding (glyphs [default], utf8 and ascii), which can keep icons/tree within a certain encoding, --color (auto [default], always and never) and --icon (auto [default], always and never). Auto --icon will A guide on how to setup fonts on macOS and Android.To check if the font you are using is setup correctly, try running the following snippet in a shell and see if that prints a folder icon. If it prints a box, or question mark or something else, then you might have some issues in how you setup the font or how your terminal emulator renders the font.If one does not want icons, provide a config file with custom blocks not including the any 'icon*' blocks - see the example config. Alternatively, to only use standard UTF-8 characters supported by all fonts (no private use area) pass --encoding utf8 and --icon auto (default). The --icon auto will drop the icon blocks if the characters matched are not supported by the --encoding.For no icons at all, use the hidden --no-icons or --icon never args.Known Issuessudo is required to open and read Linux root_hub string descriptors and potentially all devices if the user does not have permissions. The program works fine without these however, as will use sysfs/hwdb/'usb-ids' like lsusb. Use debugging -z to see what devices failed to read. The env CYME_PRINT_NON_CRITICAL_PROFILER_STDERR can be used to print these to stderr. --lsusb --verbose will print a message to stderr always to match the 'lsusb' behaviour.Users cannot open special non-user devices on Apple buses (VHCI); T2 chip for example. These will still be listed with 'native' and system_profiler but not --force-libusb. They will not print verbose information however and log an error if --verbose is used/print if --lsusb.Lsusb Command for Windows - YouTube
On Ubuntu, you may (for one reason or another) wish to view information about all USB devices connected to the system. Unfortunately, Ubuntu doesn’t come with an official GUI USB tool that users can use to view this information efficiently.Thankfully, there are many command-line utilities that users can take advantage of to view USB device information. In this guide, we’ll go over each of these tools, how they work, and how to use them.The number one way an Ubuntu user can view all connected USB devices is with the lsusb command. This command literally means “list USB,” and it does exactly that — it lists all of your USB devices, their IDs, names, etc.To get started, open up a terminal window on the Ubuntu desktop. To open up a terminal window on Ubuntu, press Ctrl + Alt + T on the keyboard. Or, search for “Terminal” in the app menu and launch it that way.With the terminal window open and ready to use, execute the lsusb command in the terminal window. Once you enter it, it will print out detailed information about the USB devices connected to the system.lsusbIn the lsusb output, you’ll see “Bus,” followed by numbers, “Device,” more numbers, “ID,” some hex code (that’s your device’s ID code), and the name of the device. To locate any USB device, find the name at the end.If you’d like to save this output to a text file for later reading, research, or easier viewing via your favorite text editor, pipe the output to a file using the > command-line modifier. lsusb > ~/my-usb-devices.txtAt any time, you can view the “my-usb-devices.txt” file in the terminal with the cat command below.cat ~/my-usb-devices.txtOr, open up the text file in your home folder using your favorite text editor.Ubuntu list USB devices – DmesgAnother way. Cross-platform lsusb command. `cargo install lsusb` - tcr/rust-lsusb. Cross-platform lsusb command. `cargo install lsusb` - tcr/rust-lsusb. Skip to content. Navigation Menu Toggle Command to display lsusb manual in Linux: $ man 8 lsusb. NAME. lsusb - list USB devices SYNOPSIS lsusb [ options] DESCRIPTION lsusb is a utility for displaying information aboutWhat's the equivalent of ~ $ lsusb on Windows :
Only show icons if all icons to be shown are supported by the --encoding.Can be used as a library too with system profiler module, USB descriptor modules and display module for printing amongst others.--json output that honours filters and --tree.--headers to show meta data only when asked and not take space otherwise.--mask-serials to either '*' or randomise serial string for sharing dumps with sensitive serial numbers.Auto-scaling to terminal width. Variable length strings such as descriptors will be truncated with a '...' to indicate this. Can be disabled with config option 'no-auto-width' and a fixed max defined with 'max-variable-string-len'.Targets for Linux, macOS and Windows.DemoInstallRequirementsFor pre-compiled binaries, see the releases. Pre-compiled builds use native profiling backends and should require no extra dependencies.From crates.io with a Rust tool-chain installed: cargo install cyme --git (from GitHub as crates.io pinned at the moment). To do it from within a local clone: cargo install --path ..Package ManagersHomebrew 'cyme' which will also install a man page, completions and the 'libusb' dependency:Arch Linux official packageDebian packages as part of release - need a Debian maintainer for this.More package managers to come/package distribution, please feel free to create a PR if you want to help out here.Alias lsusbIf one wishes to create a macOS version of lsusb or just use this instead, create an alias one's environment with the --lsusb compatibility flag:alias lsusb='cyme --lsusb'Linux udev InformationNoteOnly supported on Linux targets.To obtain device and interface drivers being used on Linux like lsusb, one can use the --features udev feature when building - it's a default feature. The feature uses the Rust crate udevrs to obtain the information. To use the C FFI libudev library, use --no-default-features --features udevlib which will use the 'libudev' crate. Note that this will require 'libudev-dev' to be installed on the host machine.To lookup USB IDs from the udev hwdb as well (like lsusb) use --features udev_hwdb. Without hwdb, cyme will use the 'usb-ids' crate, which is the same source as the hwdb binary data but the bundled hwdb may differ due to customisations or last update ('usb-ids' will be most up to date).Profilers and Feature FlagsNativeUses native Rust nusb and udevrs for profiling devices: sysfs (Linux), IOKit (macOS) and WinUSB.It is the default profiler as of 2.0.0. Use --feature=native ('nusb' and 'udevrs' on Linux) or --feature=nusb to manually specify.LibusbUses 'libusb' for profiling devices. Requires libusb 1.0.0 to be installed: brew install libusb, sudo apt install Descriptor informaioncyme --lsusb --verbose# lsusb tree mode (can add verbose levels [-v])cyme --lsusb --treeBlocksSee cyme --help for blocks available. One can also omit the value to the arg to show options. Specifying multiple blocks requires multiple args.# List USB devices with more display blockscyme --more# List USB devices with chosen blocks: name, vid, pid, serial, speed (can use short -b)cyme --blocks name --blocks vendor-id --blocks product-id --blocks serial -b speed# Customise other blocks - it's probably easier to use Config at this pointcyme --blocks name --bus-blocks name --config-blocks name --interface-blocks class --endpoint-blocks numberFiltering# Filter for only Apple devices (vid:pid is base16)cyme -d 0x05ac# Specifically an Apple Headset, masking the serial number with '*'cyme -d 05ac:8103 --mask-serials hide# Filter for only devices with a certain name and class (filters can be combined)cyme --filter-name "Black Magic" --filter-class cdc-dataCrateFor usage as a library for profiling system USB devices, the crate is 100% documented so look at docs.rs. The main useful modules for import are profiler, and usb.There are also some examples in 'examples/', these can be run with cargo run --example filter_devices. It wasn't really written from the ground-up to be a crate but all the USB descriptors might be useful for high level USB profiling.Configcyme will check for a 'cyme.json' config file in:Linux: "$XDG_CONFIG_HOME/cyme or $HOME/.config/cyme"macOS: "$HOME/Library/Application Support/cyme"Windows: "{FOLDERID_RoamingAppData}/cyme"One can also be supplied with --config. Copy or refer to './doc/cyme_example_config.json' for configurables. The file is essentially the default args; supplied args will override these. Use --debug to see where it is looking or if it's not loading.Custom Icons and ColoursSee './doc/cyme_example_config.json' for an example of how icons can be defined and also the docs. The config can exclude the "user"/"colours" keys if one wishes not to define any new icons/colours.Icons are looked up in an order of User -> Default. For devices: Name -> VidPid -> VidPidMsb -> Vid -> UnknownVendor -> get_default_vidpid_icon, classes: ClassifierSubProtocol -> Classifier -> UndefinedClassifier -> get_default_classifier_icon. User supplied colours override all internal; if a key is missing, it will be None.Icons not Showing/Boxes with Question MarksCopied from lsd: For cyme to be able to display icons, the font has to include special font glyphs. This might not be the case for most fonts that you download. Thankfully, you can patch most fonts using NerdFont and add these icons. Or you can just download an already patched version of your favourite font from NerdFont font download page.Here islsusb command in Linux/Unix, Uses of lsusb command with
Libusb is the problem: try with USBView (Windows) or lsusb (UNIX)USBView download (now Microsoft also has the command line usbview2) from Microsoft Windows SDK. Device Tree Viewer can be uased as an alternatiev to usbview. (usbutils) is a common utility under Linux. log goes a long way! libusb_debug() or LIBUSB_DEBUG=4 can do wonders.a trace is even better. And yes, Windows (7) can also generate insightful traceswe have a generic test utility that can produce a log and will perform basic device access. You shouldn't come to us with "I can't access my device" but with "I can't access my device, and here is the log from xusb" at the very least, tell us the VID:PID of your device, its purpose, and whether it uses a custom firmware that you developed or a commercial oneA search with basic keywords describing your issue against the libusb-devel mailing-list can be very insightfulAre you aware that OS backends have limitations, and that not all devices will perform the same way on all devices?Always try to test with the latest version from git if you encounter an issuelsusb/extras/lsusb.py at master gregkh/lsusb - GitHub
Libusb-1.0-0-dev or one's package manager of choice.Was the default feature before 2.0.0 for gathering verbose information. It is the profiler used by lsusb but there should be no difference in output between the two, since cyme uses control messages to gather the same information. If one wishes to use 'libusb', use --no-default-features and --feature=libusb or --feature=ffi for udevlib too.Note'libusb' does not profile buses on non-Linux systems (since it relies on root_hubs). On these platforms, cyme will generate generic bus information.macOS system_profilerUses the macOS system_profiler SPUSBDataType command to profile devices.Was the default feature before 2.0.0 for macOS systems to provide the base information; 'libusb' was used to open devices for verbose information. It is not used anymore if using the default native profiler but can be forced with --system-profiler - the native profiler uses the same IOKit backend but is much faster as it is not deserializing JSON. It also always captures bus numbers where system_profiler does not.TipIf wishing to use only macOS system_profiler and not obtain more verbose information, remove default features with cargo install --no-default-features cyme. There is not much to be gained by this considering that the default native profiler uses the same IOKit as a backend, can open devices to read descriptors (verbose mode) and is much faster.UsageUse cyme --help for basic usage or man ./doc/cyme.1. There are also autocompletions in './doc'.ExamplesTree tree.json# Then import the JSON file to view the system USB tree as it was when exported. All cyme args can be used with this static import as if it was profiled data.cyme --from-json tree.json"># List all USB devices and buses in a tree format with default display blockscyme --tree# As above but with configurations toocyme --tree --verbose# And with interfaces and endpoints - each verbose level goes futher down the USB descriptor tree. Using short arg here.cyme --tree -vvv# List all USB devices and buses in a tree format with more display blocks, all verbose levels and headings to show what is being displayedcyme --tree --more --headings# Export the tree to a JSON file - --json works with all optionscyme --tree --verbose --json > tree.json# Then import the JSON file to view the system USB tree as it was when exported. All cyme args can be used with this static import as if it was profiled data.cyme --from-json tree.jsonlsusb# List all USB devices and buses like 'lsusb'cyme --lsusb# lsusb verbose device dump including all. Cross-platform lsusb command. `cargo install lsusb` - tcr/rust-lsusb. Cross-platform lsusb command. `cargo install lsusb` - tcr/rust-lsusb. Skip to content. Navigation Menu ToggleWindows: `lsusb` Equivalent - PowerShell - ShellHacks
Informed that the ZENA predated Microchip's own MRF24J40 so the Texas Instruments CC2420 chip (originally made by Chipcon before being acquired by TI) was used instead. The markings must have been removed by Microchip for commercial reasons but are still just visible under the right light.There are 3 green LEDs marked D2, D4 and D3. D2 appears to be a heartbeat which flashes with a one second on / one second off duty cycle while the ZENA is in sniffer mode. The rhythm is disrupted whenever a packet is received. D3 also flashes with network activity but I cannot deduce a pattern. D4 is illuminated only during the powerup test sequence.ZENA USB ProtocolThe ZENA (vendor ID 0x04d8 , product ID 0x000E) presents itself as a Human Interface Device (HID)."lsusb" is a useful utility to discover metadata about USB devices. The following command will dump information about the ZENA to screen: "lsusb -v -d 04d8:000e". This output looks like this (I've highlighted lines of interest in bold):Bus 002 Device 003: ID 04d8:000e Microchip Technology, Inc. Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x04d8 Microchip Technology, Inc. idProduct 0x000e bcdDevice 0.00 iManufacturer 1 iProduct 2 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 41 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 No Subclass bInterfaceProtocol 0 None iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.01 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 34 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1USBSnoop and usbmon are another useful tools which can be used to eavesdrop on USB traffic when used with the supplied Windows software.This is what I know about the ZENA USB interface so far (lots gleaned from Joshua Wright's blog post and the Python script linked above):There are two end points: a control channel (0x01) and a packet channel (0x81)There is only one known control function: to select a 802.15.4 channel in the range 11 to 26. This is achieved by allocating a 64 byte buffer, zeroing it and setting the channel number (11 to 26) in byte offset 1 (second byte of the buffer). Send this to the control endComments
O o /---o /---/---oo---/ \---\---o o \---o oCymeList system USB buses and devices. A modern cross-platform lsusb that attempts to maintain compatibility with, but also add new features. Profiles system USB buses and the devices on those buses, including full device descriptors.As a developer of embedded devices, I use a USB list tool on a frequent basis and developed this to cater to what I believe are the short comings of lsusb: verbose dump is mostly too verbose, tree doesn't contain useful data on the whole, it barely works on non-Linux platforms and modern terminals support features that make glancing through the data easier.The project started as a quick replacement for the barely working lsusb script and a Rust project to keep me up to date! Like most fun projects, it quickly experienced feature creep as I developed it into a cross-platform replacement for lsusb. It started as a macOS system_profiler parser, evolved to include a 'libusb' based profiler for reading full device descriptors and now defaults to a pure Rust profiler using nusb.It's not perfect as it started out as a Rust refresher but I had a lot of fun developing it and hope others will find it useful and can contribute. Reading around the lsusb source code, USB-IF and general USB information was also a good knowledge builder.The name comes from the technical term for the type of blossom on a Apple tree: cyme - it is Apple related and also looks like a USB device tree 😃🌸.FeaturesCompatible with lsusb using --lsusb argument. Supports all arguments including --verbose output - fully parsed device descriptors! Output is identical for use with no args (list), tree (excluding drivers on non-Linux) and should match for verbose (perhaps formatting differences).Default build is a native Rust profiler using nusb.Filters like lsusb but that also work when printing --tree. Adds --filter-name, --filter-serial, --filter-class and option to hide empty --hide-buses/--hide-hubs.Improved --tree mode; shows device, configurations, interfaces and endpoints as tree depending on level of --verbose.Controllable display --blocks for device, bus --bus-blocks, configurations --config-blocks, interfaces --interface-blocks and endpoints --endpoint-blocks. Use --more to see more by default.Modern terminal features with coloured output, utf-8 characters and icon look-up based device data. Can be turned off and customised. See --encoding (glyphs [default], utf8 and ascii), which can keep icons/tree within a certain encoding, --color (auto [default], always and never) and --icon (auto [default], always and never). Auto --icon will
2025-04-23A guide on how to setup fonts on macOS and Android.To check if the font you are using is setup correctly, try running the following snippet in a shell and see if that prints a folder icon. If it prints a box, or question mark or something else, then you might have some issues in how you setup the font or how your terminal emulator renders the font.If one does not want icons, provide a config file with custom blocks not including the any 'icon*' blocks - see the example config. Alternatively, to only use standard UTF-8 characters supported by all fonts (no private use area) pass --encoding utf8 and --icon auto (default). The --icon auto will drop the icon blocks if the characters matched are not supported by the --encoding.For no icons at all, use the hidden --no-icons or --icon never args.Known Issuessudo is required to open and read Linux root_hub string descriptors and potentially all devices if the user does not have permissions. The program works fine without these however, as will use sysfs/hwdb/'usb-ids' like lsusb. Use debugging -z to see what devices failed to read. The env CYME_PRINT_NON_CRITICAL_PROFILER_STDERR can be used to print these to stderr. --lsusb --verbose will print a message to stderr always to match the 'lsusb' behaviour.Users cannot open special non-user devices on Apple buses (VHCI); T2 chip for example. These will still be listed with 'native' and system_profiler but not --force-libusb. They will not print verbose information however and log an error if --verbose is used/print if --lsusb.
2025-03-24On Ubuntu, you may (for one reason or another) wish to view information about all USB devices connected to the system. Unfortunately, Ubuntu doesn’t come with an official GUI USB tool that users can use to view this information efficiently.Thankfully, there are many command-line utilities that users can take advantage of to view USB device information. In this guide, we’ll go over each of these tools, how they work, and how to use them.The number one way an Ubuntu user can view all connected USB devices is with the lsusb command. This command literally means “list USB,” and it does exactly that — it lists all of your USB devices, their IDs, names, etc.To get started, open up a terminal window on the Ubuntu desktop. To open up a terminal window on Ubuntu, press Ctrl + Alt + T on the keyboard. Or, search for “Terminal” in the app menu and launch it that way.With the terminal window open and ready to use, execute the lsusb command in the terminal window. Once you enter it, it will print out detailed information about the USB devices connected to the system.lsusbIn the lsusb output, you’ll see “Bus,” followed by numbers, “Device,” more numbers, “ID,” some hex code (that’s your device’s ID code), and the name of the device. To locate any USB device, find the name at the end.If you’d like to save this output to a text file for later reading, research, or easier viewing via your favorite text editor, pipe the output to a file using the > command-line modifier. lsusb > ~/my-usb-devices.txtAt any time, you can view the “my-usb-devices.txt” file in the terminal with the cat command below.cat ~/my-usb-devices.txtOr, open up the text file in your home folder using your favorite text editor.Ubuntu list USB devices – DmesgAnother way
2025-04-19Only show icons if all icons to be shown are supported by the --encoding.Can be used as a library too with system profiler module, USB descriptor modules and display module for printing amongst others.--json output that honours filters and --tree.--headers to show meta data only when asked and not take space otherwise.--mask-serials to either '*' or randomise serial string for sharing dumps with sensitive serial numbers.Auto-scaling to terminal width. Variable length strings such as descriptors will be truncated with a '...' to indicate this. Can be disabled with config option 'no-auto-width' and a fixed max defined with 'max-variable-string-len'.Targets for Linux, macOS and Windows.DemoInstallRequirementsFor pre-compiled binaries, see the releases. Pre-compiled builds use native profiling backends and should require no extra dependencies.From crates.io with a Rust tool-chain installed: cargo install cyme --git (from GitHub as crates.io pinned at the moment). To do it from within a local clone: cargo install --path ..Package ManagersHomebrew 'cyme' which will also install a man page, completions and the 'libusb' dependency:Arch Linux official packageDebian packages as part of release - need a Debian maintainer for this.More package managers to come/package distribution, please feel free to create a PR if you want to help out here.Alias lsusbIf one wishes to create a macOS version of lsusb or just use this instead, create an alias one's environment with the --lsusb compatibility flag:alias lsusb='cyme --lsusb'Linux udev InformationNoteOnly supported on Linux targets.To obtain device and interface drivers being used on Linux like lsusb, one can use the --features udev feature when building - it's a default feature. The feature uses the Rust crate udevrs to obtain the information. To use the C FFI libudev library, use --no-default-features --features udevlib which will use the 'libudev' crate. Note that this will require 'libudev-dev' to be installed on the host machine.To lookup USB IDs from the udev hwdb as well (like lsusb) use --features udev_hwdb. Without hwdb, cyme will use the 'usb-ids' crate, which is the same source as the hwdb binary data but the bundled hwdb may differ due to customisations or last update ('usb-ids' will be most up to date).Profilers and Feature FlagsNativeUses native Rust nusb and udevrs for profiling devices: sysfs (Linux), IOKit (macOS) and WinUSB.It is the default profiler as of 2.0.0. Use --feature=native ('nusb' and 'udevrs' on Linux) or --feature=nusb to manually specify.LibusbUses 'libusb' for profiling devices. Requires libusb 1.0.0 to be installed: brew install libusb, sudo apt install
2025-04-23