Topic: Why ACR122 devices are not recommended with libnfc ?

Hello,

As there are many users who ask about ACR122, I would like to clarify why this is a bad idea to use ACR122 (and derivated like Touchatag), at least with libnfc.

First, I have to say these devices are well-packaged, are cheap, have a nice look and work perfectly as RFID @13.56Mhz reader using PC/SC on common platforms as these devices are CCID compliant.

Internally, an ACR122 device is made with an MCU, a NFC chip (PN532) and an antenna.
MCU made the device CCID compliant and provide an USB connection.

Now let's talk about NFC and underlying requierements: to do more than RFID reader, you will need to:
- Poll for different targets (NFC-A, NFC-B, NFC-F and DEP)
- Act as target in ISO/IEC 14443-4 emulation mode (optionnal regarding NFC Forum but very useful to be backward compatible with device that are not able to do P2P)
- Do P2P as defined in "Logical Link Control Protocal" (LLCP) from NFC-Forum

Polling and acting as target need to be cancellable, ie. you start a target emulation but no initiator comes, you will have to abort the target emulation.
Next, LLCP defines some timeouts for command sending/receiving but long timeouts relies on "abortable" commands.

In actual architecture, libnfc directly talk to NFC Chip (PN532).
To do that, libnfc's ACR122 driver passthrough PC/SC (and internal MCU) by using some special commands that allow to send frames directly to the PN532.
So with ACR122, the libnfc relies on PC/SC but there is no timeout on command and no way to cancel a running command in PC/SC API.

Conclusion, we can't do reliable and robust NFC with ACR122 and libnfc.

Of course, any contributions are more than welcome to fully support ACR122 devices in libnfc.

Romuald Conty

Re: Why ACR122 devices are not recommended with libnfc ?

Hi Romuald, this post clarify many things about this nfc device, because as you said is popular and cheap.

But, the acr122 it's the same as the acr122u? I know that acr122 was launched in 2009 and acr122u a few months ago, there's any improvement in acr122u?

Also, wich model of nfc device reader do you recommend?

thanks a lot

Re: Why ACR122 devices are not recommended with libnfc ?

kavastudios wrote:

But, the acr122 it's the same as the acr122u?

Yes, ACR122U is a "new" ACR122 version (understand less bogus than before).

kavastudios wrote:

Also, which model of nfc device reader do you recommend?

ATM, SCL3711 from SCM and StickID from SensorID are the best choice for doing NFC with libnfc.

If you don't need a case, ie. made a NFC kiosk, the best choice is the opensource PN532 breakout board from microbuilder.eu (now sold at adafruit).

http://www.libnfc.org/documentation/har … patibility

Romuald Conty

4 (edited by pavlon 2012-03-08 08:30:39)

Re: Why ACR122 devices are not recommended with libnfc ?

rconty wrote:

ATM, SCL3711 from SCM and StickID from SensorID are the best choice for doing NFC with libnfc.


Hi! Where i can purchase StickID device? I'm italian, as the producer of this device, but  on their site there isn't a commercial section..

Re: Why ACR122 devices are not recommended with libnfc ?

for now acr122_usb driver exists.
it changes abything?

BTW, what driver is preffered - acr122_pcsc or acr122_usb?

Re: Why ACR122 devices are not recommended with libnfc ?

Hi,

Yes, there is a new driver called acr122_usb. This one is early experimental and only support ACR122 with firmware 2.x (not Touchatag).

This driver enables the use of timeout, but due to the front MCU (between host and PN532) we can only use a timeout < 5s.
An interesting point for some users : using acr122_usb instead of acr122_pcsc will remove the depencency to PCSC.

I think with some more work, we may be able to have something that can better work than current acr122_pcsc (remove some limitations).

For now, use acr122_usb for testing purpose and feel free to report bugs / patches to improve this driver.

Romuald Conty

Re: Why ACR122 devices are not recommended with libnfc ?

acr122_usb driver exists? where can I buy?

Re: Why ACR122 devices are not recommended with libnfc ?

You want to buy online.. May be there is any site to download the free driver or it may be payable

Re: Why ACR122 devices are not recommended with libnfc ?

Regarding the PC/SC problem with communicating with the ACR/ACS122, does that imply that any PC/SC based driver will not work with libnfc?

I am asking because there is also the ifdhandler in beta that supposedly should make it possible to use libnfc compatible readers to the PC/SC stack, and I don't see the purpose of that if the timeout issue is a problem.

Regards,

Johan Henselmans

Re: Why ACR122 devices are not recommended with libnfc ?

ACR122 major problems are these ones:

- Timeout: ACR122 does have troubles with timeouts, used through PC/SC or not (ie. acr122-pcsc or acr122-usb driver).
That's not related to PC/SC at all.

- Blocking functions: a PC/SC command can not be cancelled, which is a requirement for P2P / act as target.

So, the fact that ifdnfc (ifdhandler for nfc devices) does not have troubles is absolutely not related in any point to these ones.

ifdnfc is a tools to use libnfc's compatible devices as a PC/SC reader... that's not the same that ACR122 does have its own PC/SC.

Romuald Conty

Re: Why ACR122 devices are not recommended with libnfc ?

Hi.

rconty wrote:

ATM, SCL3711 from SCM and StickID from SensorID are the best choice for doing NFC with libnfc.

Since some time has pased sind this post I'm wondering if this is still the most recommended of-the-shelf solution.

rconty wrote:

If you don't need a case, ie. made a NFC kiosk, the best choice is the opensource PN532 breakout board from microbuilder.eu (now sold at adafruit).

The board from microbuilder.eu seems very intersting. But since I'm not that much of a hardware guy I'm wondering how difficult it is to get it working.
Or is there a ready-to-work thing that I can buy somewhere? wink

Re: Why ACR122 devices are not recommended with libnfc ?

Hi,

marvin wrote:

Since some time has pased sind this post I'm wondering if this is still the most recommended of-the-shelf solution.

If you want to do NFC (including P2P) with a desktop/dongle form-factor, SCL3711 (germany) and StickID (italy) stays a good choice. DDS's PN533 (india) device is good too.

http://www.identive-group.com/products- … ard-reader

http://www.sensorid.it/en/products/Stick_ID.html

http://www.danidatasystems.com/rfid-rea … er-writer/

marvin wrote:

The board from microbuilder.eu seems very intersting. But since I'm not that much of a hardware guy I'm wondering how difficult it is to get it working.
Or is there a ready-to-work thing that I can buy somewhere? wink

With this board, you will need a UART-USB dongle (few dollars) to connect your PC to the board.
BTW, this board also allow to be connected to tiny computer (like R-Pi) using other ways (SPI, I²C).
Out of libnfc's scope, this board can be used on top of microcontrollers like Arduino, Mbed, etc.

http://www.adafruit.com/products/364

Romuald Conty

Re: Why ACR122 devices are not recommended with libnfc ?

thanks for your answer.

rconty wrote:

Hi,
If you want to do NFC (including P2P) with a desktop/dongle form-factor, SCL3711 (germany) and StickID (italy) stays a good choice. DDS's PN533 (india) device is good too.

I will look into those.

rconty wrote:

With this board, you will need a UART-USB dongle (few dollars) to connect your PC to the board.
BTW, this board also allow to be connected to tiny computer (like R-Pi) using other ways (SPI, I²C).

Out of libnfc's scope, this board can be used on top of microcontrollers like Arduino, Mbed, etc.

The RaspbPi idee seem really interesting.
I also have a BusPirate ( dangerousprototypes.com/docs/Bus_Pirate ) with which I'm trying to get familiar with. As far I can tell that should work too, shouldn't it?