5

我刚给自己买了一个新的 ACR122U-A9 nfc 阅读器,我需要在 ubuntu 18.10 上使用 libnfc 进行设置。它需要与 libnfc 一起使用,因为 mfoc 接口就是这样(如果有办法在没有 libnf 的情况下使用 mfoc,那太好了!该解决方案也会对我有所帮助!)在安装 libnfc 1.7.1 并进行了几个小时的研究之后,我仍然做了不让它工作。每次我使用sudo nfc-list并且 pcscd 没有运行时,它都会给我以下错误:

nfc-list uses libnfc 1.7.1
error   libnfc.driver.acr122_usb    Unable to set alternate setting on USB interface (Connection timed out)
nfc-list: ERROR: Unable to open NFC device: acr122_usb:004:005

如果 pcscd 正在运行,则错误内容如下:

nfc-list uses libnfc 1.7.1
error   libnfc.driver.acr122_usb    Unable to set alternate setting on USB interface (Connection timed out)
nfc-list: ERROR: Unable to open NFC device: acr122_usb:004:007
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR122U 00 00

有时这也会出现:

nfc-list uses libnfc 1.7.1
error   libnfc.driver.acr122_usb    Unable to set alternate setting on USB interface (Connection timed out)
nfc-list: ERROR: Unable to open NFC device: acr122_usb:004:007
error   libnfc.driver.acr122_pcsc   No ACR122 firmware received, Error: 80100016
nfc-list: ERROR: Unable to open NFC device: acr122_pcsc:ACS ACR122U 00 00

我从中读到的是:

  • libnfc 工作
  • 有一些驱动程序问题
  • 某些东西挡住了读者
  • 那东西是 pcscd (根据互联网)

我已经做了以下事情:

  • nfc pn533 pn533_usb文件中的黑名单/etc/modprobe.d/blacklist-libnfc.conf
  • 停止 pcscd 守护进程
  • 使用手动删除上述驱动程序sudo modprobe -r <driver>
  • 从这里安装设备驱动程序:https ://www.acs.com.hk/en/products/3/acr122u-usb-nfc-reader/
  • 重启我的笔记本电脑大约 100 次
  • 向 nfc 上帝祈祷

谁能帮助我和/或告诉我我做错了什么?先感谢您!

PS:我不知何故让它与 pcscd 一起工作,但因为我不知道如何让 mfoc 使用它(如果这甚至可能的话)它没有用。

4

1 回答 1

0

现在你可以从源版本 1.8.0 安装。这个版本解决了这个问题。

首先卸载libnfc-bin

下载1.8.0版本的源代码 这就是我所做的:

export CFLAGS="-Wall -g -O2 -Wextra -pipe -funsigned-char -fstrict-aliasing \
      -Wchar-subscripts -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wunused \
      -Wuninitialized -Wpointer-arith -Wredundant-decls -Winline -Wformat \
      -Wformat-security -Wswitch-enum -Winit-self -Wmissing-include-dirs \
      -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition \
      -Wbad-function-cast -Wnested-externs -Wmissing-declarations"

autoreconf -Wall -vis
./configure --prefix=/usr --sysconfdir=/etc
sudo make clean
sudo make
sudo make install

之后我尝试过nfc-list并且它有效

nfc-list uses libnfc 1.8.0
NFC device: ACS / ACR122U PICC Interface opened
于 2021-12-10T23:03:46.143 回答