Windows

Asked by Rafael on 2016-10-14

Hi,

I have reader ACR122U and I installed Python 2.7, libusb1, pyserial, winUSB with zadig, libusb, all!. When you run Tagtool, with the latest version 0.11, it shows me this error.

C:\Users\rhida\OneDrive\Documents\NFC>python examples/tagtool.py
[nfc.clf] searching for reader on path usb
Traceback (most recent call last):
  File "examples/tagtool.py", line 581, in <module>
    TagTool().run()
  File "C:\Users\rhida\OneDrive\Documents\NFC\examples\cli.py", line 461, in run
    while self.run_once() and self.options.loop:
  File "C:\Users\rhida\OneDrive\Documents\NFC\examples\cli.py", line 388, in run_once
    clf = nfc.ContactlessFrontend(path)
  File "C:\Users\rhida\OneDrive\Documents\NFC\nfc\clf\__init__.py", line 71, in __init__
    if path and not self.open(path):
  File "C:\Users\rhida\OneDrive\Documents\NFC\nfc\clf\__init__.py", line 145, in open
    self.device = device.connect(path)
  File "C:\Users\rhida\OneDrive\Documents\NFC\nfc\clf\device.py", line 84, in connect
    device = driver.init(transport.USB(bus, dev))
  File "C:\Users\rhida\OneDrive\Documents\NFC\nfc\clf\transport.py", line 212, in __init__
    self.open(usb_bus, dev_adr)
  File "C:\Users\rhida\OneDrive\Documents\NFC\nfc\clf\transport.py", line 262, in open
    self.usb_dev = dev.open()
  File "C:\Python27\lib\site-packages\usb1.py", line 1953, in open
    mayRaiseUSBError(libusb1.libusb_open(self.device_p, byref(handle)))
  File "C:\Python27\lib\site-packages\usb1.py", line 133, in mayRaiseUSBError
    __raiseUSBError(value)
  File "C:\Python27\lib\site-packages\usb1.py", line 125, in raiseUSBError
    raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorIO: LIBUSB_ERROR_IO [-1]

Although in Linux if it works, but I want to create an executable for Windows.
Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
nfcpy Edit question
Assignee:
No assignee Edit question
Solved by:
Stephen Tiedemann
Solved:
2016-11-13
Last query:
2016-11-13
Last reply:
2016-11-07

Have you followed step 3 from http://nfcpy.readthedocs.io/en/latest/topics/get-started.html#installation? Which version of Windows are you working on? Do you have other Windows versions to test with? I have only very limited access to Windows installations and it's difficult to guess why already the device open call fails. There may be access rights or other programs/drivers claiming the hardware. Least the reported error is about basic input/output and that could be anything.

Rafael (hibara94) said : #2

Yes, I have followed all the steps as shown in the documentation. I have Windows 10, 64 bits, I have other Windows for testing, I guess it will be updated for use in Windows 10. It may be that mistake?

Thanks very much

Rafael (hibara94) said : #3

I tried again in Windows 10, 64 bits, following all the steps and show me the same error. How can I solve that??

C:\Users\rhida\OneDrive\Documents\NFC>python examples/tagtool.py
[nfc.clf] searching for reader on path usb
Traceback (most recent call last):
  File "examples/tagtool.py", line 581, in <module>
    TagTool().run()
  File "C:\Users\rhida\OneDrive\Documents\NFC\examples\cli.py", line 461, in run
    while self.run_once() and self.options.loop:
  File "C:\Users\rhida\OneDrive\Documents\NFC\examples\cli.py", line 388, in run_once
    clf = nfc.ContactlessFrontend(path)
  File "C:\Users\rhida\OneDrive\Documents\NFC\nfc\clf\__init__.py", line 71, in __init__
    if path and not self.open(path):
  File "C:\Users\rhida\OneDrive\Documents\NFC\nfc\clf\__init__.py", line 145, in open
    self.device = device.connect(path)
  File "C:\Users\rhida\OneDrive\Documents\NFC\nfc\clf\device.py", line 84, in connect
    device = driver.init(transport.USB(bus, dev))
  File "C:\Users\rhida\OneDrive\Documents\NFC\nfc\clf\transport.py", line 212, in __init__
    self.open(usb_bus, dev_adr)
  File "C:\Users\rhida\OneDrive\Documents\NFC\nfc\clf\transport.py", line 262, in open
    self.usb_dev = dev.open()
  File "C:\Python27\lib\site-packages\usb1.py", line 1953, in open
    mayRaiseUSBError(libusb1.libusb_open(self.device_p, byref(handle)))
  File "C:\Python27\lib\site-packages\usb1.py", line 133, in mayRaiseUSBError
    __raiseUSBError(value)
  File "C:\Python27\lib\site-packages\usb1.py", line 125, in raiseUSBError
    raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorIO: LIBUSB_ERROR_IO [-1]

Rafael (hibara94) said : #4

Hello! I tried it on Windows 7, 64-bit, following all the steps, and I can think the same as in Windows 10, the same error?

How can I solve that??

I've tested with a fresh install of Windows 10 (64bit) an two different NFC reader (Sony RC-S380 and SCM SCL3711). I've installed Python 2.7 32bit because that came as the default download and I didn't notice. What I've noticed later was that the 32 bit version of libusb-1.0.dll then has to be placed in C:\Windows\SysWOW64. Apart from that, both readers worked fine after installing WinUSB driver with Zadig (I've noted that some patience is required to let Windows finish driver search).

Rafael (hibara94) said : #6

Hello !, I have tried again and does not work. You can tell me step by step how you do it? I need to have it for Windows and can not.

Thankss!!

I've installed a fresh Windows 10 (64bit) in a virtual machine. Then installed Python 2.7 (meanwhile tested with both 32bit an 64bit version) and run "C:\Pytheon27\Scripts\pip.exe install nfcpy" (this also installs libusb1 and pyserial).

Then download and unpack "libusb-1.0.20.7z". Copy "MS64\dll\libusb-1.0.dll" to "C:\Windows\System32\" and "MS32\dll\libusb-1.0.dll" to "C:\Windows\SysWOW64\" (the latter is only needed for Python 32bit).

Download "Zadig for Windows Vista or later". Connect reader and wait for Windows driver installation to finish (for RC-S380 result was no driver found, for SCL3711 default drivers are installed). Unplug and reconnect reader and use Zadig to install WinUSB for the device. Unplug and reconnect again.

Run C:\Python27\python.exe and do:

import nfc
clf = nfc.ContactlessFrontened("usb")
clf.close()

Rafael (hibara94) said : #8

Thanks Stephen Tiedemann, that solved my question.