LIBNFC无法通过I2C连接到PN532,而超时错误
我想使用PN532 NFC读取器读取NFC标签,该标签通过I2C连接到Raspberry Pi零。 PI通过 raspi-config
启用了i2c。
尝试使用 nfc-list
或 nfc-pull
访问设备时,我会收到一个超时错误:
$ nfc-list
debug libnfc.general log_level is set to 3
debug libnfc.general allow_autoscan is set to true
debug libnfc.general allow_intrusive_scan is set to false
debug libnfc.general 1 device(s) defined by user
debug libnfc.general #0 name: "PN532 over I2C", connstring: "pn532_i2c:/dev/i2c-1"
nfc-list uses libnfc 1.8.0
debug libnfc.general 0 device(s) found using acr122_usb driver
debug libnfc.general 0 device(s) found using pn53x_usb driver
debug libnfc.chip.pn53x Diagnose
debug libnfc.chip.pn53x Timeout value: 500
debug libnfc.chip.pn53x SAMConfiguration
debug libnfc.chip.pn53x Timeout value: 1000
debug libnfc.bus.i2c TX: 00 00 ff 03 fd d4 14 01 17 00
debug libnfc.bus.i2c wrote 10 bytes successfully.
debug libnfc.driver.pn532_i2c timeout reached with no READY frame.
pn53x_check_communication: Timeout
debug libnfc.chip.pn53x InRelease
debug libnfc.bus.i2c TX: 00 00 ff 03 fd d4 52 00 da 00
debug libnfc.bus.i2c wrote 10 bytes successfully.
debug libnfc.driver.pn532_i2c timeout reached with no READY frame.
debug libnfc.general Unable to open "pn532_i2c:/dev/i2c-1".
nfc-list: ERROR: Unable to open NFC device: pn532_i2c:/dev/i2c-1
可能是相关的I2Cdectect报告,每一个地址都存在一个设备PN532连接到PI:
$ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77
如果PN532与PI断开连接,则I2CDECT仅找到一个设备:
$ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- 67 -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
/dev和I2C-2中只有两个I2C接口,而I2C-2没有任何连接的设备。
$ ls -la /dev/ | grep i2c
crw-rw---- 1 root i2c 89, 1 Jun 23 15:39 i2c-1
crw-rw---- 1 root i2c 89, 2 Jun 23 15:35 i2c-2
如何解决超时错误?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想尝试NFC一段时间,然后开始接口PN532 NFC RFID读/写模块v3套件与beaglebone black black
-where-where-where-i-where-i-bought-ther-ther-ther-ther-ther-ther-ther-ther-ther-ther-ther-this-this-kit:
我尝试通过DTS启用此功能。再加上NFC虽然Menuconfig。但无法启动图像。它悬挂在
pn532_i2c
驱动程序加载的地方是我所做的更改:
dts更改我进行:
我确保在
i2cdetect
上,我能够看到该NFC套件检测到。一段时间后,我开始探索,
libnfc
,我在此方面取得了巨大的成功。我有这个libnfc
克隆在我的BBB上,并使用以下步骤编译:libnfc
在这里:libnfc
libnfc.conf.conf.sample
如下更新 img src =“ https://i.sstatic.net/2fksovzm.png” alt =“ libnfc.conf”>
我能够启动和运行NFC使该模块启动并运行的方法。确保您更新
device.name
和device.connstring
与您的硬件连接匹配。结果我已经
设置了
nfc-list-out
I wanted to try NFC for a while and I started off by interfacing PN532 NFC RFID Read/Write Module V3 Kit with BeagleBone Black
Link-From-Where-I-Bought-This-Kit: PN532 NFC RFID Read / Write Module V3 Kit
Initially, I connected this kit with BBB and I tried enabling this through DTS. Plus also enabled NFC though menuconfig. But couldn't get image booted up. It hung at place where
pn532_i2c
driver was getting loadedHere are the changes I made:
DTS changes I made:
I ensured that on
i2cdetect
, I was able to see this NFC kit detected.After a while I started exploring,
libnfc
and I had good success with this. I had thislibnfc
cloned on my BBB and compiled using steps below:libnfc
that I used is here:libnfc
updated
libnfc.conf.sample
as below and moved it to/etc/nfc/
I was able to get NFC up and running, it's important to update
conf
in right way to get this module up and running. Ensure you updatedevice.name
anddevice.connstring
that matches with your hardware connections.Results I had
Setup
nfc-list-output
nfc-poll-output