linux 安裝 libnfc ,打開串口PN532
阿新 • • 發佈:2017-08-24
linux 安裝 libnfc 打開串口pn532
硬件準備:
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$
驅動安裝好了。
本文出自 “李春利” 博客,請務必保留此出處http://990487026.blog.51cto.com/10133282/1958895
linux 安裝 libnfc ,打開串口PN532