Try with the USBDEVFS_RESET
ioctl.
If your system doesn't come with a usbreset
utility as part of usbutils
, you can compile the one from https://github.com/gregkh/usbutils/blob/master/usbreset.c with just cc usbreset.c -o usbreset
.
On some devices (like my router) you'll have to reset the hub it's connected to instead of the device for it to have effect.
# ./usbreset
Usage:
usbreset PPPP:VVVV - reset by product and vendor id
usbreset BBB/DDD - reset by bus and device number
usbreset "Product" - reset by product name
Devices:
Number 001/004 ID 062a:4101 2.4G Keyboard Mouse
Number 001/006 ID 03f0:e111 DeskJet 2130 series
Number 001/002 ID 05e3:0608 USB2.0 Hub
Number 001/005 ID 248a:8514 Wireless Receiver
Number 001/003 ID 05e3:0608 USB2.0 Hub
$ ./a.out 062a:4101