NFC Card Reader ACR 122 incompatible with Android 4.1 Jelly Beans?
Asked Answered
I

5

9

I used the ACR 122 before and it worked flawlessly with an Android < 4.1 phone. I used it to exchange P2P SNEP messsages... But since the phone got 4.1, the reader starts beeping and flashing when you place the phone above it. Does anyone else have found this incompatibility? Any solutions?

Inculpate answered 27/7, 2012 at 8:8 Comment(3)
What software/SDK (libnfc, ISMB, NFCTools...) you are using to program the ACR122?Wagshul
is ur ACR 122 reader connected to Android?Glynas
I am using this SNEP lib here: code.google.com/p/ismb-snep-java I have converted this into a groovy script and verified that this was working under 4.0.3 - the reader is connected to the macbook, the goal here is to program the reader with a message adn push it to an android device.Inculpate
D
6

Since Android 4.1 Jelly Bean, NFC peer-to-peer communication is configured to use a higher bitrate (212 kbps), while earlier it was using 106 kbps (in Android devices that have Google Wallet installed it was always using 212 kbps).

I don't know whether the ACR122U can support the higher bitrate through javax.smartcardio. The NFC chip inside (NXP's PN532) can certainly do it. The low-level ISO18092/ECMA-340 protocol for 212 and 424 kbps is different from 106 kbps. With 106 kbps it uses the same modulation as ISO14443, while the higher bitrates use the same modulation as FeliCa (see page 7 and 8 of the standard). So I suspect this cannot be handled through javax.smartcardio.

Dimitris answered 28/8, 2012 at 19:30 Comment(0)
C
4

great to see someone else working on this. You can connect to the Reader via "Direct". credits go to Peter Kmet: javax.smartcardio transmit to NFC USB reader without card

This sample will just toggle the Lights

        TerminalFactory factory;
        List<CardTerminal> terminals;
        factory = TerminalFactory.getDefault();
        terminals = factory.terminals().list();
        terminal = terminals.get(0);

        byte[] response = null;
        byte[] command = new byte[] { (byte) 0xff, (byte) 0x00, (byte) 0x40, (byte) 0xd0, (byte) 0x04,
            (byte) 0x05, (byte) 0x05, (byte) 0x02, (byte) 0x01 };
        int controlCode = 0x310000 + 3500 * 4;
        Card card = null;
        card = terminal.connect("DIRECT");
        response = card.transmitControlCommand(controlCode, command);

Please update if you make any progress with Jelly Bean, I will checkout your code as well.

Cranio answered 12/11, 2012 at 12:23 Comment(0)
A
3

This can be helpful to make a connection to terminal without a card in range:

terminal.connect("DIRECT");
Alarcon answered 12/11, 2012 at 15:6 Comment(0)
S
1

I solved the Problem with a small "hack". I am using the ACR122U with a SAM Module in it, do not know which Versions have this it's the TouchATag Reader. I found out that the reader has to pass this line, also when the phone is not in the NFC Field:

cardTerminal.connect("*").getBasicChannel();

This is because you have to put the reader into inializer mode before the phone comes into the nfc field, and this only works if you can send APDUs!

If somebody finds a solution to send APDUs without calling connect() on the cardTerminal.

This Problem is not related to the higher bitrates, I managed to get a communication with 424 kbps.

You can find a NFC API I have written with this knowledge in googel code, I will also provide some documentation there:

http://code.google.com/p/java-android-beam-api/

Comments are very welcome!

Sacrosanct answered 11/11, 2012 at 18:52 Comment(1)
We made a lot of progess on this issue, now using the terminal.connect("DIRECT"). And the best news, in our first test it works on Linux as well! You can find a snapshot of it here and in our repository, we are currently looking for someone to test it. Have a look here for the binary snapshotSacrosanct
C
0

In Java language, you can use:

1) nfctools: https://github.com/grundid/nfctools . It works on Android 4.0, 4.1, 4.2, 4.3, 4.4.

2) http://code.google.com/p/ismb-snep-java. It works on Android 4.0 and Android 4.4 (but not in 4.1,4.2,4.3). In order to support Samsung devices in 4.4 it requires some changes in the protocol (which can be taken from the nfctools, but it is better to use the nfctools to increase compatibility).

Caecilian answered 23/10, 2014 at 10:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.