[英]Force PC/SC driver on ACR122U NFC reader
I have trouble with using my ACR122U RFID card reader form ACS. 我在使用ACS的ACR122U RFID读卡器时遇到了麻烦。 I need to connect it to my Mac using the PC/SC driver. 我需要使用PC / SC驱动程序将它连接到我的Mac。 I installed the driver from the ACS website and confirmed that it's running. 我从ACS网站安装了驱动程序并确认它正在运行。
However, whenever I test using the nfc-list
command, I get the following error: 但是,每当我使用nfc-list
命令进行测试时,都会收到以下错误:
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
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? 据我所知,谷歌搜索的是Mac接管USB以防止PC / SC使用该设备,但我如何强制计算机使用PC / SC驱动程序而不是默认的Apple USB?
PS: I have installed libusb
PS:我已经安装了libusb
You seem to be mixing two different options for connecting the ACR122U to libnfc: 您似乎混合了两个不同的选项,用于将ACR122U连接到libnfc:
You can either use the direct USB driver for the ACR122U, libnfc.driver.acr122_usb
(which is what you are currently using). 您可以使用ACR122U的直接USB驱动程序libnfc.driver.acr122_usb
(这是您当前使用的)。 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). 在这种情况下,您需要确保PC / SC守护程序不会接管读取器的控制权(因为一次只有一个实例可以访问读取器的USB接口)。
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
. 或者,您可以通过编辑/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist
来阻止PC / SC守护程序控制该特定读取器。 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>
You will need to search for entries containing the values 0x2200, 0x90CC, and 0x2214. 您将需要搜索包含值0x2200,0x90CC和0x2214的条目。 Remove those lines, but remember the relative line number (ie the offset in the <array>
). 删除这些行,但记住相对行号(即<array>
的偏移量)。 Then, also remove the corresponding lines under 然后,还删除下面的相应行
<key>ifdVendorID</key>
They should all contain the value 0x072F and thus have the form 它们都应包含值0x072F,因此具有该形式
<string>0x072F</string>
Moreover, you also need to remove the corresponding lines under 而且,你还需要删除相应的行
<key>ifdFriendlyName</key>
All of them will probably start with <string>ACS
. 所有这些都可能以<string>ACS
开头。
Alternatively, you could use the PC/SC based libnfc driver for the ACR122U ( libnfc.driver.acr122_pcsc
). 或者,您可以将基于PC / SC的libnfc驱动程序用于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. 该驱动程序使用系统PC / SC守护程序访问阅读器,而不是直接控制USB接口。 For this option to work, you need to configure lib-nfc to use the PC/SC driver instead of the direct USB driver. 要使此选项起作用,您需要将lib-nfc配置为使用PC / SC驱动程序而不是直接USB驱动程序。 When you compile libnfc yourself, you could do this by explicitly activating only the PC/SC based driver: 自己编译libnfc时,可以通过显式激活基于PC / SC的驱动程序来完成此操作:
./configure --with-drivers=acr122_pcsc make
However, note that this driver has been depreciated and libnfc authors strongly discourage its use. 但请注意,此驱动程序已被折旧,libnfc作者强烈反对使用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.