硬件准备:
USB转串口
4针杜邦线
PN532模块
IC卡一张(比如门禁卡,饭卡等)
软件准备:
Ubuntu 物理机一台
能够访问互联网
1,将PN532与USB转串口连接好,放一张IC卡靠近PN532模块
2,安装libnfc:
chunli@ubuntu:~$ sudo apt-get install libusb-dev chunli@ubuntu:~$ wget https://github.com/nfc-tools/libnfc/releases/download/libnfc-1.7.1/libnfc-1.7.1.tar.bz2 chunli@ubuntu:~$ tar xf libnfc-1.7.1.tar.bz2 chunli@ubuntu:~$ cd libnfc-1.7.1/ chunli@ubuntu:~/libnfc-1.7.1$ ./configure --prefix=${HOME}/NFC && make && make install chunli@ubuntu:~/libnfc-1.7.1$ mkdir -p ${HOME}/NFC/etc/nfc/ chunli@ubuntu:~/libnfc-1.7.1$ vim ${HOME}/NFC/etc/nfc/libnfc.conf device.name = "microBuilder.eu" device.connstring = "pn532_uart:/dev/ttyUSB0" chunli@ubuntu:~/libnfc-1.7.1$
3,检查Pn532与主机连接状态:
chunli@ubuntu:~/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 chunli@ubuntu:~/libnfc-1.7.1$
驱动安装好了。
本文出自 “李春利” 博客,请务必保留此出处http://990487026.blog.51cto.com/10133282/1958895
原文地址:http://990487026.blog.51cto.com/10133282/1958895