我最近买了这款NFC / RFID读卡器PN532 module V3
我想用我的覆盆子pi 3.我已经安装并配置了库libnfc . PN532与I2C连接 . 我已经在我的RPi上启用了它 .
我的问题是我无法扫描任何东西 . 确实,当我在控制台中运行函数 nfc-poll
时,我得到了这个:
nfc-poll uses libnfc 1.7.1
NFC reader: pn532_i2c:/dev/i2c-1 opened
NFC device will poll during 30000 ms (20 pollings of 300 ms for 5 modulations)
nfc_initiator_poll_target: Success
在民意调查期间,我在PN532附近传递了许多不同的标签,甚至是带有它的那些标签 . 但是从来没有任何发现 . 尽管如此,RPi似乎与PN532正确通信,如第二行所示 .
命令 i2cdetect -y 1
返回正常:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- 24 -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
PN532接线如下:
-
GND - > GPIO 6
-
VCC - > GPIO 4
-
SDA - > GPIO 3
-
SCL - > GPIO 5
我检查了接线(我的黄色指示灯亮了,如果我删除SDA或SCL连接,我收到一条错误消息,尝试 nfc-poll
表示连接正常)
我检查了PN532上两个开关的位置,以启用I2C通信 .
我的libnfc配置文件( /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 (dehttp://www.jamesrobertson.eu/pages/2014/mar/30/rfid-module.htmlfault: 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 = "Itead_PN532_SPI"
device.connstring = "pn532_i2c:/dev/i2c-1"
我试图将参数 allow_intrusive_scan
设置为 true
,但它不会改变任何东西 .
你有什么主意吗 ?非常感谢你提前 .