【问题标题】:libnfc: unable to open NFC devicelibnfc:无法打开 NFC 设备
【发布时间】:2019-02-13 15:55:52
【问题描述】:

我在尝试从 PN532 读卡器读取数据的 Raspberry Pi 3B 上遇到 libnfc 问题。我按照官方网站的建议安装了 libnfc,实际上今天早上一切正常。我能够使用nfc-listnfc-scan-device 命令检测到我的设备。

然后我尝试运行一个 C 程序(不是我做的,而是公司里的一个人做的),它成功了。又做了一次,它没有工作,但返回一个错误。 尝试运行 nfc-list 命令并返回相同的错误。从那以后,libnfc 库似乎停止了正常工作。

这些是我尝试运行一些命令时遇到的错误:

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 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:

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

搜索了很多,但没有找到任何有用的东西。 谢谢。

【问题讨论】:

  • 你是怎么解决的?谢谢。

标签: c nfc lib-nfc


【解决方案1】:

有同样的问题 我相信这是电路上的问题。 把它取下来重新放回去为我解决了这个问题。

【讨论】:

  • 几周前也做了同样的事,说了一大堆坏话后解决了!还是谢谢你,
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-12-31
  • 2014-08-04
  • 2019-12-18
  • 2012-12-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多