ACR122U as external reader on Android

7,262 views
Skip to first unread message

Marco Albarelli

unread,
Jan 8, 2013, 2:41:26 AM1/8/13
to nfc-dev...@googlegroups.com
Hi all
I have a question for a peculiar use-case I have to manage
A project I'm currently developing will need the use of an external NFC reader (the ACR122U in this case) combined with a Android tablet (>=4.x)
Basically the aim is to let the user scan a hard to reach tag holding the tablet with one hand and moving the reader with the other

I've been able to connect the reader and have it working and initialized in an Android test App by following the ACS drivers how-to but now comes the hard part: actually reading the tags. 

The code of the demo applet is basically almost all I need.
My question is: is it possible to connect the demo applet code to the ACR122U directly from inside an Android App instead of from inside the browser environment?
The ACS driver uses a android.hardware.usb.UsbDevice to instantiate their Reader
I still didn't have the time to browse well all the nfctools code
Any help would be appreciated
Marco

Marco Albarelli

unread,
Jan 8, 2013, 5:49:02 PM1/8/13
to nfc-dev...@googlegroups.com
I took some time to look more in depth into it and I think all traces down to the use of 

javax.smartcardio.CardTerminal;
In my case I would need to change it for an instance of 
com.acs.smartcard.Reader;
or something  that can use 
android.hardware.usb.*;

The acs.smartcard.Reader class has a transmit() method that manages the APDU, so I guess I should be able to make use of nfctools for the part of creating the APDU and of the acs library to actually communicate with the tag
Of course any help or suggestion would be highly appreciated
M

Marco Albarelli

unread,
Jan 9, 2013, 4:56:23 AM1/9/13
to nfc-dev...@googlegroups.com
Ok, I managed
The ACS library is sufficient and using raw APDU is far easier than I expected
Bye

Adrian Stabiszewski

unread,
Jan 9, 2013, 7:35:42 AM1/9/13
to nfc-dev...@googlegroups.com
Hi Marco,

which Tablet do you use and how did you connect it to the Reader.
I have a Galaxy Tab 10.1 running ICS and I have a USB adapter. Just plugging in the ACR122 does not do much.
I haven't tried this new driver vom ACS yet, but do you think this configuration might work?

Do you mind sharing some of your code? At least the setup part?
Thanks.

Regards,
Adrian.

Marco Albarelli

unread,
Jan 9, 2013, 10:05:43 AM1/9/13
to nfc-dev...@googlegroups.com
Hi Adrian
I'm going to publish the code on github soon, (hopefully today or tomorrow)
The "trick" is quite easy to achieve
Basically you need to use the ACS library which is quite easy to use. A very brief how-to is included in the doc
I've been able to properly read a Ultralight tag from a USB attached ACR122U
The only thing I have to fix now is that when I remove the tag from the reader the app closes
Since I cannot keep it attached to the debugger it's hard to understand what's causing this behaviour
Most likely solution will be moving al the tag reading stuff in a separate activity and call that with startActivityForResult

Reading the tag has proven to be more easy than I was afraid it would have been, but I'd really appreciate some advice on how to extend nfctools and integrate this feature

down to some detail:
Tablet is a nexus7 and the internal NFC reader works in parallel since in this case we're using a USB connection to a device
The library is downloadable from acs site
The setup is actually quite straight forward:
Put the necessary pieces in the manifest (<uses-feature android:name="android.hardware.usb.host" />)
Optionally bind to the vendorId:deviceId so that the app is launched on connection
Create a Reader object, feed it a UsbDevice
tell the reader to issue a `command` which is the APUD, in return you get the payload you requested

There is an ACS document explaining their API, but it's basically a transcription of the NFC specifications plus some proprietary commands to manage the reader itself (led status, buzzer, that kind of stuff) and you find it here (bottom of the page) http://www.acs.com.hk/index.php?pid=drivers&id=ACR122U

I had a couple of reboots of the tablet, but I think they are due to some misuse on my side, not releasing resources properly 
Their demo app seems to be rock-solid 

Adrian Stabiszewski

unread,
Jan 9, 2013, 10:49:20 AM1/9/13
to nfc-dev...@googlegroups.com
Hi Marco,

this sounds really exciting.
How to do upload the app to the tablet? Do you constantly switch the USB port between the ACR122 and your desktop?

I'll definitely give your app a try with the Galaxy Tab. If it's working on my tablet it shouldn't be too hard to get nfctools working ;)

Regards,
Adrian.

Marco Albarelli

unread,
Jan 9, 2013, 1:29:10 PM1/9/13
to nfc-dev...@googlegroups.com
Hi Alan 
You find the ACS demo app bundled together with the ACS library
I wrote mine from scratch for better understanding but eventually reached the same conclusions
It's in the ReaderTest folder of the ACS_LIB_Android_111_A.zip file
It's a full Android app, ready to build

The only thing I added to this picture was the use of a intent-filter 
<intent-filter>
        <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>

<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
                android:resource="@xml/device_filter" />

Having device_filter.xml defined as 
<resources>
    <usb-device vendor-id="1839" product-id="8704"/>
</resources>

You would do me a big favor testing if it works on your tablet, since I have to buy one for testing/development and I don't want to buy a crappy one just to keep risk low
If you confirm to me Galaxy note works I'm going to buy one to proceed in development of my app

Regarding remote debug, 
connect your tablet to pc via usb
issue this command
#adb tcpip 5555
remove tablet
#adb connect 192.168.1.123:5555 
change the ip with the correct one for your tablet
launch debug from eclipse normally, you shall see the tablet listed amongst available debug devices. You'll see the IP as name, not the `correct` name
If you still don't see it listed modify the run/debug configuration to 'Target' -> 'Always prompt to pick a device'
Choose it and Eclipse uploads, installs, listens for debug
Piece of cake

Try that on a iPhone and see if it works :D

Marco Albarelli

unread,
Jan 11, 2013, 6:20:21 AM1/11/13
to nfc-dev...@googlegroups.com
Hi Alan
Did you find the time to test if the demo app is working on your tablet?
I need first-hand confirmation on this aspect, and I would really like not to buy a Galaxy Tab just to find it doesn't work :)
I'm 90% sure it should, but with Samsung you never know
It's the VA output of the usb port that worries me most.
The ACR122U needs all the 200mVA that the USB port should be able to provide 
On the Nexus everything works, but that's also a reference tablet, so I wouldn't expect anything different.
With Galaxy stuff I already discovered that the word `standard` assumes a twisted meaning when Samsung is in the picture (maybe I've been just unlucky)
Thanks
M

Adrian Stabiszewski

unread,
Jan 11, 2013, 7:13:01 AM1/11/13
to nfc-dev...@googlegroups.com
Hi Marco,

I'm sorry but I don't know your github account.
Could you please share a link to the repository?

Thanks,
Adrian.

Marco Albarelli

unread,
Jan 11, 2013, 7:43:25 AM1/11/13
to nfc-dev...@googlegroups.com
Hi Adrian (sry for writing the wrong name :) )

my account on github is marcoalbarelli but for this test you just need the .zip coming from ACS site
It contains a ready-to-build demo app

You just need to put it in Eclipse and see if ti works with the reader
If you need further help with debugging over Wifi (since the usb port is taken by the reader) feel free to ask.

One more question, does the Galaxy tab have a standard USB plug or does it have its own proprietary format?
Thanks
M

Adrian Stabiszewski

unread,
Jan 11, 2013, 8:06:07 AM1/11/13
to nfc-dev...@googlegroups.com
No problem with the name. My second one is more problematic ;)




One more question, does the Galaxy tab have a standard USB plug or does it have its own proprietary format?

It's a proprietary connector but I have an adapter for USB.



Marco Albarelli

unread,
Jan 12, 2013, 6:33:07 AM1/12/13
to nfc-dev...@googlegroups.com
Hi
After some thinking and discussing with my client we decided not to go for the Samsung because of the proprietary connector (we're kind of the open and standard fans :) )
Anyhow it would be very interesting to know if the external reader works on your tablet, just to have some more data

In the end we'll probably buy a Asus Transformer Prime 
Our requirements are :
Dorsal camera
GPS
Android >=4.0
Screen >=7"
Optionally 3G and NFC

I bought a Nexus7 for development purpouses, but the lack of a dorsal camera seems to be too much for the final client -_-
I even wrote a custom Camera app to allow to take snapshots more easily, but they think a dorsal camera is mandatory ...
Clients are never satisfied :)
If you have any suggestion about a tablet that fits the requirements feel free to tell me

I'll keep on listening for any progress in the testing of the demo app with the external reader
M

Adrian Stabiszewski

unread,
Jan 13, 2013, 4:35:39 AM1/13/13
to nfc-dev...@googlegroups.com

Marco Albarelli

unread,
Jan 13, 2013, 5:12:28 AM1/13/13
to nfc-dev...@googlegroups.com
Thank you for the library.
This time I did almost nothing :)
M

Marco Albarelli

unread,
Jan 17, 2013, 9:25:56 PM1/17/13
to nfc-dev...@googlegroups.com
Now I need to bring things to the next step: using your library to easily manage NDEF messages

Right now I'm able to read data from the com.acs.smartcard.Reader using this method:
byte[] command = { 0x00, (byte) 0x84, 0x00,0x00, 0x08 };
byte[] response = new byte[300];
int responseLength;
responseLength = reader.transmit(slotNum, command, command.length, response,response.length);
System.out.println(new String(response));
This is the command to read the Reader name (or serial I don't remember)

This chatting goes on for every data page I need to read, then there's the de-serialization of the actual NDEF message
This of course is where I'd need the most your library to kick in

Any suggestion on this?
Thx
M

Adrian Stabiszewski

unread,
Jan 18, 2013, 3:18:02 AM1/18/13
to nfc-dev...@googlegroups.com
Marco,

I would gladly help you but please setup a project on github where we can test this. Just posting snippets of code here will take for ever.

Regards,
Adrian.

Marco Albarelli

unread,
Jan 18, 2013, 4:35:01 AM1/18/13
to nfc-dev...@googlegroups.com
Agreed
Just give me some hours
M

Marco Albarelli

unread,
Jan 18, 2013, 6:39:19 AM1/18/13
to nfc-dev...@googlegroups.com
And here we go 
I'm not very experienced with github
This would be the first real project I'm committing to
Feel free to point out any mistake I made in setting things up

You find my few lines of code at line 600

Thx
M

Adrian Stabiszewski

unread,
Jan 18, 2013, 3:42:41 PM1/18/13
to nfc-dev...@googlegroups.com
Thanks Marco.

I was able to successfully clone and import your project. You can follow and merge my changes from https://github.com/grundid/nfctools-aer

The MainActivity class looks like the one from the demo project. I think it is quite difficult to work on this single file. Do you mind removing all the unnecessary code that we don't need?

So far I've created an extra ReaderStateChangeListener and a ReaderApduTag that will connect the Reader class from the acs library with the nfctools library.
Basically this is all that is nessecary. The only thing that is missing now is the correct conversion from the nfctools commands to the acs commands. This should work the same as in org.nfctools.spi.acs.AcsTag.
Once this is working the NdefOperationsListener will receive a NdefOperations interface which will allow it to read and write NDEF messages.

This is all theory right now, but that's all I can do today. ;)
I'll continue next week on this.

Regards,
Adrian.



Marco Albarelli

unread,
Jan 19, 2013, 5:13:09 AM1/19/13
to nfc-dev...@googlegroups.com
Wonderful
I merged your changes, gonna give it a shot later on in the w.e.
Thanks for now

Marco Albarelli

unread,
Jan 20, 2013, 12:36:10 PM1/20/13
to nfc-dev...@googlegroups.com
Hi, I have an exception i'm not able to fix:
01-20 18:13:41.747: E/AndroidRuntime(24293): org.nfctools.NfcException: java.lang.NullPointerException
01-20 18:13:41.747: E/AndroidRuntime(24293): at org.nfctools.mf.ul.Type2NfcTagListener.createNdefOperations(Type2NfcTagListener.java:93)
01-20 18:13:41.747: E/AndroidRuntime(24293): at org.nfctools.mf.ul.Type2NfcTagListener.handleTag(Type2NfcTagListener.java:51)
01-20 18:13:41.747: E/AndroidRuntime(24293): at eu.marcoalbarelli.android.usbtest.ReaderStateChangeListener.onStateChange(ReaderStateChangeListener.java:35)

It's in the "hack" branch of the repo
I'm not 100% sure of having instantiated things the right way
I basically copied the code from nfctools-example. Iit works there: I'm using that code to encode my tags
Any suggestion?
thx
M

Adrian Stabiszewski

unread,
Jan 20, 2013, 2:46:44 PM1/20/13
to nfc-dev...@googlegroups.com
Hi,

I haven't seen your message while I was coding myself ;)

Anyway please merge my repo. I've added the converters for the command and response and now I'm able to read Ndef messages from Ultralight tags :)

...
01-20 20:21:00.005: I/NFCTOOLS(22790): Sending: FFB0002604
01-20 20:21:00.015: I/NFCTOOLS(22790): Received: 6 | 0000000090000000000000000000000000000000000000000000000000000000
01-20 20:21:00.015: I/NFCTOOLS(22790): Sending: FFB0002704
01-20 20:21:00.025: I/NFCTOOLS(22790): Received: 6 | 0000000090000000000000000000000000000000000000000000000000000000
01-20 20:21:00.025: I/NFCTOOLS(22790): Found 1 NDEF records
01-20 20:21:00.025: I/NFCTOOLS(22790): NDEF: Uri: [http://www.grundid.de/nfc]

Right now there is a problem with writing records. My guess is that my conversion of a Command with data in it is not correct (line 53 and following in ReaderApduTag).
Since I've done all the other conversions in good faith I assume that there is something different how you have to encode the byte array when the command contains a data array.
I tried to add a length field at the end, but this did not work. Maybe you have to put it somewhere else...

Do you have some docs on how to encode the command?

Regards,
Adrian.


Adrian Stabiszewski

unread,
Jan 20, 2013, 3:13:10 PM1/20/13
to nfc-dev...@googlegroups.com
Just a short update:

I fixed the problem with writing tags. The length field comes before the data ;)

Now there is only one minor problem: we do not detect if the tag is actually a ultralight tag. I've added a comment in line 34 of the ReaderStateChangeListener. This is where I would expect the detection to happen.

I would leave it to you to implement the tag detection. Basically everything is described on page 6 of the ACR122 API docs.

This way one could support Ultralight and MF Classic 1K/4K tags with this tool.

Regards,
Adrian.

Marco Albarelli

unread,
Jan 20, 2013, 7:32:48 PM1/20/13
to nfc-dev...@googlegroups.com
Wonderful and thanks
It took me a couple of hours but I ended up decoding the NDEF payload but it's a nightmare :)
I prefer waaaaay more *not* reinventing the wheel this time
I must say it's been quite enlightening though, diving into the ndef structure

I merged your changes and I'm pushing them
BTW don't know if you care about it or not, but I think that if you create pull requests I can merge your changes without losing the link to your github user 
Goodnight for now
M

Marco Albarelli

unread,
Jan 21, 2013, 11:19:51 AM1/21/13
to nfc-dev...@googlegroups.com
Ok, pushed a small change in a new branch "tagtype"
I implemented an enum containing all pcsc defined tags, I retrieved the listing from the pcscd package
I instantiated different listeners for mifare_1k and ultralight, but the one for mifare_1k raises a "outOfMemory" exception, maybe something I didn't consider in instantiating?

M

Kofi Kusi

unread,
Feb 18, 2013, 11:10:01 AM2/18/13
to nfc-dev...@googlegroups.com
Hello Marco,

Nice job with the NFC code you are working on with Adrian. I'm working on a NFC project where someone can take their NFC phone (for example, the Nexus S 4G) and tap on the ACR122U NFC reader and it will send data from the NFC phone to the Android tablet via the ACR122U reader. There's a company called Adelya which does it perfectly, but I'm not sure how they do it exactly. Here's a video of what I'm talking about:

http://www.youtube.com/watch?v=0J22SdUz_FE&feature=player_detailpage#t=38s

I was wondering if your source code does that? Also do you have any suggestions, ideas, sample source code that I can use to achieve this project? Thanks.

Adrian Stabiszewski

unread,
Feb 19, 2013, 3:04:44 AM2/19/13
to nfc-dev...@googlegroups.com
Hi.

I don't know what Adelya exactly does but looking at the video it seems as the same thing.

Regards,
Adrian.

Marco Albarelli

unread,
Feb 19, 2013, 3:18:11 AM2/19/13
to nfc-dev...@googlegroups.com
Hi Kofi

I think whet you see can uqite easily be obtained.
The pieces seem to be already there:
tha ACS demo app I slightly modified enables the ACR122U reader
The nfctools library is able to manage P2P communitcation, which I  believe is what we see happening in that video (I don't think Android devices are able to act as tags, right Adrian?)
What's missing is properly connecting the logic that enables the reader to make use of the p2p part of the library and then use the data in some way

I just finished a heavy job for a big client of mine involving this approach (tablet+external reader) so I think I have time to add some code to my github project
My first goal is to make it read correctly any "normal" tag
Right now I own MifareClassic and Ultralight tags, so I'll test on those
A second goal is to dive a little in the p2p stack which should be the thing you're interested in
Any help/fork/pull-request is welcome :)

M

Kofi Kusi

unread,
Feb 19, 2013, 11:49:38 AM2/19/13
to nfc-dev...@googlegroups.com
Hello Marco & Adrian,

Thanks for the quick response.

So Marco & Adrian (you guys can correct me if I'm wrong)

-Based on the Adelya video (http://www.youtube.com/watch?v=0J22SdUz_FE&feature=player_detailpage#t=38s), is the data being "beamed" from the NFC phone to the NFC reader (Let's say the reader is an ACR122U reader) via Android Beam?

-Assuming the data is being "beamed" from the NFC phone to the ACR122U reader via Android Beam, that means that NFCTools-p2p library would have to be integrated into the Android tablet app (for example the ACS Demo App you created) so that it receives the data being sent/beamed from the NFC phone?

-NFCTools-p2p would not have be integrated into the NFC phone, just the Android tablet app since the Android tablet app will be receiving the data sent/beamed from the NFC phone to the ACR122U?

-Since the NFC phone is not a MiFare or Ultralight tag and it can't act as a "tag", what would a NFC phone be categorized under? Is this where Android Beam and p2p communication comes in?


Thanks again Marco & Adrian

David Merel

unread,
Apr 15, 2013, 10:39:39 AM4/15/13
to nfc-dev...@googlegroups.com
Have you ever managed to get this code to support P2P so that a NFC phone like a Galaxy S can tap against the ACR122?

stet...@new.edvhtl.at

unread,
Jul 31, 2013, 4:11:34 AM7/31/13
to nfc-dev...@googlegroups.com
hi guys,

I`m a novice in things like NFC-Reading/Writing but i have one question to your very good solution of the ACR122U:

I installed your app from github, but when I start the App on my hackberry A10, on which Android is working, no device will be found.
Why could this happen?. 
I did it the same way like Adrian.

Thx

Marco Albarelli

unread,
Jul 31, 2013, 5:32:18 AM7/31/13
to nfc-dev...@googlegroups.com
Hi 
The problem is most likely due to the fact that you don't have OTG drivers in your android rom
For the reader to work you need OTG capabilities enabled, which in turn requires both the proper hardware and the necessary drivers in the kernel
I really don't know if the Blackberry tablet has the proper hw capabilities
Message has been deleted

stet...@new.edvhtl.at

unread,
Aug 1, 2013, 2:56:33 AM8/1/13
to nfc-dev...@googlegroups.com

Ok, thanks.

I tried to compile a new image of the stock-android, which is running on my hackberry, by this tutorial: https://www.miniand.com/wiki/Allwinner/Unpacking+and+building+LiveSuit+images
But i can't figure out how to edit and add drivers to the kernel - is there a way to do this? 

Said Tahsin Dane

unread,
Aug 2, 2013, 2:18:06 AM8/2/13
to nfc-dev...@googlegroups.com
If you are able to make the NFC chip work with hackberry please let us know. I will need it and I could not do it as well.

Md Asif

unread,
May 15, 2014, 12:41:08 PM5/15/14
to nfc-dev...@googlegroups.com
I would like to know the coding you consist of an android app and a java code that is compile to communicate between the app and the ACR122U Reader.And also is Android Phone Compatible or only Tablet??

Thanks

On Tuesday, January 8, 2013 3:41:26 PM UTC+8, Marco Albarelli wrote:
Hi all
I have a question for a peculiar use-case I have to manage
A project I'm currently developing will need the use of an external NFC reader (the ACR122U in this case) combined with a Android tablet (>=4.x)
Basically the aim is to let the user scan a hard to reach tag holding the tablet with one hand and moving the reader with the other

I've been able to connect the reader and have it working and initialized in an Android test App by following the ACS drivers how-to but now comes the hard part: actually reading the tags. 

The code of the demo applet is basically almost all I need.
My question is: is it possible to connect the demo applet code to the ACR122U directly from inside an Android App instead of from inside the browser environment?
The ACS driver uses a android.hardware.usb.UsbDevice to instantiate their Reader
I still didn't have the time to browse well all the nfctools code
Any help would be appreciated
Marco

Motosauro

unread,
May 15, 2014, 1:06:18 PM5/15/14
to nfc-dev...@googlegroups.com

Check my github profile, you will find a working proof of concept called aer

--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "nfc-developers" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an nfc-developer...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

David Merel

unread,
May 15, 2014, 10:51:30 PM5/15/14
to nfc-dev...@googlegroups.com
yes thank you, however when we had used this in the past it only worked in reads NFC tags, however tapping an NFC capable phone against the ACR unfortunately did not work.




--
Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe "nfc-developers" abonniert haben.
Wenn Sie sich von diesem Thema abmelden möchten, rufen Sie https://groups.google.com/d/topic/nfc-developers/6L5PIwTzGHQ/unsubscribe auf.
Wenn Sie sich von dieser Gruppe und allen Themen dieser Gruppe abmelden möchten, senden Sie eine E-Mail an nfc-developer...@googlegroups.com.

Motosauro

unread,
May 16, 2014, 2:08:25 AM5/16/14
to nfc-dev...@googlegroups.com

It should work if the phone you tap has android >=4.4 and if in the code you use HCE, but I don't have a device for testing it
M

Md Asif

unread,
May 19, 2014, 4:14:40 AM5/19/14
to nfc-dev...@googlegroups.com
I wanted to pass information from my NFC Enabled Devices(Note 3) to the External NFC Reader using your App.Is it possible and im looking into p2p Mode not HCE 

Motosauro

unread,
May 19, 2014, 4:30:15 AM5/19/14
to nfc-dev...@googlegroups.com
I never succeeded in doing what you want to do using P2P 
I think it should work using HCE 
Message has been deleted

Md Asif

unread,
May 19, 2014, 12:38:56 PM5/19/14
to nfc-dev...@googlegroups.com
But when i import your file the aer into eclipse it says "No projects found to import". Why is that so??

Md Asif

unread,
May 19, 2014, 10:27:02 PM5/19/14
to nfc-dev...@googlegroups.com
Now I am able to import the project but when i run the app on my phone and tap the phone on the External NFC Reader Nothing happens.Why?

Carles Mallafré

unread,
Nov 3, 2014, 6:35:27 PM11/3/14
to nfc-dev...@googlegroups.com
Hi Marco (first of all thanks for your work). I'm working on a project that I have to read NFC tags with an external ACR122U reader connected to a Nexus7
After days of investigation and tryings I'm a little bit lost. But I follow your work with Adrian Stabiszewski and seems that you have an Android app that works the way i want
I'm able to run the app and open the connection with the ACR122U, but when I swipe a NFC tag and the ReaderApduTag calls the transmit method, the response I get is all 0. So no response, and when you try to do the convertToResponse it crashes because you're doing  byte[] data = new byte[length - 2]; (as length is 0 it crashes)
The question is that I don't know why I'm getting response 0 and is working for you. My NFC tag I'm using is an ISO 14443-3A, compatible with NfcA, MifareUltralight and Ndef. Data type is in NFC Forum Type 2.

Thanks

Thomas Skjølberg

unread,
Nov 5, 2014, 4:28:57 AM11/5/14
to nfc-dev...@googlegroups.com
Hi,

if you are looking to do some quick prototyping, see also


although this is not an open source alternative.

Best regards,
Thomas

David Kasabji

unread,
Nov 21, 2014, 12:09:58 PM11/21/14
to nfc-dev...@googlegroups.com
Hey guys!

Is there anything new to this project?

I just got my ACR122U and a Nexus 7 tablet on which I'd like to work (I know that Nexus 7 has NFC chip, regardless, it's for something else).
Are there any tutorials, or some better documentation available, than existing one on the ACS page ?

Thanks in advance.

Dne torek, 08. januar 2013 08:41:26 UTC+1 je oseba Marco Albarelli napisala:

Srijana karkidholi

unread,
Jan 14, 2015, 3:29:22 AM1/14/15
to nfc-dev...@googlegroups.com
Hi all

please tell me how to use ACS1252U as a smartcard reader. 
I have a ACS1252U-A1 connected to a desktop, And mode is set to card reader/writer, connection settings( share mode=direct, protocol T=undefined)
 and a smartphone(gemalto smartcard inserted) connected to the desktop.
When I tap the smartphone on the ACS, no change is found, it only makes beep sound  BUT  I want the ACS to read the smartcard and show the SW1 SW2 values on the APDU console.
But the problem is APDU console option is not enabled.

Thanks in advance
Jana

Sai Kapil

unread,
Mar 20, 2015, 7:38:15 AM3/20/15
to nfc-dev...@googlegroups.com
Hi Marco,


i have installed your https://github.com/marcoalbarelli/nfctools-aer app in an Android phone and connected ACR122u through OTG. I can detect the device but when i tap any tag or NFC enabled device over the reader the app crashes. Since the command sent is FFB0000004 and the received response is null. Can you please help me with this.

Thanks ,
Sai Kapil

Motosauro

unread,
Mar 20, 2015, 7:52:15 AM3/20/15
to nfc-dev...@googlegroups.com
Hi 
The app was a proof of concept and was set up only to read Miifare Ultralight-c tags (if I recall correctly)
You are probably trying to read a different type of tag that the app doesn't know how to handle
Good news is that the nfctools library provides the classes to read various tag types

If you look at my implementation you'll se it's quite self-explanatory
You should be able to use it as a starting point

Sai Kapil

unread,
Mar 20, 2015, 8:11:26 AM3/20/15
to nfc-dev...@googlegroups.com

Hi Marco,


Thanks for the quick reply. Does changing the TagType in ReaderStateChangeListener.java will do the purpose ? or some extra handling have to be done. ? Also does this allow P2P connection between Android phone and reader ? Thanks in advance.

Regards,
Sai Kapil Seetharaman

Motosauro

unread,
Mar 20, 2015, 8:50:20 AM3/20/15
to nfc-dev...@googlegroups.com

Hi
It's been years so I may say something false, but changing the tag class should do the trick.
No p2p connection, but it might work with host card emulation (available since android 4.4 I think)

Sai Kapil

unread,
Mar 25, 2015, 5:44:13 AM3/25/15
to nfc-dev...@googlegroups.com
Hi Marco,


I have tried reading a different card by changing the TagClass and Found successful. Can you give me any link of any open projects that can help me attain that Host card emulation method. I tried some projects but nothing happens between the app and ACR122u reader. Please guide me on how to use Host card emulation to write into the ACR122u reader. Thanks in advance.


Regards,
Sai kapil seetharaman 

Motosauro

unread,
Mar 25, 2015, 6:19:40 AM3/25/15
to nfc-dev...@googlegroups.com
Hi
I'm glad I've been helpful.

Regarding HCE:

The idea is that you make a phone behave as if it was a normal NFC chip.
The only issue is that it's available since 4.4 only, this means that you can cover ~50% of the devices using this approach


Sandeep Srinivasa

unread,
Aug 11, 2015, 9:54:47 PM8/11/15
to nfc-developers
On Wednesday, March 25, 2015 at 2:44:13 AM UTC-7, Sai Kapil wrote:
Hi Marco,


I have tried reading a different card by changing the TagClass and Found successful. Can you give me any link of any open projects that can help me attain that Host card emulation method. I tried some projects but nothing happens between the app and ACR122u reader. Please guide me on how to use Host card emulation to write into the ACR122u reader. Thanks in advance.


Regards,
Sai kapil seetharaman  

hi Sai,
did you get this piece of code working ? it would be great to see an example of the code working. I'm trying to read and write Mifare Ultralight tags. 

will be very helpful!

thanks
-Sandeep  
Reply all
Reply to author
Forward
0 new messages