From: Wander L. C. <wan...@gm...> - 2013-11-29 14:31:39
|
This is rather strange, some control requests work, some don't. Could you please activate the PYUSB_DEBUG=debug and LIBUSB_DEBUG=3 environment variables and send the output? 2013/11/28 Bartosz Alchimowicz <pe...@po...>: > Hello > > I'm new here and I have a problem with USB-to-parallal converter based > on PL2305 chip (067b:2305 Prolific Technology, Inc. PL2305 Parallel Port). > > I can find device and read GET_DEVICE_ID, but GET_PORT_STATUS, > SOFT_RESET and write to endpoints is not working :/ > > I use pyusb-1.0.0b1-py2.7 > > Here is my code: > > import usb.core > import usb.util > > dev = usb.core.find(idVendor=0x067b, idProduct=0x2305) > dev.set_configuration() > cfg = dev.get_active_configuration() > > dev.set_interface_altsetting(interface = 0, alternate_setting = 1) > > interface = cfg[(0, 1)] # Bidirectional, other are also not working > > ep = usb.util.find_descriptor(interface, find_all=True) > > dev.ctrl_transfer(161, 0, 0, 0, 256) # GET_DEVICE_ID works ok > > # below nothing works :( > # GET_PORT_STATUS > > >>> dev.ctrl_transfer(161, 1, 0, 0, 1) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File > "/usr/local/lib/python2.7/dist-packages/pyusb-1.0.0b1-py2.7.egg/usb/core.py", > line 711, in ctrl_transfer > self.__get_timeout(timeout) > File > "/usr/local/lib/python2.7/dist-packages/pyusb-1.0.0b1-py2.7.egg/usb/backend/libusb1.py", > line 836, in ctrl_transfer > timeout)) > File > "/usr/local/lib/python2.7/dist-packages/pyusb-1.0.0b1-py2.7.egg/usb/backend/libusb1.py", > line 571, in _check > raise USBError(_str_error[ret], ret, _libusb_errno[ret]) > usb.core.USBError: [Errno 32] Pipe error > > # SOFT_RESET > > >>> dev.ctrl_transfer(33, 2, 0, 0, " ") # i'm not sure it is correct > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File > "/usr/local/lib/python2.7/dist-packages/pyusb-1.0.0b1-py2.7.egg/usb/core.py", > line 711, in ctrl_transfer > self.__get_timeout(timeout) > File > "/usr/local/lib/python2.7/dist-packages/pyusb-1.0.0b1-py2.7.egg/usb/backend/libusb1.py", > line 836, in ctrl_transfer > timeout)) > File > "/usr/local/lib/python2.7/dist-packages/pyusb-1.0.0b1-py2.7.egg/usb/backend/libusb1.py", > line 571, in _check > raise USBError(_str_error[ret], ret, _libusb_errno[ret]) > usb.core.USBError: [Errno 32] Pipe error > > # write data > > >>> ep[0].write("aaa") > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File > "/usr/local/lib/python2.7/dist-packages/pyusb-1.0.0b1-py2.7.egg/usb/core.py", > line 287, in write > return self.device.write(self.bEndpointAddress, data, > self.interface, timeout) > File > "/usr/local/lib/python2.7/dist-packages/pyusb-1.0.0b1-py2.7.egg/usb/core.py", > line 633, in write > self.__get_timeout(timeout) > File > "/usr/local/lib/python2.7/dist-packages/pyusb-1.0.0b1-py2.7.egg/usb/backend/libusb1.py", > line 771, in bulk_write > timeout) > File > "/usr/local/lib/python2.7/dist-packages/pyusb-1.0.0b1-py2.7.egg/usb/backend/libusb1.py", > line 872, in __write > _check(retval) > File > "/usr/local/lib/python2.7/dist-packages/pyusb-1.0.0b1-py2.7.egg/usb/backend/libusb1.py", > line 571, in _check > raise USBError(_str_error[ret], ret, _libusb_errno[ret]) > usb.core.USBError: [Errno 110] Operation timed out > > > Regards and thanks for help > Perf > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users -- Best Regards, Wander Lairson Costa |