Yes I put it after the find() function. Do I need add other configuration functions?
Cheers, Tony On 22 Feb 2013, at 00:29, Wander Lairson Costa <wander.lair...@gmail.com> wrote: > 2013/2/21 Tony Liu <tonynoth...@gmail.com>: >> Hi all, >> >> I'm new to PyUSB, and now i'm working on communicating with a costumed chip. >> The chip use two endpoint and one is use for in and another for out, and the >> manufacturer told me just to send raw date to it with different value of >> command. >> >> When I try this: >> >> buf = struct.pack("b",2) >> >> buf1 = struct.pack("b",0) >> >> print(buf+buf1+buf1) >> >> device.write(0x81,buf+buf1+buf1,0,100) >> >> >> I got the error of >> >> Traceback (most recent call last): >> >> File "/Users/tonyliu/Documents/Aptana Studio 3 >> Workspace/Final-Year-Project/Test/USB_Test.py", line 81, in <module> >> >> device.write(0x81,buf+buf1+buf1,0,100) >> >> File >> "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/usb/core.py", >> line 626, in write >> >> self.__get_timeout(timeout) >> >> File >> "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/usb/backend/libusb1.py", >> line 532, in bulk_write >> >> timeout) >> >> File >> "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/usb/backend/libusb1.py", >> line 631, in __write >> >> _check(retval) >> >> File >> "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/usb/backend/libusb1.py", >> line 403, in _check >> >> raise USBError(_str_error[ret], ret, _libusb_errno[ret]) >> >> usb.core.USBError: [Errno 60] Operation timed out >> >> Exception AttributeError: "'NoneType' object has no attribute 'libusb_exit'" >> in <bound method _Initializer.__del__ of <usb.backend.libusb1._Initializer >> object at 0x101134ad0>> ignored >> >> >> Is this means I do not send data correctly or other? > > In general, you should at least call set_configuration() before trying > to talk to a device. Have you done that? > > -- > Best Regards, > Wander Lairson Costa > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > pyusb-users mailing list > pyusb-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyusb-users ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users