Step One: Download libnfc
Before you can do anything, you will need to get a copy of libnfc. Make sure you have an Ethernet cable connected to your Pi, and run the following commands to get libnfc 1.7.0$ cd /home/pi $ mkdir libnfc $ cd libnfc $ wget https://github.com/nfc-tools/libnfc/releases/download/libnfc-1.7.0/libnfc-1.7.0.tar.bz2 $ tar -xvjf libnfc-1.7.0.tar.bz2
Step Two: Setup libnfc for the Pi
Before libnfc can be built, it needs to be configured for the target system and based on some parameters specific the NFC device you have connected.libnfc 1.7.0 and later use a new config file, which needs to be placed at a specific location. Thankfully, libnfc 1.7.0 includes a config file for the Raspberry Pi, which you can copy to the right destination with the following commands:
$ cd libnfc-1.7.0 $ sudo mkdir /etc/nfc $ sudo mkdir /etc/nfc/devices.d $ sudo cp contrib/libnfc/pn532_uart_on_rpi.conf.sample /etc/nfc/devices.d/pn532_uart_on_rpi.conf
sudo nano /etc/nfc/devices.d/pn532_uart_on_rpi.conf
allow_intrusive_scan = true
Press CTRL+O then enter to save the file, and then CTRL+X to quite nano.
Step Three: Run Config
The next step is to configure the project itself using the 'configure' tool, as follows:$ sudo apt-get install autoconf $ sudo apt-get install libtool $ sudo apt-get install libpcsclite-dev libusb-dev $ autoreconf -vis $ ./configure --with-drivers=pn532_uart --sysconfdir=/etc --prefix=/usr
$ sudo make clean $ sudo make install all