Unable to claim USB interface (Device or resource busy)
Asked Answered
P

4

17

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)

Pyrazole answered 30/6, 2015 at 6:56 Comment(2)
If there is a PC/SC daemon running on your system, it will access the reader. So you might want to try to stop that daemon process.Padraic
Hi Hamid, if my answer below was correct, please mark it as accepted.Concubinage
L
11
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  
Lesley answered 4/11, 2018 at 0:1 Comment(1)
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)Elianore
C
10

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.

Concubinage answered 18/11, 2015 at 21:10 Comment(1)
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. medium.com/@andv/…Precognition
A
5

A quick-and-dirty solution:

sudo rmmod pn533 ## unload the driver right now
sudo nfc-list ## now it works...
Armament answered 30/1, 2018 at 19:21 Comment(0)
L
1

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

$ cat /etc/modprobe.d/blacklist-libnfc.conf
blacklist nfc
blacklist pn533
blacklist pn533_usb
Laughable answered 10/3, 2021 at 5:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.