Hi Wander, You were right: suppressing the "device.reset()" has solved the problem.
Here is the printout you requested... If you need more info, don't hesitate to ask! BR, Jacques-D. PS: I may be able to give you remote access if you need. root@osse:~# root@osse:~# export PYUSB_DEBUG_LEVEL=debug root@osse:~# python /net/gandalf/srv/home/jdp/komodo/fs20/src/test_libusb10_a.py 2011-02-07 21:59:22,382 INFO:usb.core:find(): using backend "usb.backend.libusb10" 2011-02-07 21:59:22,382 DEBUG:usb.backend.libusb10:_LibUSB.enumerate_devices() 2011-02-07 21:59:22,383 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087ed0>) 2011-02-07 21:59:22,384 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>) 2011-02-07 21:59:22,384 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087f50>) 2011-02-07 21:59:22,384 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>) 2011-02-07 21:59:22,384 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087ed0>) 2011-02-07 21:59:22,384 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>) 2011-02-07 21:59:22,385 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087f50>) 2011-02-07 21:59:22,385 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>) 2011-02-07 21:59:22,385 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087ed0>) 2011-02-07 21:59:22,385 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>) 2011-02-07 21:59:22,385 DEBUG:usb.backend.libusb10:_LibUSB.open_device(<usb.backend.libusb10._Device object at 0x7f881f087fd0>) 2011-02-07 21:59:22,386 DEBUG:usb.backend.libusb10:_LibUSB.is_kernel_driver_active(c_void_p(41012208), 0) 2011-02-07 21:59:22,386 DEBUG:usb.backend.libusb10:_LibUSB.detach_kernel_driver(c_void_p(41012208), 0) 2011-02-07 21:59:22,386 DEBUG:usb.backend.libusb10:_LibUSB.get_configuration_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>, 0) 2011-02-07 21:59:22,386 DEBUG:usb.backend.libusb10:_LibUSB.set_configuration(c_void_p(41012208), 1) 2011-02-07 21:59:22,388 DEBUG:usb.backend.libusb10:_LibUSB.reset_device(c_void_p(41012208)) 2011-02-07 21:59:22,652 DEBUG:usb.backend.libusb10:_LibUSB.close_device(c_void_p(41012208)) 2011-02-07 21:59:22,652 DEBUG:usb.backend.libusb10:_LibUSB.get_configuration_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>, 0) 2011-02-07 21:59:22,653 DEBUG:usb.backend.libusb10:_LibUSB.get_interface_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>, 0, 0, 0) 2011-02-07 21:59:22,653 DEBUG:usb.backend.libusb10:_LibUSB.get_configuration_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>, 0) 2011-02-07 21:59:22,653 DEBUG:usb.backend.libusb10:_LibUSB.get_interface_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>, 0, 0, 0) 2011-02-07 21:59:22,653 DEBUG:usb.backend.libusb10:_LibUSB.get_configuration_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>, 0) 2011-02-07 21:59:22,653 DEBUG:usb.backend.libusb10:_LibUSB.get_endpoint_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>, 0, 0, 0, 0) 2011-02-07 21:59:22,653 DEBUG:usb.backend.libusb10:_LibUSB.get_interface_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>, 0, 0, 0) 2011-02-07 21:59:22,653 DEBUG:usb.backend.libusb10:_LibUSB.get_configuration_descriptor(<usb.backend.libusb10._Device object at 0x7f881f087fd0>, 0) Send a code... 2011-02-07 21:59:22,654 DEBUG:usb.backend.libusb10:_LibUSB.get_configuration(None) Erreur de segmentation root@osse:~# Le 07. 02. 11 10:42, wander.lairson a écrit : > 2011/2/6 The big chief<jacques.pig...@bluewin.ch>: >> Hi USB peoples, >> > [snip] > >> I try the following code: >> >> >> """ >> Copied (partially) from: >> >> Read a MagTek USB HID Swipe Reader in Linux. A description of this >> code can be found at: >> http://www.micahcarrick.com/credit-card-reader-pyusb.html >> >> You must be using the new PyUSB 1.0 branch and not the 0.x branch. >> >> Copyright (c) 2010 - Micah Carrick >> """ >> >> >> import sys >> import usb.core >> import usb.util >> >> VENDOR_ID=0x18ef >> PRODUCT_ID=0xe014 >> DATA_SIZE=13 >> >> device = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID) >> >> if device.is_kernel_driver_active(0): >> try: >> device.detach_kernel_driver(0) >> except usb.core.USBError as e: >> sys.exit("Could not detatch kernel driver: %s" % str(e)) >> >> try: >> device.set_configuration() >> device.reset() > I think the problem is here, you reset the device After setup it. > Comment out the "device.reset" line and test again. > > [snip] > >> And got the following result: >> >> jdp@osse:~$ >> jdp@osse:~$ sudo python >> /net/gandalf/srv/home/jdp/komodo/fs20/src/test_libusb10_a.py >> Send a code... >> Try to read... 129 48 >> Erreur de segmentation >> jdp@osse:~$ >> > Anyway, there is no reason for a segmentation fault. Please, set the > env variavle PYUSB_DEBUG_LEVEL=debug, running it again and send us the > output. > ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users