Thanks for that, that was all I needed to work it out, looking at the help
for various commands
Adjusted the code as follows and it works great every time:
dev.reset()
if dev.is_kernel_driver_active(0) == True:
dev.detach_kernel_driver(0)
dev.set_configuration()
Cheers
Clint
On Fri, Apr 8, 2016 at 10:48 AM, Alan Jhonn Aguiar Schwyn <
[email protected]> wrote:
> This returns "true" ?
>
> dev.is_kernel_driver_active()
>
>
> ------------------------------
> Date: Fri, 8 Apr 2016 10:42:07 +1000
> From: [email protected]
> To: [email protected]
> Subject: [pyusb-users] "Resource Busy" error message.
>
>
> Hi All,
>
> First time poster here from Brisbane Australia :)
> I have only just started with using pyusb, so any advice would be greatly
> appreciated.
>
> My system - 64bit Arch Linux.
>
>
> I'm attempting to send commands to a Kuando Busylight (
> http://www.plenom.com/), using the example code here -
> https://github.com/walac/pyusb/blob/master/docs/tutorial.rst. At this
> stage all I have changed in the source code is the vendor and product
> ids to match the Busylight.
>
> The device is being found without problems using Vendor and Product IDs:
> "dev = usb.core.find(idVendor=0x04d8, idProduct=0xf848)"
>
> The next line "dev.set_configuration()" is raising a USBError.
>
>
> Result is the same in Python 2.7:
>
> Traceback (most recent call last):
> File "./busylight.py", line 19, in <module>
> dev.set_configuration()
> File "/usr/lib/python2.7/site-packages/usb/core.py", line 799, in
> set_configuration
> self._ctx.managed_set_configuration(self, configuration)
> File "/usr/lib/python2.7/site-packages/usb/core.py", line 128, in
> managed_set_configuration
> self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
> File "/usr/lib/python2.7/site-packages/usb/backend/libusb1.py", line
> 730, in set_configuration
> _check(self.lib.libusb_set_configuration(dev_handle.handle,
> config_value))
> File "/usr/lib/python2.7/site-packages/usb/backend/libusb1.py", line
> 552, in _check
> raise USBError(_strerror(ret), ret, _libusb_errno[ret])
> usb.core.USBError: [Errno 16] Resource busy
>
>
> And also in Python 3.5:
>
> Traceback (most recent call last):
> File "./busylight.py", line 19, in <module>
> dev.set_configuration()
> File "/usr/lib/python3.5/site-packages/usb/core.py", line 799, in
> set_configuration
> self._ctx.managed_set_configuration(self, configuration)
> File "/usr/lib/python3.5/site-packages/usb/core.py", line 128, in
> managed_set_configuration
> self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
> File "/usr/lib/python3.5/site-packages/usb/backend/libusb1.py", line
> 730, in set_configuration
> _check(self.lib.libusb_set_configuration(dev_handle.handle,
> config_value))
> File "/usr/lib/python3.5/site-packages/usb/backend/libusb1.py", line
> 552, in _check
> raise USBError(_strerror(ret), ret, _libusb_errno[ret])
> usb.core.USBError: [Errno 16] Resource busy
>
>
> Thanks in advance.
>
>
> Cheers
> Clint
>
>
> ------------------------------------------------------------------------------
> _______________________________________________ pyusb-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> pyusb-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>
>
------------------------------------------------------------------------------
_______________________________________________
pyusb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyusb-users