I try to use an ACR122 USB NFC-Reader on Mac OSX Mojave 10.14.6 with libnfc and I've got a "Unable to write to USB (Result too large)" error when I try to use the command 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
When I started troubleshooting I had an "Unable to Claim USB Interface" error, which other people had as well. So I tried the following things from this stackoverflow question and this github issue I found:
brew install libnfc
--> Got the "Unable to Claim..." error./usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist
-> Did not helpautoreconf -iv && ./configure --with-drivers=acr122_usb && make clean && make && make install
sudo launchctl remove com.apple.ifdreader
sudo launchctl stop com.apple.ifdreader
After troubleshooting now I'm stuck with the error and have no idea how to solve the problem. The readers light is not blinking red anymore, but from the error the device is clearly connected to the computer and available.
As a side node: I connect the reader over a USB Hub, since the reader has no USB C cable, but that shouldn't be a problem. Has anyone had the same problem or another approach I could try?
Your step 4, editing /usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist
worked for me and it is the only clean solution I could find.
Here a short description what you need to do:
/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist
The three lines in my case were the entry number 370:
Detailed step by step description:
<cmd>+<R>
on the keyboard while starting your Mac to enter recovery modecsrutil disable
open a Terminal window and execute the following commands:
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
reboot your Mac normally
nfc-scan-device
<cmd>+<R>
on the keyboard and then start your Mac to enter recovery modecsrutil enable
@anderssonjohan was giving the correct answer in his post, but the plist file he posted was inconsistent because he only removed one line instead of three.