ACR122U-A9 NFCtools for java NDEFReaderDemo

1,017 views
Skip to first unread message

Sam Hudson

unread,
May 2, 2013, 11:41:52 AM5/2/13
to nfc-dev...@googlegroups.com
Hi,

Im trying to use the NDEFReaderDemo to read an ultralight tag, it just says 'unknown card type'. I just want to build a very simple application to open a browser from the tag in Ubuntu.

java -cp nfctools-examples.jar org.nfctools.examples.ndefreader.NdefReaderDemo

root@ubuntu001:/home/administrator/Downloads# java -cp nfctools-examples.jar org.nfctools.examples.ndefreader.NdefReaderDemo
INFO : org.nfctools.examples.ndefreader.NdefReaderDemo - Listening...
DEBUG: org.nfctools.spi.acs.Acr122ReaderWriter - Starting new thread Thread-0
INFO : org.nfctools.examples.ndefreader.NdefReaderDemo - Done
Exception in thread "Thread-0" java.lang.RuntimeException: org.nfctools.mf.MfException: unknown card type: 804F0CA00000030603000300000000
at org.nfctools.spi.acs.PollingCardScanner.run(PollingCardScanner.java:51)
at java.lang.Thread.run(Thread.java:679)
Caused by: org.nfctools.mf.MfException: unknown card type: 804F0CA00000030603000300000000
at org.nfctools.spi.acs.CardResolver.resolvecard(CardResolver.java:44)
at org.nfctools.spi.acs.PollingCardScanner.waitForCard(PollingCardScanner.java:60)
at org.nfctools.spi.acs.PollingCardScanner.run(PollingCardScanner.java:45)
... 1 more

Any help would be hugely appreciated.

Adrian Stabiszewski

unread,
May 3, 2013, 5:44:44 AM5/3/13
to nfc-dev...@googlegroups.com
Please try the Ultralight Demo for Type2 tags:


java -cp nfctools-examples.jar org.nfctools.examples.ndef.NdefUltralight


Sam Hudson

unread,
May 3, 2013, 6:03:14 AM5/3/13
to nfc-dev...@googlegroups.com
Excellent, that works! Now i can crack on and get this thing working. thanks!

Sam Hudson

unread,
May 3, 2013, 9:52:37 AM5/3/13
to nfc-dev...@googlegroups.com
How can i detect a card? i need to be able to determine when a tag is connected. i see the logs work, but i cant access the tag information.

    protected void launchDemo(NfcTagListener... listeners) throws IOException
    {
        NfcAdapter nfcAdapter = new NfcAdapter(TerminalUtils.getAvailableTerminal(), TerminalMode.INITIATOR);
       
        for (NfcTagListener tagListener : listeners) {
            nfcAdapter.registerTagListener(tagListener);
        }

        nfcAdapter.registerUnknownTagListerner(new LoggingUnknownTagListener());
        nfcAdapter.startListening();
        System.out.println("Drop Dead Clocking Machine v1.1");
        System.out.println("Waiting for tags, press ENTER to exit");
        System.in.read();

    }

On Friday, 3 May 2013 10:44:44 UTC+1, Adrian Stabiszewski wrote:

Sam Hudson

unread,
May 3, 2013, 10:34:18 AM5/3/13
to nfc-dev...@googlegroups.com
Im getting so frustrated with this. There is ZERO documentation, and none of the code makes sence. I want to do the simplest thing and it just seems so difficult with this api.

I have a ACR122U and all i want to do is open a browser on my desktop with the url encoded in the tag. Why is this so difficult? I cannot find any logical way of how to do this.

Adrian Stabiszewski

unread,
May 4, 2013, 10:46:02 AM5/4/13
to nfc-dev...@googlegroups.com
Hi Sam,

well, maybe it is too simple... You just need to create your own NdefOperationsListener like the LoggingNdefListener.

Please feel free to setup a project at github so I can help you with your code.

Regards,
Adrian.
Reply all
Reply to author
Forward
0 new messages