Me7*_*e0r 1 nfc lib-nfc acr122
我尝试在 Mac OSX Mojave 10.14.6 上使用带有 libnfc 的 ACR122 USB NFC 读卡器,当我尝试使用以下命令时,出现“无法写入 USB(结果太大)”错误LIBNFC_LOG_LEVEL=3 nfc-list:
info libnfc.config Unable to open file: /usr/local/etc/nfc/libnfc.conf
debug libnfc.config key: [device.allow_autoscan], value: [false]
info libnfc.config Unknown key in config line: device.allow_autoscan = false
debug libnfc.config key: [device.allow_intrusive_scan], value: [false]
info libnfc.config Unknown key in config line: device.allow_intrusive_scan = false
debug libnfc.config key: [device.log_level], value: [3]
info libnfc.config Unknown key in config line: device.log_level = 3
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 0 device(s) defined by user
nfc-list uses libnfc 1.7.1
debug libnfc.driver.acr122_usb device found: Bus 020 Device 020 Name ACS ACR122
debug libnfc.general 1 device(s) found using acr122_usb driver
debug libnfc.driver.acr122_usb 3 element(s) have been decoded from "acr122_usb:020:020"
debug libnfc.driver.acr122_usb TX: 62 00 00 00 00 00 00 01 00 00
error libnfc.driver.acr122_usb Unable to write to USB (Result too large)
debug libnfc.general Unable to open "acr122_usb:020:020".
nfc-list: ERROR: Unable to open NFC device: acr122_usb:020:020
Run Code Online (Sandbox Code Playgroud)
当我开始排除故障时,我遇到了“无法声明 USB 接口”错误,其他人也遇到过这种情况。所以我从这个stackoverflow 问题和我发现的这个github 问题中尝试了以下操作:
brew install libnfc--> 出现“无法声明...”错误。/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist-> 没有帮助autoreconf -iv && ./configure --with-drivers=acr122_usb && make clean && make && make installsudo launchctl remove com.apple.ifdreadersudo launchctl stop com.apple.ifdreader现在排除故障后,我陷入了错误,不知道如何解决问题。读卡器指示灯不再呈红色闪烁,但从错误中可以看出,设备已明显连接到计算机并且可用。
作为侧面节点:我通过 USB 集线器连接读卡器,因为读卡器没有 USB C 电缆,但这应该不是问题。有没有人遇到同样的问题或我可以尝试其他方法?
你的第 4 步,编辑/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist对我有用,这是我能找到的唯一干净的解决方案。
这里是您需要做什么的简短描述:
/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist我的例子中的三行是条目号 370:
详细的分步说明:
<cmd>+<R>按住键盘上的按键以进入恢复模式csrutil disable打开终端窗口并执行以下命令:
sudo -i
cd /usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents
cp Info.plist Info.plist.orig
patch -l -p0 <<EOF
--- Info.plist.orig 2019-12-07 20:26:36.000000000 +0100
+++ Info.plist 2019-12-07 20:26:40.000000000 +0100
@@ -471,7 +471,6 @@
<string>0x1050</string>
<string>0x1050</string>
<string>0x1050</string>
- <string>0x072F</string>
<string>0x09C3</string>
<string>0x03EB</string>
<string>0x0A5C</string>
@@ -864,7 +863,6 @@
<string>0x0405</string>
<string>0x0406</string>
<string>0x0407</string>
- <string>0x2200</string>
<string>0x0008</string>
<string>0x6016</string>
<string>0x5800</string>
@@ -1257,7 +1255,6 @@
<string>Yubico Yubikey 4 OTP+CCID</string>
<string>Yubico Yubikey 4 U2F+CCID</string>
<string>Yubico Yubikey 4 OTP+U2F+CCID</string>
- <string>ACS ACR122U PICC Interface</string>
<string>ActivCard ActivCard USB Reader V2</string>
<string>ATMEL VaultIC460</string>
<string>Broadcom Corp 5880</string>
EOF
Run Code Online (Sandbox Code Playgroud)正常重启你的Mac
nfc-scan-device<cmd>+<R>键盘上的按键,然后启动 Mac 进入恢复模式csrutil enable@anderssonjohan在他的帖子中给出了正确的答案,但他发布的 plist 文件不一致,因为他只删除了一行而不是三行。