[nfc.dev.acr122] failed to retrieve ACR122U version string

Asked by Matic Perovšek

Hi,

I've been having some issues connecting with the ACR122U. I bought this item over ebay and I'm not really sure if it is working properly. Is the red light supposed to be always on? I'm using win8 64bit, zadig with libusb-win32 drivers (1.2.6.0) with pyusb 1.0.0a2.

I'm on revno: 212.

Thanks so much!
>>> import nfc
>>> nfc.ContactlessFrontend('usb:072f:2200')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "nfc\clf.py", line 106, in __init__
    raise IOError(errno.ENODEV, os.strerror(errno.ENODEV))
IOError: [Errno 19] No such device
>>>

And if I run python examples/tagtool.py -d nfc

[main] enable debug output for module 'nfc'
[nfc.clf] searching for reader with path 'usb'
[nfc.dev.transport] using pyusb version 1.x
[nfc.dev.transport] path matches '^(usb|)$'
[nfc.dev] trying usb:072f:2200
[nfc.dev] import nfc.dev.acr122
[nfc.dev.transport] >>> 6b050000000000000000ff00480000
[nfc.dev.transport] <<< 8105000000000f058100
[nfc.dev.acr122] failed to retrieve ACR122U version string
[nfc.clf] no reader found at 'usb'
[main] no contactless reader found

Any Ideas?

Question information

Language:
English Edit question
Status:
Answered
For:
nfcpy Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Matic Perovšek (mperice) said :
#1

Furthermore, I tested it on an oracle VM debian linux distribution with a mapped usb device.

============
Using the python examples/tagtool.py -d nfc I get a similar exception:

m@debian:~/Desktop/nfcpy$ python examples/tagtool.py -d nfc
[main] enable debug output for module 'nfc'
[nfc.clf] searching for reader with path 'usb'
[nfc.dev.transport] using pyusb version 1.x
[nfc.dev.transport] path matches '^(usb|)$'
[nfc.dev] trying usb:072f:2200
[nfc.dev] import nfc.dev.acr122
[nfc.clf] no reader found at 'usb'
[main] no contactless reader found

=============
lsusb:

m@debian:~/Desktop/nfcpy$ lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 003: ID 072f:2200 Advanced Card Systems, Ltd
m@debian:~/Desktop/nfcpy$ lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ohci_hcd/8p, 12M
    |__ Port 1: Dev 2, If 0, Class=HID, Driver=usbhid, 12M
    |__ Port 2: Dev 3, If 0, Class=scard, Driver=usbfs, 12M

=============
nfc-list:

m@debian:~/Desktop/nfcpy$ sudo nfc-list

nfc-list uses libnfc 1.7.0
NFC device: ACS / ACR122U PICC Interface opened
error libnfc.driver.acr122_usb PN532 didn't reply

============
pcsc_scan:

m@debian:~/Desktop/nfcpy$ pcsc_scan
PC/SC device scanner
V 1.4.21 (c) 2001-2011, Ludovic Rousseau <email address hidden>
Compiled with PC/SC lite version: 1.8.7
Using reader plug'n play mechanism
Scanning present readers...
0: ACS ACR122U PICC Interface 00 00

Sun Jan 5 19:04:37 2014
Reader 0: ACS ACR122U PICC Interface 00 00
  Card state: Card removed,

Sun Jan 5 19:04:45 2014
Reader 0: ACS ACR122U PICC Interface 00 00
  Card state: Card inserted,
  ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A

ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A
+ TS = 3B --> Direct Convention
+ T0 = 8F, Y(1): 1000, K: 15 (historical bytes)
  TD(1) = 80 --> Y(i+1) = 1000, Protocol T = 0
-----
  TD(2) = 01 --> Y(i+1) = 0000, Protocol T = 1
-----
+ Historical bytes: 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00
  Category indicator byte: 80 (compact TLV data object)
    Tag: 4, len: F (initial access data)
      Initial access data: 0C A0 00 00 03 06 03 00 01 00 00 00 00
+ TCK = 6A (correct checksum)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A
3B 8F 80 01 80 4F 0C A0 00 00 03 06 .. 00 01 00 00 00 00 ..
 Mifare Standard 1K (as per PCSC std part3)
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 .. .. 00 00 00 00 ..
 RFID - ISO 14443 Type A Part 3 (as per PCSC std part3)
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A
 Philips MIFARE Standard (1 Kbytes EEPROM)
 http://www.nxp.com/#/pip/pip=[pfp=41863]|pp=[t=pfp,i=41863]
 RFID - ISO 14443 Type A - Transport for London Oyster
 ACOS5/1k Mirfare
 RFID - ISO 14443 Type A - NXP Mifare card with 1k EEPROM
 vivotech ViVOcard Contactless Test Card
 Bangkok BTS Sky SmartPass

Sun Jan 5 19:04:45 2014
Reader 0: ACS ACR122U PICC Interface 00 00
  Card state: Card removed,

============

It seem that the device is working, as shown by pcsc_scan tool, though only with a mifare classic tag. Any suggestions what I could try next?

Revision history for this message
Stephen Tiedemann (stephen-tiedemann) said :
#2

Newer ACR122U revsions do not currently work with nfcpy but there's good chance for a fix within this week.

Revision history for this message
Stephen Tiedemann (stephen-tiedemann) said :
#3

Please re-check with revision 216 - it should be working now.

Revision history for this message
Matic Perovšek (mperice) said :
#4

Hi, I'm still getting the following on windows:

d:\Users\Matic\PycharmProjects\sportifiq_nfc_tagger>python examples/tagtool.py -
d nfc
[main] enable debug output for module 'nfc'
[nfc.clf] searching for reader with path 'usb'
[nfc.dev.transport] using pyusb version 1.x
[nfc.dev.transport] path matches '^(usb|)$'
[nfc.dev] trying usb:072f:2200
[nfc.dev] import nfc.dev.acr122
[nfc.dev.transport] >>> 6f050000000000000000ff00480000
[nfc.dev.transport] <<< 80080000000000008100d503320106079000
[nfc.dev.acr122] failed to retrieve ACR122U version string
[nfc.clf] no reader found at 'usb'
[main] no contactless reader found

And on every second run this:

d:\Users\Matic\PycharmProjects\sportifiq_nfc_tagger>python examples/tagtool.py -
d nfc
[main] enable debug output for module 'nfc'
[nfc.clf] searching for reader with path 'usb'
[nfc.dev.transport] using pyusb version 1.x
[nfc.dev.transport] path matches '^(usb|)$'
[nfc.dev] trying usb:072f:2200
[nfc.dev] import nfc.dev.acr122
[nfc.dev.transport] >>> 6f050000000000000000ff00480000
[nfc.dev.transport] <<< 800a000000000000810041435231323255323130
[nfc.dev.acr122] initialize ACR122U210
[nfc.dev.acr122] CCID ICC-POWER-ON
[nfc.dev.transport] >>> 62000000000000000000
[nfc.dev.transport] <<< 800a000000000000810041435231323255323130
[nfc.dev.acr122] Set PICC Operating Parameters
[nfc.dev.transport] >>> 6f050000000000000000ff00517f00
[nfc.dev.transport] <<< 800200000000000003fd3b00
[nfc.dev.acr122] Configure Buzzer and LED
[nfc.dev.transport] >>> 6f090000000000000000ff00400e0400000000
[nfc.dev.transport] <<< 800200000000000081006a81
[nfc.dev.acr122] PN53x GetFirmwareVersion called with timeout 100 ms
[nfc.dev.transport] >>> 6f070000000000000000ff00000002d402
[nfc.dev.transport] <<< 800200000000000081009000
[nfc.dev.acr122] insufficient data for decoding chip response
[nfc.clf] no reader found at 'usb'
[main] no contactless reader found

Hope this helps somehow ...

Revision history for this message
Stephen Tiedemann (stephen-tiedemann) said :
#5

The reader always returns the answer to the command sent one before. I have
observe that same behaviour with my ACR122U216 (labelled A9) after
host/reader communication failed - the only way to get out was to re-plug
the device.

Revision history for this message
Matic Perovšek (mperice) said :
#6

Ok, now on every first try after replugging the device I get:

d:\Users\Matic\PycharmProjects\sportifiq_nfc_tagger>python examples/tagtool.py -
d nfc
[main] enable debug output for module 'nfc'
[nfc.clf] searching for reader with path 'usb'
[nfc.dev.transport] using pyusb version 1.x
[nfc.dev.transport] path matches '^(usb|)$'
[nfc.dev] trying usb:072f:2200
[nfc.dev] import nfc.dev.acr122
[nfc.dev.transport] >>> 6f050000000000000000ff00480000
[nfc.dev.transport] <<< 820700000000cf0081011100014d00fe00
[nfc.dev.acr122] expected a RDR_to_PC_DataBlock
[nfc.clf] no reader found at 'usb'
[main] no contactless reader found

How can I check which type of ACR122 reader do I have (there is no label at the back)?

Revision history for this message
Stephen Tiedemann (stephen-tiedemann) said :
#7

This is a RDR_to_PC_Parameters response which hasn't been asked for. What
only I could imagine is that there is another process/daemon running that
communicates with the reader in parallel (and does not properly lock device
access). Apart from that, your device is an ACR122U210 according to earlier
logs you've posted.

Revision history for this message
Matic Perovšek (mperice) said :
#8

I tried restarting the computer, plugging and unplugging the device ... doesn't help. A don't have any programs or processes running that would communicate with the device. Only windows. It's always like this: on the first run of tagtool.py I get the RDR_to_PC response and on the second run the insufficient data for decoding chip response, basically the same as described in answer #4.

btw I cannot get the reader to work in Windows in safe mode nor on a debian machine in the VirtualBox, though the sudo nfc-list find the device.

Revision history for this message
Stephen Tiedemann (stephen-tiedemann) said :
#9

I'm afraid I can't provide more help. Maybe it's really just a broken device and you'd need to look for some better. If you'd ever wanted to run peer-to-peer exchange with a smartphone it'd be a bad choice anyway.

Revision history for this message
Nacho Álvarez (neonigma) said :
#10

Matic,

try to install pyserial. I've got so strange errors when using nfcpy after 1 year without send a new commit to an old project in a new computer and see things like you comment.

When pyserial was installed, I ran 'sudo python examples/snep-test-server.py' and things was working again.

I think although ACR122U is a USB reader, it's using classical serial communication in a certain way.

Can you help with this problem?

Provide an answer of your own, or ask Matic Perovšek for more information if necessary.

To post a message you must log in.