Skip to main content

Using the ACS ACR122 NFC card reader under linux

If you are seeing some errors in the logs like the ones below:

pcscd[4489]: 58837251 ccid_usb.c:645:OpenUSBByName() Can't claim interface 001/110: Device or resource busy
pcscd[4489]: 00040743 ifdhandler.c:118:IFDHCreateChannelByName() failed
pcscd[4489]: 00000030 readerfactory.c:1043:RFInitializeReader() Open Port 0x200000 Failed (usb:072f/2200:libudev:0:/dev/bus/usb/001/110)
pcscd[4489]: 00000008 readerfactory.c:335:RFAddReader() ACS ACR122U init failed.

You need to prevent the kenel nfc drivers loading so add the following lines to /etc/modprobe.d/rfid-blacklist.conf

blacklist pn533
blacklist nfc

as suggested here: http://maciaszek.net/26522/rfid-reader-mit-debian/

Then remove those modules with modprobe -r pn533 nfc

Then install some packages

apt-get install libpcsclite1 pcsc-tools pcscd

Then run:

pcsc_scan

You should get some output similar to the stuff below.

PC/SC device scanner
V 1.4.23 (c) 2001-2011, Ludovic Rousseau <[email protected]>
Compiled with PC/SC lite version: 1.8.11
Using reader plug'n play mechanism
Scanning present readers...
0: ACS ACR122U 00 00

Thu Jan 22 23:00:58 2015
Reader 0: ACS ACR122U 00 00
  Card state: Card removed,

Thu Jan 22 23:01:06 2015
Reader 0: ACS ACR122U 00 00
  Card state: Card inserted,
  ATR: 3B 8F 81 01 80 4F 0C A0 00 00 04 06 03 00 01 00 00 00 00 6A

ATR: 3B 8F 81 01 80 4F 0C A0 00 00 04 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 04 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 04 06 03 00 01 00 00 00 00
+ TCK = 6A (correct checksum)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B 8F 81 01 80 4F 0C A0 00 00 03 06 04 00 01 00 00 00 00 6A
3B 8F 81 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 81 01 80 4F 0C A0 00 00 03 06 04 00 01 00 00 00 00 6A
3B 8F 81 01 80 4F 0C A0 00 00 03 06 04 .. .. 00 00 00 00 ..
    RFID - ISO 14443 Type A Part 3 (as per PCSC std part3)
3B 8F 81 01 80 4F 0C A0 00 00 03 06 04 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

More next time.

Comments

Comments powered by Disqus
Mastodon: @[email protected] Flattr me