2011/2/6 The big chief <[email protected]>:
> 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.

-- 
Best Regards,
Wander Lairson Costa
LCoN - Laboratório de Computação Natural - Natural Computing Laboratory
(http://www.mackenzie.com.br/lcon.html)
Programa de Pós-Graduação em Engenharia Elétrica (PPGEE)
Faculdade de Computação e Informática (FCI)
Universidade Presbiteriana Mackenzie - SP - Brazil

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
pyusb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to