wander.lairson <wander.lairson@...> writes:

> 
> 2011/3/15 Xiaofan Chen <xiaofanc@...>:
> > On Tue, Mar 15, 2011 at 10:55 PM, Emmanuel Blot <eblot.ml@...> wrote:
> >> I need to detach *all* the interfaces from the (Linux) kernel, or I
> >> sometime get an error (not a big deal for my use case)
> >> I also need to call dev.set_configuration() to configure the device.
> >> Nothing unusual I guess.
> >>
> >> The troubles happen when I need to open two serial ports, that is two
> >> interfaces from the same USB device.
> >> On the second initialization call, when dev.set_configuration() is
> >> called for the second time, the first open interface gets in trouble:
> >>  Exception: UsbError: No such device (it may have been disconnected)
> >> It seems set_configuration() cannot be called another time if an
> >> interface is already being actively used.
> >>
> >> I don't know how to avoid calling set_configuration() more that once,
> >> as I don't know how to identify that the USB device has already been
> >> configured.
> >>
> >
> > You can call  set_configuration() once and then call claim_interface
> > for each interface. At least this is how libusb works for USB composite
> > device.
> >
> You can do this through util.claim_interface function.
> 

Hi Wander,

I am trying to communicate with a Lego WeDO device using PyUSB.
Right at the beginning when self.dev.is_kernel_driver_active(0) is called,
I get the error

File "C:\Users\DevTech\workspace\test1\src\WeDoMore.py", line 14, in __init__
    if self.dev.is_kernel_driver_active(0):
  File "C:\Python26\lib\site-packages\usb\core.py", line 687, in 
is_kernel_driver_active
    return self._ctx.backend.is_kernel_driver_active(self._ctx.handle, 
interface)
  File "C:\Python26\lib\site-packages\usb\backend\__init__.py", line 355, in 
is_kernel_driver_active
    _not_implemented(self.is_kernel_driver_active)
  File "C:\Python26\lib\site-packages\usb\backend\__init__.py", line 79, in 
_not_implemented
    raise NotImplementedError(func.__name__)
NotImplementedError: is_kernel_driver_active


I am running my python code on windows ; is  it true that the backend interface 
is not implemented for windows (including is-kernel-driver-active() function)??
If so,what should I do now? :(((
I would appreciate your comment/thoughts very much since it seems you are the 
one who has put this all together; thank you for doing that.

Thanks
Safoura





------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to