OpenWrt package for libnfc library, enabling NFC (Near Field Communication) functionality on OpenWrt systems.
This project provides build configuration for the libnfc library and related tools for OpenWrt. libnfc is an open source, cross-platform, low-level NFC SDK and programming API that supports various NFC devices and tag operations.
- libnfc 1.8.0 - Core NFC library
- Multiple driver support:
- PN532 UART
- PN532 SPI
- PN532 I2C
- Supported tag types:
- MIFARE Classic
- MIFARE Ultralight
- Jewel Topaz
- NFC Forum Tag Type 3/4
- Comprehensive utility toolset
Core library package providing basic NFC operations.
Features:
- Manipulate Jewel Topaz tags
- Manipulate MIFARE Classic and Ultralight tags
- Low-level NFC communication interface
Collection of NFC utility tools.
Included tools:
nfc-emulate-forum-tag4- Emulates NFC Forum Tag Type 4 v2.0 (or v1.0)nfc-jewel- Jewel tag dump/restore toolnfc-list- Lists the first target present of each founded devicenfc-mfclassic- MIFARE Classic manipulation examplenfc-mfultralight- MIFARE Ultralight dump/restore toolnfc-read-forum-tag3- Extract NDEF Message from NFC Forum Tag Type 3nfc-relay-picc- Relay example using two PN532 devicesnfc-scan-device- Lists each available NFC device
Onion NFC/RFID Expansion Applications.
Place this project in the package directory of your OpenWrt SDK:
cd /path/to/openwrt-sdk/package
git clone <repository-url> libnfc-openwrtConfigure build options:
make menuconfigNavigate to:
Libraries->libnfcUtilities->nfc-utilsOnion->Utilities->nfc-exp(optional)
Build the package:
make package/libnfc-openwrt/compile V=sAfter installation, the configuration file is located at /etc/nfc/libnfc.conf.
allow_autoscan = true
allow_intrusive_scan = false
log_level = 1
device.name = "PN532 via CH341"
device.connstring = "pn532_uart:/dev/ttyUSB7"allow_autoscan- Enable automatic device scanningallow_intrusive_scan- Enable intrusive scanninglog_level- Log level (0-3)device.name- Device namedevice.connstring- Device connection string
- UART:
pn532_uart:/dev/ttyUSB0 - SPI:
pn532_spi:/dev/spidev0.0 - I2C:
pn532_i2c:/dev/i2c-1
nfc-scan-devicenfc-listnfc-mfclassic r a dump.mfdnfc-mfclassic w a dump.mfdnfc-mfultralight r dump.mfdThis package supports NFC modules based on the PN532 chip, connected via:
- UART (Serial)
- SPI
- I2C
Compatible hardware includes:
- PN532 NFC modules
- PN532 modules connected via CH341 USB-to-serial adapter
- libnfc: LGPL-2.1
- OpenWrt Package: GPL-2.0
Sebastian Wendel packages@sourceindex.de
- Verify the device is properly connected
- Confirm the device node exists (e.g.,
/dev/ttyUSB0) - Check if the connection string in
libnfc.confis correct - Try running
nfc-scan-device -vfor verbose output
Ensure the user running NFC tools has permission to access the device node:
chmod 666 /dev/ttyUSB0Modify log_level to 3 in the configuration file for detailed logs:
log_level = 3Issues and Pull Requests are welcome!