Phil Hannent wrote: > Wander Lairson wrote: > >> By I remmember from USB Spec, endpoint 0x81 should be IN (MSB 1) and >> endpoint 0x2 should be OUT (MSB 0). I don't what are exactly the side >> effects of inverting them... Did you write the device firmware also? >> If not, probably you should swap the values of PLUG_BULK_IN_EP and >> PLUG_BULK_OUT_EP. If so, revise your fw source code to follow the >> correct USB Spec. After that, report the result to the list. >> >> > Very interesting, no I did not write the firmware and I have nothing to > do with it. I have tried swapping the values and it causes it to fail > at the "Hello" with a "usb.USBError: No error" message. > > I noticed that pyGarmin has the same values as I do. > http://bazaar.launchpad.net/~pygarmin-dev/pygarmin/trunk/annotate/head%3A/garmin.py > > I was thinking that when I am doing the read the interrupt might not > have any data and that might be why it crashes: > read_bytes = self.handle.interruptRead(PlugUSBDevice.PLUG_BULK_OUT_EP,8); > usb.USBError: No error > > Do I have to catch the error and ignore it in this case just because > someone has not put a pen against the board yet? > Woohoo, success. I have the pen data coming out of the board. I ignore the No error message.
I also had a delay within my loop so that I could see the messages, I reduced the time.sleep(0.5) to time.sleep(0.005) and the interrupt is reading the packets just fine 90% of the time. It gets offset at sometimes but I am sure that will be a tuning issue. Thanks for the help so far. PyUSB is a fantastic tool. Regards Phil Hannent
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------
_______________________________________________ Pyusb-users mailing list Pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users