2

I'm using a Raspberry Pi to build an NFC card reader applet in Java. For some reason Java doesn't 'see' the entire Terminal, while nfc-list and pcsc_scan all see the connected reader.

pi@raspberrypi ~ $ sudo nfc-poll nfc-poll uses libnfc 1.7.1 NFC reader: ACS / ACR122U PICC Interface opened NFC device will poll during 30000 ms (20 pollings of 300 ms for 5 modulations) ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 00  04
       UID (NFCID1): 3b  3a  34  06

And pcsc_scan

pi@raspberrypi ~/pcsc-tools-1.4.23 $ ./pcsc_scan
PC/SC device scanner
V 1.4.23 (c) 2001-2011, Ludovic Rousseau <ludovic.rousseau@free.fr>
Compiled with PC/SC lite version: 1.8.13
Using reader plug'n play mechanism
Scanning present readers...
0: ACS ACR122U 00 00

Mon Apr 13 12:06:54 2015

My Java code looks like this, it's a small script to see if the Terminals work.

import java.util.List;
import javax.smartcardio.*;

public class ReadCard {

        public static void main(String[] argv) throws Exception {

                // show the list of available terminals
                TerminalFactory factory = TerminalFactory.getDefault();

                List<CardTerminal> terminals = factory.terminals().list();
                System.out.println("Terminals: " + terminals);
        }
}

I've also tried to manually select the pcsc library with the following command:

pi@raspberrypi ~ $ java -Dsun.security.smartcardio.library=/usr/local/lib/libpcsclite.so.1 ReadCard
Terminals: []
pi@raspberrypi ~ $ whereis libpcsclite.so.1
libpcsclite.so: /usr/local/lib/libpcsclite.so.1 /usr/local/lib/libpcsclite.so

Unfortunatly, this didn't work either.

Looking for advice what to do next, thanks in advance!

DescX
  • 334
  • 1
  • 5
  • 19
  • 1
    Did you solve your problem? I have the same problem... – KBeckers Oct 07 '15 at 10:16
  • Hi @KBeckers, I'm no longer working at that project, but we managed to get it working eventually. I'm not sure what the exact starting parameters were, but i'll try to see if i can get a hold of the projectgroup that works with that application now. – DescX Oct 07 '15 at 16:08
  • If this is helpful use this link. [Java using smartcardio not detecting reader](https://stackoverflow.com/questions/12376257/accessing-javax-smartcardio-from-linux-64-bits) – Zablon Feb 03 '21 at 09:18

1 Answers1

0

Same here. Additional hint: The LED was not active.

But connecting the CardReader to an active USB hub works for me(*). The LED turns on, it beeps and java can find the terminal.

(* It works for a few hours :-O)

Edit: For the records:

Reinstalling the packets brought my device back to live. Every time when I change the USB port, i have to reinstall the packets.

apt-get install --reinstall pcscd pcsc-tools libpcsclite1 libpcsclite-dev libpcsclite1 libccid

(I did not have time to determine the packet causing...)

Ralph Erdt
  • 537
  • 4
  • 16