1 (edited by kwx 2016-02-02 13:33:32)

Topic: [SOLVED] UART PN532 + PCSC-Lite + ifdnfc problems

Hi all.
Trying to make my UART PN532 work with PCSC-lite (and ifdnfc).

The story so far:

My reader is on /dev/ttyAMA0 (Elechouse PN532 module on the RPI)

It is configured in /usr/local/etc/nfc/devices.d/pn532_uart_on_rpi.conf

name = "PN532 board on UART"
connstring = pn532_uart:/dev/ttyAMA0:115200
allow_intrusive_scan = true

It is happily detected by lsnfc (and all other libnfc derivatives)

rebadge@000000006bb07853 /tmp/pcsc-tools-1.4.25 $ lsnfc
NFC device: pn532_uart:/dev/ttyAMA0
UID=6e72cf89

I have successfully installed ifdnfc, and pscs-lite.

My /usr/local/etc/reader.conf.d/ifdnfc is correct (I've also got a copy in place in /etc/reader.conf.d/ifdnfc)

cat /etc/reader.conf.d/ifdnfc
## This file can be enabled if you want to use ifdnfc with a non-usb device (not
## automatically detected by PCSC)
FRIENDLYNAME "IFD-NFC"
DEVICENAME   /dev/ttyAMA0
LIBPATH      /usr/lib/pcsc/drivers/ifdnfc.bundle/Contents/Linux/libifdnfc.so.0.1.4
CHANNELID    0

However, pcsc_scan returns nothing:

PC/SC device scanner
V 1.4.25 (c) 2001-2011, Ludovic Rousseau <ludovic.rousseau@free.fr>
Compiled with PC/SC lite version: 1.8.15
Using reader plug'n play mechanism
Scanning present readers...
Waiting for the first reader...

and ifdnfc-activate returns nothing:

ifdnfc-activate
Cannot find a smart card reader.

I'm unsure how to proceed from here - any insight would be much appreciated.

Re: [SOLVED] UART PN532 + PCSC-Lite + ifdnfc problems

With help from the one and only Ludovic Rousseau, the system now detects the reader, but refuses to detect cards:

/usr/sbin/pcscd -v
pcsc-lite version 1.8.4.
Copyright (C) 1999-2002 by David Corcoran <corcoran@linuxnet.com>.
Copyright (C) 2001-2011 by Ludovic Rousseau <ludovic.rousseau@free.fr>.
Copyright (C) 2003-2004 by Damien Sauveron <sauveron@labri.fr>.
Report bugs to <muscle@lists.musclecard.com>.
Enabled features: Linux arm-unknown-linux-gnueabihf serial usb libudev usbdropdir=/usr/lib/pcsc/drivers ipcdir=/var/run/pcscd configdir=/etc/reader.conf.d

lsnfc reports the reader (+EMV card)

lsnfc
NFC device: pn532_uart:/dev/ttyAMA0
UID=6e72cf89
Several possible matches:
* NXP MIFARE Plus 1k
* NXP MIFARE Plus 4k
* NXP JCOP31 or JCOP41
1 tag(s) on device.

pcsc_scan finds the device, but not the badge (it can be an EMV card or standard MIFARE etc)

PC/SC device scanner
V 1.4.25 (c) 2001-2011, Ludovic Rousseau <ludovic.rousseau@free.fr>
Compiled with PC/SC lite version: 1.8.15
Using reader plug'n play mechanism
Scanning present readers...
0: PN532 board on UART 00 00
Tue Feb  2 12:44:21 2016
Reader 0: PN532 board on UART 00 00
  Card state: Card removed,

Any assistance from here would be most appreciated. It's very, very close !

Re: [SOLVED] UART PN532 + PCSC-Lite + ifdnfc problems

Solved: Method was as follows:

- Install pcsc-lite
- Install ifdnfc
- Update + copy /usr/local/etc/readers.d/ifdnfc to /etc/ifdnfc
- Restart pcscd
- Run ifdnfc-activate

From this point, pcsc_scan should work.