TechBuzzPro

How to See USB Devices on Raspberry Pi

· 5 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can see USB devices on a Raspberry Pi by using the lsusb command (or dmesg) from the terminal.

Being able to list the USB peripherals attached to your Pi is essential for troubleshooting, confirming that a sensor or storage device is recognized, and for scripting automated setups. The process requires only a working Raspberry Pi with a command‑line interface; no extra software is needed beyond the default Raspbian (now Raspberry Pi OS) utilities.

What You'll Need

  • A Raspberry Pi running Raspberry Pi OS (Lite or Desktop)
  • Keyboard and monitor (or SSH access from another computer)
  • At least one USB device you want to inspect (e.g., flash drive, keyboard, sensor)
  • Internet connection only if you plan to install additional tools like usbutils

Step-by-Step

  1. Open a terminal window. On the desktop you can click the terminal icon; on a headless Pi, SSH in with ssh pi@your‑ip.
  2. Make sure the system package list is current:
    sudo apt update
  3. If the lsusb binary is missing, install the usbutils package:
    sudo apt install -y usbutils
  4. Run the basic listing command:
    lsusb
    This prints one line per detected device, showing the bus number, device address, vendor ID, product ID, and a short description.
  5. To see more detail, add the -v (verbose) flag:
    lsusb -v
    Because the output is long, you may want to pipe it through less or redirect to a file:
    lsusb -v | less or lsusb -v > usb_report.txt.
  6. If you prefer a human‑readable summary without the raw IDs, use the usb-devices script that ships with the OS:
    usb-devices
  7. Another quick way to confirm that the kernel recognized a new device is to view the most recent kernel messages:
    dmesg | tail -n 20
  8. For devices that expose serial ports (e.g., Arduino), check /dev for entries like ttyUSB0 or ttyACM0:
    ls /dev/ttyUSB* or ls /dev/ttyACM*
  9. If you need the power consumption of each port, install powertop and run it in interactive mode; the USB section will show current draw per device.
  10. When you have finished, you can safely detach the device or reboot the Pi if you changed hardware configuration.

Common Mistakes

  • Running lsusb without installing usbutils first – the command will be reported as "not found".
  • Confusing the bus number with the physical USB port; the bus number is assigned by the kernel and may not match the port layout on the board.
  • Expecting lsusb to show storage capacity; it only reports identification data, not size. Use lsblk or df -h for that.
  • Overlooking power‑limited ports; a high‑draw device may appear in lsusb but fail to function because the Pi cannot supply enough current.
  • Ignoring the need for root privileges when examining certain low‑level details; some verbose information is hidden from non‑root users.

Tips

  • Alias the command for quick access: add alias usb='lsusb -v | less' to ~/.bashrc.
  • Use grep to filter the list, e.g., lsusb | grep -i "Arduino" to find a specific device.
  • Combine lsusb with udevadm info to fetch the device’s syspath and attributes:
    udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/001/002)
  • When using a USB hub, check the hub’s own descriptor with lsusb -t to see the hierarchy of devices.
  • Store a snapshot of the USB state before and after plugging a new peripheral; the difference in lsusb output tells you exactly what changed.

Troubleshooting

If the expected device does not appear in lsusb, follow these steps in order:

  1. Restart the Pi. A simple reboot often re‑initialises the USB controller and clears transient errors.
  2. Check the physical connection. Ensure the cable is seated firmly and that the port is not damaged. Try a different port or a known‑good cable.
  3. Verify power availability. If you are using a power‑hungry peripheral, connect it through a powered USB hub or supply external power to the device.
  4. Inspect kernel logs. Run dmesg | grep -i usb immediately after plugging the device. Look for messages such as "device not recognized" or "reset failed".
  5. Update the firmware and kernel. Run sudo apt full-upgrade and then sudo reboot. Newer kernels include bug fixes for USB controller quirks.
  6. Check for missing drivers. Some specialty devices (e.g., certain Wi‑Fi dongles) require additional kernel modules. Search the Pi forums for the vendor’s module name and load it with modprobe.
  7. Test the device on another computer. This isolates whether the problem is with the Pi or the peripheral itself.

If none of the above resolves the issue, consider posting the dmesg excerpt and lsusb -v output on a community forum, making sure to redact any personal IP addresses.

Frequently Asked Questions

What does the "ID" field in lsusb mean?

The ID is a pair of hexadecimal numbers: the first four digits are the vendor ID (who made the device) and the second four are the product ID (the specific model). You can look them up on the USB ID database to identify unknown hardware.

Why does my USB flash drive show up but cannot be mounted?

Detection and mounting are separate steps. lsusb only confirms the controller sees the device. Use lsblk or fdisk -l to locate the block device, then mount it with sudo mount /dev/sda1 /mnt. If the partition table is corrupted, you may need to re‑format.

Can I monitor USB events in real time?

Yes. Run watch -n 1 lsusb to refresh the list every second, or use udevadm monitor --subsystem=usb for a live event stream.

Is there a graphical way to view USB devices?

The default Raspberry Pi OS desktop includes the "Device Manager" utility under the "Preferences" menu, which lists USB devices with icons. However, the command‑line tools are more detailed and reliable for troubleshooting.

My USB keyboard works, but lsusb does not list it.

Keyboards are often handled by the HID driver, which may not expose a separate USB descriptor in older kernels. Updating the kernel or checking dmesg for "hid" messages can reveal the underlying connection.

Do I need to reboot after installing usbutils?

No. Once the package is installed, lsusb becomes immediately available. A reboot is only required for kernel or firmware updates.