大自然生命的進化,遵循著『遺傳』與『突變』。觀察近百年科技的發展,也許可說是『突飛猛進』,或恐失於『內省總結』之不足 。無論『漸』與『頓』,及其所『悟』一也。『價值』取捨之道,或當反思前後五百年的『歷史興衰』。於『革故鼎新』之恆常變化裡,確立堅定『不易』之典範。科技護生之旨,在教育、在防未然 、在省思生命之可貴…… 如果說『那一日』不過『某一日』,假使講『那一夜』只是『有一夜』,怕將難保『那悲劇』不再重演的耶 ??!!
雖說
《Adafruit NFC/RFID on Raspberry PiAdd RFID/NFC read and write to your Pi in an hour!》
仍有參考價值,然而『libnfc』已更新至 1.7.1 版,同時樹莓派的 raspbian 以及核心版本也早不同,就讓我們從軟體安裝開始展開 Adafruit 『PN532 NFC/RFID controller breakout board – v1.6』
的探討︰
# libnfc 1.7.1 編譯與安裝 sudo apt-get install libudev-dev sudo apt-get install libusb-dev wget https://bintray.com/artifact/download/nfc-tools/sources/libnfc-1.7.1.tar.bz2 tar xjf libnfc-1.7.1.tar.bz2 cd libnfc-1.7.1/ ./configure --prefix=/usr --sysconfdir=/etc make sudo make install # 避免 pn532 被誤認為 pn533 sudo nano /etc/modprobe.d/nfc-blacklist.conf more /etc/modprobe.d/nfc-blacklist.conf # 檔案內容 blacklist pn533 blacklist nfc sudo modprobe -r pn533 nfc sudo reboot # nfc-tool Libfreefare 編譯與安裝 sudo apt-get install autoconf automake git libtool libssl-dev pkg-config git clone https://github.com/nfc-tools/libfreefare.git cd libfreefare/ autoreconf -vis ./configure --prefix=/usr make sudo make install # 用 USB 轉 RS232 來連接 Adafruit PN532 NFC/RFID controller breakout board 的設定檔 sudo mkdir /etc/nfc sudo mkdir /etc/nfc/devices.d sudo nano /etc/nfc/devices.d/pn532_uart_on_rpi.conf sudo nano /etc/nfc/libnfc.conf more /etc/nfc/devices.d/pn532_uart_on_rpi.conf # 檔案內容 ## Typical configuration file for PN532 board (ie. microbuilder.eu / Adafruit) device name = "Adafruit PN532 board via UART" connstring = pn532_uart:/dev/ttyUSB0 allow_intrusive_scan = true log_level = 3 more /etc/nfc/libnfc.conf # 檔案內容 # Allow device auto-detection (default: true) # Note: if this auto-detection is disabled, user has to set manually a device # configuration using file or environment variable allow_autoscan = true # Allow intrusive auto-detection (default: false) # Warning: intrusive auto-detection can seriously disturb other devices # This option is not recommended, user should prefer to add manually his device. #allow_intrusive_scan = false # Set log level (default: error) # Valid log levels are (in order of verbosity): 0 (none), 1 (error), 2 (info), 3 (debug) # Note: if you compiled with --enable-debug option, the default log level is "debug" #log_level = 1 # Manually set default device (no default) # To set a default device, you must set both name and connstring for your device # Note: if autoscan is enabled, default device will be the first device available in device list. #device.name = "microBuilder.eu" #device.connstring = "pn532_uart:/dev/ttyUSB0" # 悠遊卡讀取測試 pi@raspberrypi ~ sudo nfc-list 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): e0 e7 27 11 SAK (SEL_RES): 08 pi@raspberrypi ~ $
【參考圖片】