Skip to content

Instantly share code, notes, and snippets.

@jellyjellyrobot
Last active February 12, 2018 16:50
Show Gist options
  • Save jellyjellyrobot/313b99f9f6534f10dafd9fa9d9a9984f to your computer and use it in GitHub Desktop.
Save jellyjellyrobot/313b99f9f6534f10dafd9fa9d9a9984f to your computer and use it in GitHub Desktop.
libnfc + mfoc for fun, maybe profit?
# Prereq
brew tap jlhonora/lsusb
brew install autoconf doxygen automake libtool libusb libusb-compat --universal wget pkgconfig lsusb
# Libnfc
git clone git@github.com:nfc-tools/libnfc.git
cd libnfc
./make_release.sh
autoreconf -vis
./configure --enable-doc --with-drivers=all --sysconfdir=/etc --prefix=/usr
make clean all
make
sudo make install
make doc
# Mfoc
cd ..
git clone git@github.com:nfc-tools/mfoc.git
cd mfoc
autoreconf -vis
./configure LDFLAGS=-L/usr/local/lib PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
make
sudo make install
# Config for UART PN532
mkdir /usr/local/etc/nfc/
mkdir /usr/local/etc/nfc/devices.d/
sudo mkdir /etc/nfc
sudo mkdir /etc/nfc/devices.d
sudo echo "" > /usr/local/etc/nfc/devices.d/pn532_uart.conf
sudo echo "allow_autoscan = false" > /usr/local/etc/nfc/libnfc.conf
sudo echo "allow_intrusive_scan = false" >> /usr/local/etc/nfc/libnfc.conf
sudo echo "log_level=1" >> /usr/local/etc/nfc/libnfc.conf
sudo echo "device.name = \"PN532 board via UART\"" >> /usr/local/etc/nfc/libnfc.conf
sudo echo "device.connstring = \"pn532_uart:/dev/"$(ls /dev | grep tty.usbserial)\" >> /usr/local/etc/nfc/libnfc.conf
sudo cp /usr/local/etc/nfc/libnfc.conf /etc/nfc/libnfc.conf
sudo cp /usr/local/etc/nfc/devices.d/pn532_uart.conf /etc/nfc/devices.d/pn532_uart.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment