- Open the command line
brew install libnfc
nfc-list
Note down the serial port e.g.pn532_uart:/dev/tty.usbserial-1440
. If your device is not listed check if you connected the TXD and RXD wire correctly. You can also check the tty and see where the usbserial adapter is connected to withls /dev/tty*
cd /usr/local/Cellar/libnfc/1.8.0/etc/nfc
- Open
libnfc.conf
- Add the following lines (use for
device.connstring
the serial port from step 3.)
device.name = "PN532 NFC Board" device.connstring = "pn532_uart:/dev/tty.usbserial-1440"
- Now everything should be setted up and if you place an nfc tag on the module it should be found by
nfc-poll
To be able to read or write NDEF messages you can use the command line tool libfreefare
.
- Open the command line
brew install libfreefare
- Create a textfile for example
helloWorld.txt
and add the following contentHello NFC World!
- Place an nfc tag on the modul and execute the following command:
mifare-classic-write-ndef -y -i helloWorld.txt
- Now the message should be written on to the tag and you can read it from there with:
mifare-classic-read-ndef -y -o readdata.txt