csjpeter
csjpeter

Reputation: 1936

Programming ACR122T-E2 in linux

I have an ACS ACR122T-E2 NFC reader. I downloaded the linux driver and the ct-api library from http://www.acs.com.hk/en/products/109/acr122t-usb-tokens-nfc-reader/ .

I have extracted the sample C program from the header given in the ct-api library archive file. I compiled it. I also created the ctacs.ini file with this content:

[CardTerminal]
CTN1=ACR122T
[ACR122T]
ICC1=ACS ACR122 25 00

When I running the compiled executable I just get:

Error: CT_init failed with error -8

where -8 is for "CT Error" based on the documentation in the header file.

Does somebody have some experience with this ACR122T-E2 and the official C API given for it? Does anyone have some idea on what should I check for or what should I try to do?

The only one thing I guess I might be wrong with, is the ctacs.ini file. I am not really sure if the

ICC1=ACS ACR122 25 00

line is right. I used "lsusb -t" which shows:

Bus 03.Port 1: Dev 25, If 0, Class=Chip/SmartCard, Driver=pn533, 12M

Of course I already have tried

ICC1=ACS ACR122 03 01

config line, but did not help.

Does anybody have some idea, what this configuration line should be?

Upvotes: 5

Views: 2837

Answers (2)

csjpeter
csjpeter

Reputation: 1936

A after several hour of reading different posts at different sites, studying the available NFC related packages on Ubuntu, and also got a bit of help from the maintainer/developer of the official ACS driver I managed to get this example program to work.

The solution is, to unload/remove the kernel's default drivers.

modprobe -r np533
modprobe -r nfc

Then to install and run pcscd:

apt-get install pcscd
service start pcscd

Install pcsc_scan:

apt-get install pcsc-tools

Now pcsc_scan can be used to figure out the right ICC line for the ini file:

...
Reader 0: ACS ACR122U 00 00
...

Thus the right content the ini file is:

[CardTerminal]
CTN1=ACR122T
[ACR122T]
ICC1=ACS ACR122U 00 00

Now running the compiled example C program (from the ct-api library archive file downloaded from ACS) the output is:

Response: 62 00

Not much, but at least it is working now and I can continue exploring this NFC world.

Upvotes: 4

Lucas Johnston
Lucas Johnston

Reputation: 43

I am using Windows and was struggling with the ctacs.ini file too. The trick (for me) was retrieving and using the actual CCID name. I retrieved mine by using "Springcard pcsc quick start" which shows the CCID name when the program opens. I use an ACS ACR122U-A9 with windows 8.1. The ini file below works for me.

[CardTerminal]
CTN1=ACS-ACR122-0 ;Just a name, can be an arbitrary value
[ACS-ACR122-0] ;Must correspond to name given above
ICC1=ACS ACR122 0 ;This is the actual name of the device (CCID)

Upvotes: 4

Related Questions