Topic: [solved] NFC - PN532 uart (nfc-poll and nfc-list problems)
Hi everyone !
I am pretty new to NFC and I am experiencing an issue while trying to use some of the applications provided by libnfc.
I have a PN532 NFC/RFID controller breakout board as reader and I use a Philips MIFARE card (provided with the board). The board is connected to a Linux environment by means of an uart connection.
I would like some help about 2 things.
I have successfully installed the libnfc (with the parameters --with-drivers=pn532_uart – enable-serial-autoprobe)
When I realize a “nfc-anticol”, I obtain this :
$ nfc-anticol Connected to NFC reader: PN532 (/dev/ttyS0) - PN532 v1.6 (0x07) Sent bits: 26 (7 bits) Received bits: 04 00 Sent bits: 93 20 Received bits: 3e 65 4b 9a 8a Sent bits: 93 70 3e 65 4b 9a 8a e9 7b Received bits: 08 b6 dd Sent bits: 50 00 57 cd Found tag with UID: 3e654b9a ATQA: 0004 SAK: 08
The card seems to be correctly found.
(I have also installed “nfcutils” and with a “lsnfc”, I obtain :
$ lsnfc device = PN532 (/dev/ttyS0) - PN532 v1.6 (0x07) UID=3e654b9a Several possible matches: * NXP MIFARE Classic 1k * NXP MIFARE Plus 1k 1 tag(s) on device.
The problem appears when I use “nfc-list” and “nfc-poll”.
With nfc-list, the device is found but there is an “infinite loop” and I don't think it is correct according to the nfc-list example in the libnfc documentation.
$ nfc-list nfc-list use libnfc 1.4.2 (r891) Connected to NFC device: PN532 (/dev/ttyS0) - PN532 v1.6 (0x07) 1 ISO14443A passive target(s) was found: ATQA (SENS_RES): 00 04 UID (NFCID1): 3e 65 4b 9a SAK (SEL_RES): 08 (and nothing else...)
I have the same result with “nfc-poll” :
$ nfc-poll nfc-poll use libnfc 1.4.2 (r891) Connected to NFC reader: PN532 (/dev/ttyS0) - PN532 v1.6 (0x07) PN532 will poll during 30000 ms (and nothing else...)
Is there someone having experienced such issue?
PS: When I realize a nfc-list with debug enabled, I obtain the same result with more lines of DBG. But about some seconds, there is only an “infinite” line displayed:
nfc-list: DBG uart_posix.c:219 nfc-list: iExpectedByteCount == 0
So I think the infinite loop is due to this iExpectedByteCount... I tried to see the uart_posix.c file but I don't really see how to solve the problem.
My second question is regarding reading / writing data from / to the card.
I use the “nfc-mfclassic r a test.mfd” tool to read the data from the card and I obtain the file which looks like the example file: http://www.libnfc.org/_detail/libnfc/do … mfclassic.
I would like to know what means the “a” or “b” key in the command line? And do you know what are the “key blocks” in the file?
Sorry for all these questions and thank you very much for any help !