简体   繁体   English

libnfc:无法打开NFC设备

[英]libnfc: unable to open NFC device

I have a problem with libnfc on a Raspberry Pi 3B trying to read data from a PN532 card reader. 我在尝试从PN532读卡器读取数据的Raspberry Pi 3B上的libnfc遇到问题。 I installed libnfc as the official site suggest to do and in fact it all worked this morning. 我按照官方站点的建议安装了libnfc,实际上,今天上午所有工作都正常了。 I was able to detect my device using the nfc-list and nfc-scan-device commands. 我能够使用nfc-listnfc-scan-device命令检测到我的设备。

Then I tried to run a C program (not done by me, but done by a person here in the company) and it worked. 然后,我尝试运行一个C程序(不是我自己做的,而是由公司里的一个人完成的),并且它起作用了。 Did it again and it didn't work, but returned an error. 再次执行,它不起作用,但是返回了错误。 Tried to run the nfc-list command and it returned the same error. 试图运行nfc-list命令,它返回了相同的错误。 Since then, it looks like the libnfc library stopped working properly. 从那时起,libnfc库似乎停止正常工作。

These are the errors I get when I try to run some commands: 这些是我尝试运行一些命令时遇到的错误:

nfc-list : nfc-list

nfc-list uses libnfc 1.7.1
error   libnfc.bus.i2c  Error: wrote only -1 bytes (10 expected).
error   libnfc.driver.pn532_i2c Unable to transmit data. (TX)
pn53x_check_communication: Input / Output Error
error   libnfc.bus.i2c  Error: wrote only -1 bytes (10 expected).
error   libnfc.driver.pn532_i2c Unable to transmit data. (TX)
nfc-list: ERROR: Unable to open NFC device: pn532_i2c:/dev/i2c-1

nfc-scan-device -v : nfc-scan-device -v

nfc-scan-device uses libnfc 1.7.1
1 NFC device(s) found:
error   libnfc.bus.i2c  Error: wrote only -1 bytes (10 expected).
error   libnfc.driver.pn532_i2c Unable to transmit data. (TX)
pn53x_check_communication: Input / Output Error
error   libnfc.bus.i2c  Error: wrote only -1 bytes (10 expected).
error   libnfc.driver.pn532_i2c Unable to transmit data. (TX)
nfc_open failed for pn532_i2c:/dev/i2c-1

LIBNFC_LOG_LEVEL=3 nfc-list : LIBNFC_LOG_LEVEL=3 nfc-list

debug   libnfc.config   key: [device.name], value: [PN532 over I2C]
debug   libnfc.config   key: [device.connstring], value: [pn532_i2c:/dev/i2c-1]
debug   libnfc.config   Unable to open directory: /etc/nfc/devices.d
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.7.1
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
error   libnfc.bus.i2c  Error: wrote only -1 bytes (10 expected).
error   libnfc.driver.pn532_i2c Unable to transmit data. (TX)
pn53x_check_communication: Input / Output Error
debug   libnfc.chip.pn53x   InRelease
debug   libnfc.bus.i2c  TX: 00 00 ff 03 fd d4 52 00 da 00
error   libnfc.bus.i2c  Error: wrote only -1 bytes (10 expected).
error   libnfc.driver.pn532_i2c Unable to transmit data. (TX)
debug   libnfc.general  Unable to open "pn532_i2c:/dev/i2c-1".
nfc-list: ERROR: Unable to open NFC device: pn532_i2c:/dev/i2c-1

Searched a lot but didn't find anything useful. 搜索了很多,但没有发现任何有用的信息。 Thank you. 谢谢。

Have the same problem it was a problem on the circuit I believe. 有同样的问题,我认为这是电路上的问题。 Taking it off and re putting it back solved the problem for me. 把它取下来再放回去为我解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM