15

I want to use my ACR122U contact-less smart card reader in Ubuntu 14 smarty. So I installed my required packages and drivers.

Finally when I want to use the reader I receive the following error:

rc@rc-System-Product-Name:~/Desktop/itsme$ sudo nfc-list
[sudo] password for rc: 
nfc-list uses libnfc 1.7.0
error   libnfc.driver.acr122_usb    Unable to claim USB interface (Device or resource busy)
nfc-list: ERROR: Unable to open NFC device: acr122_usb:001:020
rc@rc-System-Product-Name:~/Desktop/itsme$ 
rc@rc-System-Product-Name:~/Desktop/itsme$ sudo mfoc -O output.txt
error   libnfc.driver.acr122_usb    Unable to claim USB interface (Device or resource busy)
No NFC device found.
rc@rc-System-Product-Name:~/Desktop/itsme$ 

It seems that my reader is in use with a kernel tool. I searched a lot. there are a lot of people that had the same issue already, but I couldn't find my answer among them.

Does anybody has any idea how I can resolve this problem? (By reclaiming the device, for example)

hamid s
  • 171
  • 1
  • 3
  • 5

4 Answers4

9

If you have kernel version > 3.5, nfs-list and pcscd will report this error due to the automatic load of pn533 driver.

To read the pcscd dameon output you can run it using: pcscd -f -d

  1. Check which kernel version is installed: uname -a
  2. Blacklist pn533 and nfc drivers (references: Arch Linux wiki Touchatag RFID Reader, nfc-tools forum):

    $ sudo nano /etc/modprobe.d/blacklist-libnfc.conf
    

    Add the following lines:

    blacklist pn533
    blacklist nfc
    
  3. Disable kernel modules:

    $ modprobe -r pn533 nfc
    
  4. Restart the pcscd daemon: sudo service pcscd restart

Here you can fine a small program to test your ACR122U reader and a more detailed guide.

Matteo Guarnerio
  • 720
  • 2
  • 9
  • 26
  • 2
    As mentioned here in the following article, you may need to also disable pn533_usb. Also, you can use modprobe -rf to force unloading. Be aware of the order, though. It will still fail if you try to unload a module with dependencies first. https://medium.com/@andv/how-to-fix-acr122s-and-libnfcs-unable-to-claim-usb-interface-on-kali-linux-932a34bb8e32 – vctls Mar 30 '19 at 19:50
9
sudo modprobe -r pn533_usb

sudo modprobe -r pn533

Works for me.

--------@--------:~$ sudo nfc-list
nfc-list uses libnfc 1.7.1
NFC device: ACS / ACR122U PICC Interface opened
1 ISO14443A passive target(s) found:
ISO/IEC 14443A (106 kbps) target:
ATQA (SENS_RES): 00  04  
UID (NFCID1): ab  c9  67  00  
SAK (SEL_RES): 08  
Daniel Gray
  • 1,697
  • 1
  • 21
  • 41
  • Worked on `Linux kali 5.5.0-kali2-amd64 #1 SMP Debian 5.5.17-1kali1 (2020-04-21) x86_64 GNU/Linux` ! (latest live at the time of comment) – Samuel Prevost May 21 '20 at 14:26
4

A quick-and-dirty solution:

sudo rmmod pn533 ## unload the driver right now
sudo nfc-list ## now it works...
Brent Bradburn
  • 51,587
  • 17
  • 154
  • 173
0

On newer ubuntu(>1804), blacklist pn533_usb is also needed

$ cat /etc/modprobe.d/blacklist-libnfc.conf
blacklist nfc
blacklist pn533
blacklist pn533_usb