Modifications

Sauter à la navigation Sauter à la recherche
2 462 octets ajoutés ,  7 novembre 2015 à 19:49
Ligne 25 : Ligne 25 :  
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:
 
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:
   −
  <code>$ wget http://libnfc.googlecode.com/files/libnfc-x.x.x.tar.gz
+
  <nowiki>$ wget http://libnfc.googlecode.com/files/libnfc-x.x.x.tar.gz
 
$ tar -xvzf libnfc-x.x.x.tar.gz
 
$ tar -xvzf libnfc-x.x.x.tar.gz
$ cd libnfc-x.x.x</code>
+
$ cd libnfc-x.x.x</nowiki>
    +
=== Etape 2: Configurer libnfc pour PN532 via UART ===
 +
{{bloc-etroit|text=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):}}
 +
 +
<nowiki>$ ./configure --with-drivers=pn532_uart --enable-serial-autoprobe</nowiki>
 +
 +
{{underline|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
 +
 +
{{ADFImage|PN532-RFID-NFC-LibNFC-10.jpg}}
 +
 +
=== Etape 3: Faire le Build et installer libnfc ===
 +
You can build and install libnfc with the following three commands, also run from the folder where the original archive was unzipped:
 +
 +
<nowiki>  $ make clean
 +
  $ make
 +
  $ make install</nowiki>
 +
 +
=== Etape 4: Vérification pour les périphériques installés ===
 +
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:
 +
<nowiki>  $ cd examples
 +
  $ ./nfc-list</nowiki>
 +
 +
This should list the devices that were detected.
 +
 +
=== Etape 5: lecture de carte MiFare ===
 +
Nous allons faire une opération de polling pour récupérer les infos des cartes au standard ISO14443A (les cartes Mifare).
 +
 +
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:
 +
 +
<nowiki>$ ./nfc-poll</nowiki>
 +
 +
This should give you some basic information on any card that entered the magnetic field within the specified delay.
 +
 +
{{ADFImage|PN532-RFID-NFC-LibNFC-20.jpg}}
 +
 +
== Libnfc avec Mac OSX Lion ==
 +
scott-42 was kind of enough to post some tips on getting libnfc working on a Mac using an FTDI adapter. A couple simple changes to the code were required (as of v1.6.0-rc1), with the details [http://forums.adafruit.com/viewtopic.php?f=19&t=22085#p115684 here].
 +
 +
Keeping in mind the code changes mentionned above, the following steps should get libnfc compiling and working via an FTDI type adapter and UART on Lion (using libnfc 1.6.0_rc1):
    
https://learn.adafruit.com/adafruit-pn532-rfid-nfc/libnfc
 
https://learn.adafruit.com/adafruit-pn532-rfid-nfc/libnfc
    
{{PN532-RFID-NFC-TRAILER}}
 
{{PN532-RFID-NFC-TRAILER}}
29 922

modifications

Menu de navigation