Xiaofan, morning, thanks for the reply.

Answers inline.

-----Original Message-----
From: Xiaofan Chen [mailto:xiaof...@gmail.com] 
Sent: 07 March 2017 13:08
To: pyusb-users@lists.sourceforge.net
Subject: Re: [pyusb-users] Help with ERROR please [usb.core.USBError: [Errno 
None] b'libusb0-dll:err [_usb_reap_async]

On Tue, Mar 7, 2017 at 5:33 AM, Greg Horler <dr.g.d.hor...@gmail.com> wrote:
> I have had partial success in interfacing an 8-bit microcontroller 
> with a PC running windows 10,Python and PyUsb.
>
> I am a firmware specialist, i.e. not particularly proficient in 
> Python, I am new to PyUSB.
>
> The problem is that my python program fails periodically with the 
>following  error… ...
> usb.core.USBError: [Errno None] b'libusb0-dll:err [_usb_reap_async] 
>reaping  request failed, win error: The I/O operation has been aborted 
>because of  either a thread exit or an application request.\r\n\n'
>
> print ("ep.bEndpointAddress = %s" %out_ep_address)
> #print(out_ep_address)
>
> while True:
>
>     dev.write(0x01, [0x81, 0x08, 0x08,0x03,0x04,0x05,0x06,0x07])
>     time.sleep(0.1)  # Sample (0.1)s == 1ms
>     test = dev.read(0x81, 8)
>     print (test)


Did you write the FW by yourself?

>>Partly. The firmware is based on that posted by S Rowloski et al. It has been 
>>modified to accommodate new header files provided by microchip etc.
>>The updated firmware works with the C# interface program they created.

Since this is an HID device, are you using the libusb-win32 filter driver?

>> Yes I am. This was used after a lot of Googling

pyusb/libusb may not be the best thing to use for USB HID device.

>>Why not? The system seems to work other than the erratic time out? Do you 
>>have no suggestions as how to fix this problem...I would have thought it has 
>>been seen before?

If you are saying that PyUSB is unsuitable for HID devices, then this is very 
annoying, I have dedicated two weeks to getting PyUSB up and running for my 
project. As writers and maintainers of the code, I would expect such a 
disclaimer to be placed in a large font at the top of the tutorial / about 
pages.



Ref: 
https://github.com/libusb/libusb/wiki/FAQ#does-libusb-support-usb-hid-devices

If you need cross platform HID access, then you may need to look at HIDAPI and 
its python binding.
   http://www.signal11.us/oss/hidapi/
   https://pypi.python.org/pypi/hidapi

If you only use Python and only care about Windows, you may want to give 
pywinusb a try.
   https://pypi.python.org/pypi/pywinusb/



--
Xiaofan

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned 
dictionary content that is easy and intuitive to access. Sign up for an account 
today to start using our lexical data to power your apps and projects. Get 
started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to