2013/1/6 Ryan Speers <rmspe...@gmail.com>: > Hi, > > Still seem to be having issues. Here is what happens when I try the reset: > > Code: > > def __dev_setup_v1x(self): > # See http://pyusb.sourceforge.net/docs/1.0/tutorial.html > for reference > self.dev.reset() > self.dev.set_configuration(1) # could also provide no config > number > self.dev.set_interface_altsetting(interface = 0, > alternate_setting = 0) > > and then call: > > print("Going to reset device in pnext") > self.__dev_setup_v1x() > print("Reset device in pnext") > pdata = self.dev.read(RZ_USB_PACKET_EP, 1, 0, 100) > print "Got data:", pdata > #TODO error handling > > In the stdout, none of these print statements occur, because earlier in > the program, the segfault seems to be occurring. > > Errors show up in dmesg (my program is zbdump): > > [136285.914272] zbdump[23955]: segfault at 0 ip 00007f7a81ac3adf sp > 00007ffff582a1c0 error 4 in libusb-0.1.so.4.4.4[7f7a81abf000+6000] > [136330.293333] zbdump[23966]: segfault at 0 ip 00007f99d49c0adf sp > 00007fffdddc6500 error 4 in libusb-0.1.so.4.4.4[7f99d49bc000+6000] > ** then i unplug and replug it back in ** > [136336.153684] usb 3-2: USB disconnect, device number 20 > [136338.438720] usb 3-2: new full-speed USB device number 21 using xhci_hcd > [136344.899891] zbdump[23984]: segfault at 0 ip 00007f9326bd3adf sp > 00007fffc47d8b90 error 4 in libusb-0.1.so.4.4.4[7f9326bcf000+6000] > > I also tried moving the reset() call out of the __dev_setup_v1x because > that seems to be causing the issue (a reset before full initialization, > perhaps?). In this case, we get further, but the previous error still > occurs: > > Code: > print("Going to reset device in pnext") > self.dev.reset() > self.__dev_setup_v1x() > print("Reset device in pnext") > pdata = self.dev.read(RZ_USB_PACKET_EP, 1, 0, 100) > print "Got data:", pdata > > Output: > zbdump: listening on '3:21', link-type DLT_IEEE802_15_4, capture size > 127 bytes > Going to reset device in pnext > Reset device in pnext > Traceback (most recent call last): > File "/usr/local/bin/zbdump", line 100, in <module> > packet = kb.pnext() > File "/usr/local/lib/python2.7/dist-packages/killerbee/__init__.py", > line 270, in pnext > return self.driver.pnext(timeout) > File > "/usr/local/lib/python2.7/dist-packages/killerbee/dev_rzusbstick.py", > line 430, in pnext > pdata = self.dev.read(RZ_USB_PACKET_EP, 1, 0, 100) > > So, am I doing the reset() and then setup again wrong, or is the reset() > not solving the base issue? > > Thanks, > Ryan > > On 01/03/2013 08:52 AM, Wander Lairson Costa wrote: >> 2012/12/30 Ryan Speers <rmspe...@gmail.com>: >>> Hi, >>> >>> Thanks again for the help with this... >>> >>> I tried the suggestion, using the below code snippits: >>> >>> import usb.core >>> import usb.util >>> import usb.backend.libusb01 >>> backend = usb.backend.libusb01.get_backend() >>> >>> devs = usb.core.find(backend=backend, find_all=True, >>> custom_match=findFromList(vendor, product)) >>> >>> It appears to be a similar/same issue in terms of symptoms. Again, the >>> issue seems to be the SECOND read/write operation after I plug a new >>> device in -- the first one works. >>> >>> ~/killerbee/killerbee$ sudo zbid >>> Warning: You are using pyUSB 1.x, support is in alpha. >>> Dev Product String Serial Number >>> 3:4 KILLERB001 A50400A01C25 >>> Found 1 devices. >>> >>> ~/killerbee/killerbee$ sudo zbdump -f 11 -w test.pcap -i 3:4 >>> Warning: You are using pyUSB 1.x, support is in alpha. >>> Warning: You are using pyUSB 1.x, support is in alpha. >>> zbdump: listening on '3:4', link-type DLT_IEEE802_15_4, capture size 127 >>> bytes >>> Traceback (most recent call last): >>> File "/usr/local/bin/zbdump", line 100, in <module> >>> packet = kb.pnext() >>> File "/usr/local/lib/python2.7/dist-packages/killerbee/__init__.py", >>> line 270, in pnext >>> return self.driver.pnext(timeout) >>> File "/usr/local/lib/python2.7/dist-packages/killerbee/dev_rzusbstick.py", >>> line 443, in pnext >>> pdata = self.dev.read(RZ_USB_PACKET_EP, 1, 0, 100) >>> File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 654, in >>> read >>> self.__get_timeout(timeout) >>> File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb01.py", >>> line 483, in bulk_read >>> timeout) >>> File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb01.py", >>> line 568, in __read >>> timeout >>> File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb01.py", >>> line 384, in _check >>> raise USBError(errmsg, ret) >>> usb.core.USBError: [Errno None] Connection timed out >>> >>> This timeout error happens on the second USB related call within the >>> zbdump program. Removing and reinserting the device fixes the issue. >>> The same symptom occurs when I import libusb10 and use that >>> explicitly. Do you have other ideas for what this could be? Is a >>> resource not getting properly released? >>> >> What about doing a 'reset' call and setting up the device again? >> >
"reset" seems to not solving anything. The most weird part if that it works with libusb 0.1 -- Best Regards, Wander Lairson Costa ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users