在ACR122U NFC读取器上强制使用PC/SC驱动程序 [英] Force PC/SC driver on ACR122U NFC reader
问题描述
我无法使用ACS的ACR122U RFID读卡器.我需要使用PC/SC驱动程序将其连接到Mac.我从ACS网站安装了驱动程序,并确认它正在运行.
I have trouble with using my ACR122U RFID card reader form ACS. I need to connect it to my Mac using the PC/SC driver. I installed the driver from the ACS website and confirmed that it's running.
但是,每当我使用nfc-list
命令进行测试时,都会出现以下错误:
However, whenever I test using the nfc-list
command, I get the following error:
nfc-list uses libnfc libnfc-1.7.1-189-g2869ae2
error libnfc.driver.acr122_usb Unable to claim USB interface (Permission denied)
nfc-list: ERROR: Unable to open NFC device: acr122_usb:020:002
从谷歌浏览器了解到,是Mac接管了USB,阻止了PC/SC使用该设备,但是如何强制计算机使用PC/SC驱动程序而不是默认的Apple USB?
As far as I've understood from googling is that it is the Mac taking over the USB that prevents PC/SC using the device, but how can I force the computer to use the PC/SC driver instead of the default Apple USB?
PS:我已经安装了libusb
PS: I have installed libusb
推荐答案
您似乎在混合使用两种不同的方法将ACR122U连接到libnfc:
You seem to be mixing two different options for connecting the ACR122U to libnfc:
-
您可以使用ACR122U的直接USB驱动程序
libnfc.driver.acr122_usb
(这是您当前正在使用的).在这种情况下,您需要确保PC/SC守护程序不会接管读取器的控制(因为一次只能有一个实例可以访问读取器的USB接口).
You can either use the direct USB driver for the ACR122U,
libnfc.driver.acr122_usb
(which is what you are currently using). In this case, you need to make sure that the PC/SC daemon does not take over control of the reader (since only one instance can access the USB interface of the reader at a time).
- The quick-and-dirty fix is to disable the PC/SC daemon that takes control over the ACR122U. Though this is not straight forward on Mac OS X, a detailed explanation can be found in Ludovic's blog.
Alternatively, you could prevent the PC/SC daemon from taking control over that specific reader by editing
/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist
. You would need search for the entry
<key>ifdProductID</key>
在此条目下,有一系列形式为
Below this entry, there is an array of entries of the form
<string>0xXXXX</string>
您将需要搜索包含值0x2200、0x90CC和0x2214的条目.删除这些行,但要记住相对的行号(即<array>
中的偏移量).然后,还要删除
You will need to search for entries containing the values 0x2200, 0x90CC, and 0x2214. Remove those lines, but remember the relative line number (i.e. the offset in the <array>
). Then, also remove the corresponding lines under
<key>ifdVendorID</key>
它们都应包含值0x072F,并因此具有格式
They should all contain the value 0x072F and thus have the form
<string>0x072F</string>
此外,您还需要删除下面的相应行
Moreover, you also need to remove the corresponding lines under
<key>ifdFriendlyName</key>
所有这些都可能以<string>ACS
开头.
All of them will probably start with <string>ACS
.
或者,您可以对ACR122U(libnfc.driver.acr122_pcsc
)使用基于PC/SC的libnfc驱动程序.该驱动程序使用系统PC/SC守护程序访问读取器,而不是直接控制USB接口.为了使此选项起作用,您需要将lib-nfc配置为使用PC/SC驱动程序而不是直接USB驱动程序.自己编译libnfc时,可以通过显式激活仅基于PC/SC的驱动程序来实现:
Alternatively, you could use the PC/SC based libnfc driver for the ACR122U (libnfc.driver.acr122_pcsc
). This driver uses the system PC/SC daemon to access the reader instead of taking control over the USB interface directly. For this option to work, you need to configure lib-nfc to use the PC/SC driver instead of the direct USB driver. When you compile libnfc yourself, you could do this by explicitly activating only the PC/SC based driver:
./configure --with-drivers=acr122_pcsc
make
但是,请注意,该驱动程序已过时,libnfc作者强烈反对使用该驱动程序.
However, note that this driver has been depreciated and libnfc authors strongly discourage its use.
这篇关于在ACR122U NFC读取器上强制使用PC/SC驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!