This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tutorials:products:rfidnfc:libnfc.html [2011/09/02 21:12] ladyada created |
tutorials:products:rfidnfc:libnfc.html [2016/01/28 18:05] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Using the PN532 Breakout Boards with libnfc ===== | + | ====== Moved! ====== |
- | [[http://www.libnfc.org|libnfc]] is a mature, cross-platform, open-source NFC library that can be easily configured to work with the PN532 Breakout Board. While Linux is probably the easiest platform to use libnfc with, it can be configured for the Mac and Windows as well, though you may need to dig around on the libnfc Community Forums for some specific details on compiling .dlls for Windows, etc. | + | This tutorial has moved to [[http://learn.adafruit.com/adafruit-pn532-rfid-nfc|http://learn.adafruit.com/adafruit-pn532-rfid-nfc]] |
- | + | ||
- | If you want to test the PN532 Breakout Board out with libnfc, this simple tutorial should walk you through the absolute basics of compiling and configuring libnfc, and using some of the canned example SW included in the library. | + | |
- | + | ||
- | ===== libnfc In Linux (Ubuntu 10.10 used in this example) ===== | + | |
- | + | ||
- | ==== Step One: Download libnfc ==== | + | |
- | + | ||
- | Download the latest version of [[http://code.google.com/p/libnfc/downloads/list|libnfc from Google Code]] (ex. "libnfc-1.4.1.tar.gz") and extract the contents of the file as follows: | + | |
- | + | ||
- | $ wget http://libnfc.googlecode.com/files/libnfc-x.x.x.tar.gz | + | |
- | $ tar -xvzf libnfc-x.x.x.tar.gz | + | |
- | $ cd libnfc-x.x.x | + | |
- | + | ||
- | ==== Step Two: Configure libnfc for PN532 and UART ==== | + | |
- | + | ||
- | libnfc currently only supports communication over UART, using any inexpensive USB to UART adapter like the FTDI Friend or a TTL FTDI cable. Before compiling, however, you will need to configure libnfc to include support for UART and the PN532 chipset, which can be done with the following commmand (executing in the folder where the above archive was unzipped): | + | |
- | + | ||
- | $ ./configure --with-drivers=pn532_uart --enable-serial-autoprobe | + | |
- | + | ||
- | **Note**: If you also wish to include debug output, you can add the '--enable-serial-autoprobe' flag (minus the single quotes) to the configure options | + | |
- | + | ||
- | ==== Step Three: Build and install libnfc ==== | + | |
- | + | ||
- | You can build and install libnfc with the following three commands, also run from the folder where the original archive was unzipped: | + | |
- | + | ||
- | $ make clean | + | |
- | $ make | + | |
- | $ make install | + | |
- | + | ||
- | ==== Step Four: Check for installed devices ==== | + | |
- | + | ||
- | Now that libnfc is (hopefully) built and installed, you can run the 'nfc-list' example to try to detect an attached NFC board. Make sure the board is connected to the FTDI or USB/UART adapter, and that it is connected to your PC, and run the following commands: | + | |
- | + | ||
- | $ cd examples | + | |
- | $ ./nfc-list | + | |
- | + | ||
- | This should list the devices that were detected | + | |
- | + | ||
- | ==== Step Five: Poll for an ISO14443A (Mifare, etc.) Card ==== | + | |
- | + | ||
- | Next, you can use the 'nfc-poll' example to wait 30 seconds for an ISO14443A card or tag and display some basic information about this card. In the examples folder that we changed to above, run the following command: | + | |
- | + | ||
- | $ ./nfc-poll | + | |
- | + | ||
- | This should give you some basic information on any card that entered the magnetic field within the specified delay. | + |