charlysan / pyrfidhid

Python library to control Chinese USB HID 125Khz RFID Reader/Writer
MIT License
142 stars 36 forks source link

usb.core.USBError: [Errno 32] Pipe error #5

Closed martinayotte closed 3 years ago

martinayotte commented 5 years ago

Hi Charlysan, I've install you library and trying to run it failed :

root@orangepipcplus:~/pyrfidhid-master# python examples/read.py 
Initializing device...
Traceback (most recent call last):
  File "examples/read.py", line 76, in <module>
    main()
  File "examples/read.py", line 48, in main
    rfid.init()
  File "build/bdist.linux-armv7l/egg/rfidhid/core.py", line 58, in init
  File "build/bdist.linux-armv7l/egg/rfidhid/usb_hid.py", line 43, in get_report_descriptor
  File "build/bdist.linux-armv7l/egg/usb/control.py", line 173, in get_descriptor
  File "build/bdist.linux-armv7l/egg/usb/core.py", line 1043, in ctrl_transfer
  File "build/bdist.linux-armv7l/egg/usb/backend/libusb1.py", line 883, in ctrl_transfer
  File "build/bdist.linux-armv7l/egg/usb/backend/libusb1.py", line 595, in _check
usb.core.USBError: [Errno 32] Pipe error

I've also tried on my own desktop, and it is failing with the same stacktrace ... Any idea ?

charlysan commented 5 years ago

Hi @martinayotte,

A similar issue has been reported by another user here.

lhlong commented 4 years ago

Hi @martinayotte,

A similar issue has been reported by another user here.

  • Are you sure your device is the the one described at the wiki section?
  • Have you checked that your device has this vid:pid pair? (ffff:0035)
  • Does your device work with IDRW Windows app?

Have same problem. Hi @charlysan I checked on ubuntu/mac and it didn't work.

charlysan commented 4 years ago

Hi @lhlong,

I'm almost sure that your device is not supported by my library. I will add a better error handling to show an error message for these cases. Please provide the specs for your device so I can double check.

lhlong commented 4 years ago

Hi @charlysan, Thank for your reply.

My device infos: Bus 001 Device 003: ID 08ff:0009 AuthenTec, Inc.

What is the version of pyusb we use?

martinayotte commented 4 years ago

In my case : Bus 003 Device 002: ID 072f:2200 Advanced Card Systems, Ltd ACR122U

It is working well when using python-pyscard along with pcscd daemon.

charlysan commented 4 years ago

@martinayotte, ACR122U is a 13.56MHZ reader, it is not compatible with pyrfidhid (125KHZ).

jacobcui commented 4 years ago

hi @charlysan I failed on this error too. I've set vid:pid correctly. Here is my lsusb output:

Bus 001 Device 011: ID 6688:6850 CTX 203-ID-RW

charlysan commented 4 years ago

@jacobcui, does your device work with IDRW v3 windows app? If not, then you will not be able to use this library, as for the moment it only supports devices that works with that app. I will create a fix though to show a more descriptive error message for those cases.

jacobcui commented 4 years ago

Yes my device works with the mentioned Windows app.

On Wed, 27 Nov 2019 at 23:49, charlysan notifications@github.com wrote:

@jacobcui https://github.com/jacobcui, does your device work with IDRW v3 windows app? If not, then you will not be able to use this library. I will create a fix though to show a more descriptive error message for those cases.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/charlysan/pyrfidhid/issues/5?email_source=notifications&email_token=AA3ZUICL3ARKIRLRNGDZ5GTQVZUHBA5CNFSM4HKWMO6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFJMYBI#issuecomment-559074309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3ZUIDIRXTZXPQQDOW2NF3QVZUHBANCNFSM4HKWMO6A .

charlysan commented 4 years ago

@jacobcui, could you please provide the output you get from this command?

sudo lsusb -vd 6688:6850

Which OS are you using?

A picture of the back of the device might be useful too (like the one I included in the wiki)

charlysan commented 4 years ago

@lhlong, sorry for the delay; I missed your last post. I've been using pyusb 1.0.2. Same question for you, does your device work with IDRW v3 windows app?

charlysan commented 3 years ago

I'm closing this issue as all the errors described above seem to be related to unsupported devices. I've included better error handling in version v1.1.4, so you should see now a more verbose error message for any core.usb.USBError exceptions.