Need the PN532 Module to only read and output the UID of the smart card
Posted: Thu Mar 22, 2018 1:58 pm
Hello everyone, I would like to begin with telling you that this is my first foray into using raspberry pi, nfc modules, linux commandline, and basically any kind of programming whatsoever.
I would also like to say this beforehand that if this is the wrong place to have posted about this particular problem, or if I have rambled on too much providing unnecessary information, do forgive me and try helping me anyway.
I am currently working on a project from my employer to develop a smart card reader for the company's employees' ID cards using the raspberry pi, since he himself (head of the IT dept.) is a raspberry pi enthusiast. Fast fowarding to what I have achieved so far-
I have connected the PN532 (https://www.sunfounder.com/pn532-nfc.html) to my Raspberry Pi Zero via UART interface and have successfully been able to read the smart cards used by the company through it. The following is the output I recieve-
Now what basically is happening here is that the PN532 is reading all the data stored on the smart card, but what my employer desires is that the PN532 read and output only the UID. Where the output on the terminal should look something like this-
!![the UID of the particular smart card]!!
And this last step is where I am stuck at. PLEASE HELP!
I would also like to say this beforehand that if this is the wrong place to have posted about this particular problem, or if I have rambled on too much providing unnecessary information, do forgive me and try helping me anyway.
I am currently working on a project from my employer to develop a smart card reader for the company's employees' ID cards using the raspberry pi, since he himself (head of the IT dept.) is a raspberry pi enthusiast. Fast fowarding to what I have achieved so far-
I have connected the PN532 (https://www.sunfounder.com/pn532-nfc.html) to my Raspberry Pi Zero via UART interface and have successfully been able to read the smart cards used by the company through it. The following is the output I recieve-
Code: Select all
pi@raspberrypizero:~/libnfc/examples $ sudo ./nfc-poll
/home/pi/libnfc/examples/.libs/lt-nfc-poll uses libnfc libnfc-1.7.1-191-g216145f
NFC reader: PN532 board via UART 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): 03 44
UID (NFCID1): 04 08 67 f2 6d 3f 80
SAK (SEL_RES): 20
ATS: 75 77 81 02 80
Waiting for card removing...nfc_initiator_target_is_present: Target Released
done.
!![the UID of the particular smart card]!!
And this last step is where I am stuck at. PLEASE HELP!