Strykar / usbreset

Alan Stern's usbreset.c to reset USB devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

usbreset

Alan Stern's (usbreset.c) - Yes, there is a way to force Linux's USB stack to perform a port reset and re-enumerate a device.

See his post to the Linux-USB mailing-list and this.

WHAT THIS SOLVES - Occasionally, my gaming mice will not be detected on boot on my aging motherboard and this removes the annoyance of having to get up and remove+re-plug the mouse's USB connector. Used via bash script that Gnome autostarts on login.

Compile the program:

$ cc usbreset.c -o usbreset

Get the Bus and Device ID of the USB device you want to reset:

$ lsusb
Bus 002 Device 003: ID 0fe9:9010 DVICO

Make our compiled program executable:

$ chmod +x usbreset

Execute the program with sudo privilege; make necessary substitution for (Bus) and (Device) IDs as found by running lsusb:

$ sudo ./usbreset /dev/bus/usb/002/003

About

Alan Stern's usbreset.c to reset USB devices

License:GNU General Public License v3.0


Languages

Language:C 50.8%Language:Shell 49.2%