You can make USB devices disappear using sysfs. I have tested this with a Logitech Unifying USB receiver. Although lsusb
listed the device, key presses weren't processed when the device was removed using this method.
Determine the ID associated with your USB device using
dmesg
. For instance, after plugging the USB receiver in, I get1-1.2
as ID:usb 1-1.2: new full-speed USB device number 4 using dwc_otg usb 1-1.2: New USB device found, idVendor=046d, idProduct=c52b usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 usb 1-1.2: Product: USB Receiver usb 1-1.2: Manufacturer: Logitech
Remove and re-insert the device:
sudo sh -c 'echo 1-1.2 > /sys/bus/usb/drivers/usb/unbind' sudo sh -c 'echo 1-1.2 > /sys/bus/usb/drivers/usb/bind'
Profit!
You may also have success by writing unbind and bind on the driver for your camera driver. Use ls -l /dev/bus/[DRIVER]/devices
to determine the driver.
(Inspired by an answer on Unix.SEan answer on Unix.SE)