NFC Tag Read Speed
Asked Answered
S

0

9

We are building a prototype application that reads an NFC tag using Android. However, we are not using the embedded NFC reader and Android SDK since we are using an external bluetooth reader called an ACR1255U-J1

The NFC chips that we are using are Mifare Desfire EV1 8k with v0.4 command set. I think these are known as wrapped APDU commands because I don't think the EV1 v0.4 supports the full ISO APDU command set.

Since we are using the external Bluetooth reader (it's a business requirement) we don't believe that we are able to use the Android NFC SDK and instead need to use the SDK provided by the bluetooth reader manufacturer.

Anyway, currently to read a payload of 8k it is taking upwards of 25 seconds. We suspect, although haven't formally verified yet, that in part this is due to the way we read data by:

  1. Issuing a read binary data command
  2. Blocking waiting for a callback that gives us the data
  3. Evaluate the response code that tells us whether there are more frames to read.
  4. If no more then we are done, otherwise continue to read.

Each frame size is a maximum of 59 bytes so as we understand it even if we request to read a bigger payload such as 100k or the entire 8k in one read command we would still only get 59 bytes of data back in one response frame.

This causes us to do 131 individual read commands that each then block and wait for data before piecing together each 59 bytes segment to get the payload.

Since the commands are going from the android app, to the bluetooth reader then over to the NFC card then the bytes back from the card and via the bluetooth reader over to the app 131 times we wonder if this is the bulk of the time being spent.

We are trying to find better ways to profile/debug the issue. Clearly it is possible to read faster since the onboard NFC reader using the Android NFC API is capable of reading the data in a few seconds.

Does anyone have any advice on what our issue could be or how we can speed this up.

Stanchion answered 27/10, 2016 at 10:4 Comment(8)
You might want to reveal the code that you actually use to exchange commands.Grader
There are android devices which supports NFC tag reading and writing. This may avoid the time consumed using External reader/writer. Moreover , Is there an Applet inside your target device? I mean Java Card Applet? If then the source code inside the Applet needs to be more memory centric and efficient to react faster to the NFC commandsElectrodeposit
Not an answer, but do you really need 8K of information? Can't you encode it in a more compact form?Elene
Show us some more code. I believe that manufacturer SDK are queuing some data and waiting for full response instead sending bits through. I used their USB reader and had similar problem. I was working on PC but problem was similar. I do not know about their bluetooth device but I have some old java code for USB reader, maybe it's the same.Deepsea
@Stanchion Goate, did you ever solve this? I am having the same problem with the same device. I'm going to see if using the device in USB mode makes things any faster. Could you possibly post your code?Quadrifid
@ban-geoengineering No, we never did solve this using external readers. I no longer work on the project so I am not sure whether they overcame this since but at the time I was last involved the external readers were put on hold and the integrated reader on the mobile device was being used. I do know that since I left they switched to a different NFC tag (no longer using Mifare) and I suspect one of the reasons (also crypto features) was related to this.Stanchion
Just a suggestion for anyone else with this problem. I haven't tried this yet, but an idea is to use a standard Android phone as the external NFC reader, using Bluetooth to communicate to the master device. First step: #21221493Quadrifid
Sounds reasonable, in our particular case at the time the business liked the idea of having a little reader which looked like this and could be branded etc acs.com.hk/en/products/403/… I guess anther phone/tablet could equally be put behind some type of facade but it was handy from a cost perspective to buy these devices (they actually planned to buy many in bulk and send out to business sites). My guess is that even the cheaper android devices with on board nfc could be more expensive and power hungry than these. Good route to try though!Stanchion

© 2022 - 2024 — McMap. All rights reserved.