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.
my_device = usb.core.find(...)
...
# necessary to allow further claim_interface calls
# (bulk read), generally not needed
usb.util.dispose_resources(my_device)
#!/usr/bin/python
from usb.core import find as finddev
dev = finddev(idVendor=0x1234, idProduct=0x5678)
dev.reset()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With