Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to claim USB interface (Device or resource busy)

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)

like image 480
hamid s Avatar asked Jun 30 '15 06:06

hamid s


3 Answers

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.

like image 186
Matteo Guarnerio Avatar answered Nov 08 '22 21:11

Matteo Guarnerio


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  
like image 8
Stéphane PRAULT Avatar answered Nov 08 '22 22:11

Stéphane PRAULT


A quick-and-dirty solution:

sudo rmmod pn533 ## unload the driver right now
sudo nfc-list ## now it works...
like image 3
Brent Bradburn Avatar answered Nov 08 '22 21:11

Brent Bradburn