This repo was discontinued and I discourage you to use if there's a better fork.
This repo can be deleted anytime so if you like it, fork it and polish it before it's gone.
A simple program to reset usb devices in linux.
IMPORTANT NOTE: If you downloaded the binary you can skip to item 3!
-
Clone this repository
-
Compile the program
cc usbreset.c -o usbreset
- Make the binary executable (if you need 1)
chmod +x usbreset
- Get the IDs via lsusb on terminal:
lsusb
The output will be like:
Bus 002 Device 003: ID xxxx:xxxx USB OPTICAL MOUSE
Bus 001 Device 002: ID xxxx:xxxx USB Keyboard
Bus 001 Device 003: ID xxxx:xxxx USB Audio Interface
- Run as sudo (change the [BUS] and [DEVICE] for the values):
sudo ./usbreset /dev/bus/usb/[BUS]/[DEVICE]
Example: If I want to reset my USB Audio Interface (based on the lsusb used before)
BUS is 001, Device is 002
sudo ./usbreset /dev/bus/usb/001/003
Q: I'm getting "Error opening output file"
A: Run as root or with admin privileges.
Footnotes
-
You only need it if after compilation the binary has no x permission for some reason. ↩