From d1909f57fc9ef1df6c6e1144b0ea4ad4c98271ca Mon Sep 17 00:00:00 2001 From: Shishkin Alexander Date: Wed, 12 Jan 2022 11:19:35 +0300 Subject: [PATCH] Detach kernel driver to fix Errno_16: Device is busy --- Library/usb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/usb.py b/Library/usb.py index 717e07e..ff422b1 100644 --- a/Library/usb.py +++ b/Library/usb.py @@ -21,6 +21,10 @@ def connect(self): if self.device is None: self.log(2, "Couldn't detect the device. Is it connected ?") return False + + if self.device.is_kernel_driver_active(0): + self.device.detach_kernel_driver(0) + self.device.set_configuration() self.configuration = self.device.get_active_configuration() self.log(2, self.configuration)