硬件准备:
USB转串口
4针杜邦线
PN532模块
IC卡一张(比如门禁卡,饭卡等)
软件准备:
Ubuntu 物理机一台
能够访问互联网
1,将PN532与USB转串口连接好,放一张IC卡靠近PN532模块
2,安装libnfc:
[email protected]:~$ sudo apt-get install libusb-dev [email protected]:~$ wget https://github.com/nfc-tools/libnfc/releases/download/libnfc-1.7.1/libnfc-1.7.1.tar.bz2 [email protected]:~$ tar xf libnfc-1.7.1.tar.bz2 [email protected]:~$ cd libnfc-1.7.1/ [email protected]:~/libnfc-1.7.1$ ./configure --prefix=${HOME}/NFC && make && make install [email protected]:~/libnfc-1.7.1$ mkdir -p ${HOME}/NFC/etc/nfc/ [email protected]:~/libnfc-1.7.1$ vim ${HOME}/NFC/etc/nfc/libnfc.conf device.name = "microBuilder.eu" device.connstring = "pn532_uart:/dev/ttyUSB0" [email protected]:~/libnfc-1.7.1$
3,检查Pn532与主机连接状态:
[email protected]:~/libnfc-1.7.1$ sudo ${HOME}/NFC/bin/nfc-list /home/chunli/NFC/bin/nfc-list uses libnfc 1.7.1 NFC device: pn532_uart:/dev/ttyUSB0 opened 1 ISO14443A passive target(s) found: ISO/IEC 14443A (106 kbps) target: ATQA (SENS_RES): 00 04 UID (NFCID1): 7e d5 92 90 SAK (SEL_RES): 08 [email protected]:~/libnfc-1.7.1$
驱动安装好了。
时间: 2024-10-10 16:22:14