USB Device Release

user977601 picture user977601 · Sep 2, 2014 · Viewed 7.1k times · Source

I am currently working on PyUSB. As I am new to USB, I don’t know, how can I do the following.

I have successfully connected to my USB Device hardware from Python PyUSB. In the code I required to reset the USB Device hardware. Which I did by sending a command to the hardware. Now after hardware reset, I want to release the current USB device from Python PyUSB. And then I want to connect again to the USB Device Hardware after it come back from reset.

Please let me know, how can I release the USB Device Connection and interfaces etc so that I can reconnect?

Thank you very much in advance.

Answer

rishta picture rishta · Dec 25, 2016
#!/usr/bin/python
from usb.core import find as finddev
dev = finddev(idVendor=0x1234, idProduct=0x5678)
dev.reset()