1 (edited by langeron 2013-07-24 17:19:28)

Topic: Cardreader ACR 1222U and libnfc

Hello All,
I have a card reader ACR1222U-C3
this cardreader is very similar to ACR122U according to the specs on the website ACR but has a different color.
I installed libnfc-1.7.0-rc7 but

nfc-list-v
nfc-list uses libnfc 1.7.0-rc7
No NFC device found.

Please tell me what I can do to add the card reader to the list of supported libnfc?
Is it possible for solve this problem to use a driver written for ACR122U and what needs to change in other files.
Many thanks.

Re: Cardreader ACR 1222U and libnfc

Hi,

You could try:
nfc-scan-device -v

But I don't think it will be useful.

Next, you can try to add the vendor ID and product ID of your device to acr122_usb_supported_device struct in libnfc/drivers/acr122_usb.c

Please give us some feedback smile

Romuald Conty

3 (edited by langeron 2013-07-30 17:08:35)

Re: Cardreader ACR 1222U and libnfc

Hi and thank you for your answer.

I try to use the comand

nfc-scan-device -v

but I have the answer:

nfc-scan-device uses libnfc 1.7.0-rc7
No NFC device found.

If I use the

lsusb

I have an answer:

...
Bus 002 Device 006: ID 072f:1280 Advanced Card Systems, Ltd
...

In my opinion this line points to the card reader.
In the acsccid-1.0.4 library I found the same information 

...
072F 1280 ACR1222U-C3         ACS ACR1222 1SAM Dual Reader
...

I edit the enum

typedef enum {
  UNKNOWN,
  ACR122,
  ACR1222,
  TOUCHATAG,
} acr122_usb_model;

and the struct:

const struct acr122_usb_supported_device acr122_usb_supported_devices[] = {
  { 0x072F, 0x2200, ACR122,   "ACS ACR122" },
  { 0x072F, 0x90CC, TOUCHATAG,   "Touchatag" },
  { 0x072F, 0x1280, ACR1222,   "ACS ACR1222" }
};

and save file after this

3 comands for install nfc lib:

./configure
....
make
...
sudo make install

after success installation I use the comand:

nfc-scan-device -v

But I have the error answer:

nfc-scan-device uses libnfc 1.7.0-rc7
1 NFC device(s) found:
error    libnfc.driver.acr122_usb    Unable to claim USB interface (Operation not permitted)
nfc_open failed for acr122_usb:002:006

If I try to use

sudo nfc-list

I have an answer

nfc-list uses libnfc 1.7.0-rc7
error    libnfc.driver.acr122_usb    Too small reply
nfc-list: ERROR: Unable to open NFC device: acr122_usb:002:003

Could You help?

Many thanks.

4 (edited by d.giordan88 2013-07-30 19:30:10)

Re: Cardreader ACR 1222U and libnfc

Hi, I don't know if can work for you. But try to re install libnfc with the PCSC driver. Because you are using the USB driver, but the does not work really well.

To install the PCSC driver I think you should use:

./configure --with-drivers=acr122_pcsc

Re: Cardreader ACR 1222U and libnfc

Hi and thank you for the tip

d.giordan88 wrote:

Hi, I don't know if can work for you. But try to re install libnfc with the PCSC driver. Because you are using the USB driver, but the does not work really well.

To install the PCSC driver I think you should use:

./configure --with-drivers=acr122_pcsc

I try to configure nfc-lib using this parametr and install nfc-lib

nfc-list -v
nfc-list uses libnfc 1.7.0-rc7
error    libnfc.driver.acr122_pcsc    No ACR122 firmware received, Error: 80100016
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 00
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 01
error    libnfc.driver.acr122_pcsc    No ACR122 firmware received, Error: 80100016
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 02

I try to edit acr122_pcsc.c
I change

const char *supported_devices[] = {
  "ACS ACR122",         // ACR122U & Touchatag, last version
  "ACS ACR 38U-CCID",   // Touchatag, early version
  "ACS ACR38U-CCID",    // Touchatag, early version, under MacOSX
  "ACS AET65",          // Touchatag using CCID driver version >= 1.4.6
  "ACS ACR1222",
  "    CCID USB",       // ??
  NULL
};

and

#define FIRMWARE_TEXT "ACR1222U"

But the problem persists
Please help find the cause of this error

Re: Cardreader ACR 1222U and libnfc

Unfortunately I don't know how to solve the situation.
All I can suggest is to try following this commands:

wget libnfc.googlecode.com/files/libnfc-1.7.0-rc4.tar.gz
tar -xvzf libnfc-1.7.0-rc4.tar.gz
rm libnfc-1.7.0-rc4.tar.gz
cd ~
cd libnfc-1.7.0-rc4
./configure --with-drivers=acr122_pcsc && make clean
make clean
make
make install
sudo sh -c "echo /usr/local/lib > /etc/ld.so.conf.d/usr-local-lib.conf"
sudo ldconfig
cd

That is the solution I found here. It worked for me.

Re: Cardreader ACR 1222U and libnfc

Hi and thank you for this solve of your problem.

I try to use rc4 version and use this script, but I the main problem persists.
I turned back to rc7 version.

The main problem now is the 80100016 error.

nfc-list
nfc-list uses libnfc 1.7.0-rc7
error    libnfc.driver.acr122_pcsc    No ACR122 firmware received, Error: 80100016
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 00
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 01
error    libnfc.driver.acr122_pcsc    No ACR122 firmware received, Error: 80100016
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 02

I read README file and read this themes:
libnfc.org/community/topic/134/problem-with-new-130-release-reader-not-detected-without-card-on-top/
libnfc.org/community/topic/479/acr122ut-and-nfcconnect/
libnfc.org/community/topic/262/

In my case the card on the top of the cardreader and pcsc scan can see it, but lib nfc write error.

pcsc_scan
PC/SC device scanner
V 1.4.18 (c) 2001-2011, Ludovic Rousseau <ludovic.rousseau@free.fr>
Compiled with PC/SC lite version: 1.7.4
Using reader plug'n play mechanism
Scanning present readers...
0: ACS ACR1222 1SAM Dual Reader 00 00
1: ACS ACR1222 1SAM Dual Reader 00 01
2: ACS ACR1222 1SAM Dual Reader 00 02

Tue Aug  6 09:14:04 2013
Reader 0: ACS ACR1222 1SAM Dual Reader 00 00
  Card state: Card removed,
Reader 1: ACS ACR1222 1SAM Dual Reader 00 01
  Card state: Card inserted,
  ATR: 3B 88 80 01 4A 43 4F 50 76 32 34 31 5E

ATR: 3B 88 80 01 4A 43 4F 50 76 32 34 31 5E
+ TS = 3B --> Direct Convention
+ T0 = 88, Y(1): 1000, K: 8 (historical bytes)
  TD(1) = 80 --> Y(i+1) = 1000, Protocol T = 0
-----
  TD(2) = 01 --> Y(i+1) = 0000, Protocol T = 1
-----
+ Historical bytes: 4A 43 4F 50 76 32 34 31
  Category indicator byte: 4A (proprietary format)
+ TCK = 5E (correct checksum)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B 88 80 01 4A 43 4F 50 76 32 34 31 5E
    RFID - ISO 14443 Type A -  NXP JCOP
Reader 2: ACS ACR1222 1SAM Dual Reader 00 02
  Card state: Card inserted, Unresponsive card,

Tue Aug  6 09:14:04 2013
Reader 2: ACS ACR1222 1SAM Dual Reader 00 02
  Card state: Card removed,

in LOG LEVEL 3 there is the next messages:

LIBNFC_LOG_LEVEL=3 nfc-list -v
info    libnfc.config    Unable to open file: /usr/local/etc/nfc/libnfc.conf
debug    libnfc.config    Unable to open directory: /usr/local/etc/nfc/devices.d
debug    libnfc.general    log_level is set to 3
debug    libnfc.general    allow_autoscan is set to true
debug    libnfc.general    allow_intrusive_scan is set to false
debug    libnfc.general    0 device(s) defined by user
nfc-list uses libnfc 1.7.0-rc7
debug    libnfc.general    3 device(s) found using acr122_pcsc driver
debug    libnfc.driver.acr122_pcsc    Attempt to open ACS ACR1222 1SAM Dual Reader 00 00
debug    libnfc.driver.acr122_pcsc    PCSC connect failed
debug    libnfc.general    Unable to open "acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 00".
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 00
debug    libnfc.driver.acr122_pcsc    Attempt to open ACS ACR1222 1SAM Dual Reader 00 01
debug    libnfc.driver.acr122_pcsc    PCSC connect failed
debug    libnfc.general    Unable to open "acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 01".
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 01
debug    libnfc.driver.acr122_pcsc    Attempt to open ACS ACR1222 1SAM Dual Reader 00 02
error    libnfc.driver.acr122_pcsc    No ACR122 firmware received, Error: 80100016
debug    libnfc.general    Unable to open "acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 02".
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR1222 1SAM Dual Reader 00 02

Perhaps there is a code has the ACR122U reader check and need to make any changes or even to connect a new type of reader (ACR1222 U). I kindly request to respond to people involved in the development of drivers.

Re: Cardreader ACR 1222U and libnfc

langeron wrote:

The main problem now is the 80100016 error.

Hi,
I have exactly the same problem.
Even the output matches.

For the record, I am on Ubuntu 12.04.4  64 bits
Using Libnfc-1.7.0
Cardreader is the infamous acr122U-A9.

If needed, I can provide the output of the commands.

Any one stumbled on a solution???

Regards Frits

Re: Cardreader ACR 1222U and libnfc

Which driver are you using?
libnfc.driver.acr122_pcsc or libnfc.driver.acr122_usb?
Nowadays I think the usb version is more stable, use it if possible.
From the error of the previous person, it sounds like he was using pcsc but couldn't connect pcsc daemon.
If you want to use the pcsc version, can you check you can talk to the pcsc daemon by executing "pcsc_scan" ?

Phil

10 (edited by fritsimeel 2014-02-17 18:21:40)

Re: Cardreader ACR 1222U and libnfc

Hi yobibe,

I did the pcsc_scan,
Initially I get this:
frits@frits-hpubuntu:~/Documents/libnfc-1.7.0$ pcsc_scan
PC/SC device scanner
V 1.4.18 (c) 2001-2011, Ludovic Rousseau <ludovic.rousseau@free.fr>
Compiled with PC/SC lite version: 1.7.4
Using reader plug'n play mechanism
Scanning present readers...
0: ACS ACR122U PICC Interface 00 00

Mon Feb 17 19:13:36 2014
Reader 0: ACS ACR122U PICC Interface 00 00
  Card state: Card removed,

The red light glows on the reader, and when putting a tag on it, the reader beeps and shows the following output:

Mon Feb 17 19:08:42 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 03 00 00 00 00 68
ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 03 00 00 00 00 68
+ 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 03 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 03 00 00 00 00
+ TCK = 68 (correct checksum)

Possibly identified card (using /home/frits/.smartcard_list.txt):
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 03 00 00 00 00 68
3B 8F 80 01 80 4F 0C A0 00 00 03 06 .. 00 03 00 00 00 00 ..
    Mifare Ultralight (as per PCSC std part3)
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 03 00 00 00 00 68
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 03 00 00 00 00 68
    RFID - ISO 14443 Type A - NXP Mifare Ultralight or UltralightC


Mon Feb 17 19:08:42 2014
Reader 0: ACS ACR122U PICC Interface 00 00
  Card state: Card removed,

Thanks in advance for your help!
If you want I can compile nfc again, and then using acr122_usb.

Regards Frits

P.s:
this is the output of nfc-list:

frits@frits-hpubuntu:~/Documents/libnfc-1.7.0$ sudo nfc-list
[sudo] password for frits:
nfc-list uses libnfc 1.7.0
error    libnfc.driver.acr122_pcsc    No ACR122 firmware received, Error: 80100016
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR122U PICC Interface 00 00

Re: Cardreader ACR 1222U and libnfc

Better to open a new field.

after recompiling using acr122u-usb the damn thing works............
No indicator light or beep sond, but it read tags an cards.

frits@frits-hpubuntu:~/Documents/libnfc-1.7.0$ sudo nfc-list -v
[sudo] password for frits:
nfc-list uses libnfc 1.7.0
NFC device: ACS / ACR122U PICC Interface opened
1 ISO14443A passive target(s) found:
ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 00  02 
* UID size: single
* bit frame anticollision supported
       UID (NFCID1): 6c  9c  a4  d4 
      SAK (SEL_RES): 18 
* Not compliant with ISO/IEC 14443-4
* Not compliant with ISO/IEC 18092

Fingerprinting based on MIFARE type Identification Procedure:
* MIFARE Classic 4K
* MIFARE Plus (4 Byte UID or 4 Byte RID) 4K, Security level 1
* SmartMX with MIFARE 4K emulation
Other possible matches based on ATQA & SAK values:

0 Felica (212 kbps) passive target(s) found.

0 Felica (424 kbps) passive target(s) found.

0 ISO14443B passive target(s) found.

0 ISO14443B' passive target(s) found.

0 ISO14443B-2 ST SRx passive target(s) found.

0 ISO14443B-2 ASK CTx passive target(s) found.

0 Jewel passive target(s) found.

I'll try dumping and writing now. Report back to this topic, which I abusively hijacked....sorry about that.