无法声明USB接口(设备或资源繁忙)

时间:2015-06-30 06:56:45

标签: ubuntu usb nfc smartcard-reader acr122

我想在Ubuntu 14中使用我的ACR122U非接触式智能卡读卡器。所以我安装了我需要的包和驱动程序。

最后,当我想使用阅读器时,我收到以下错误:

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$ 

我的读者似乎正在使用内核工具。我搜索了很多。有很多人已经有同样的问题,但我找不到他们的答案。

有人知道如何解决这个问题吗? (例如,通过回收设备)

4 个答案:

答案 0 :(得分:7)

如果你有内核版本> 3.5,nfs-listpcscd会因pn533驱动程序的自动加载而报告此错误。

要阅读pcscd dameon输出,您可以使用以下代码运行它:pcscd -f -d

  1. 检查安装了哪个内核版本:uname -a
  2. 黑名单pn533nfc驱动程序(参考:Arch Linux wiki Touchatag RFID Readernfc-tools forum):

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

    添加以下行:

    blacklist pn533
    blacklist nfc
    
  3. 禁用内核模块:

    $ modprobe -r pn533 nfc
    
  4. 重新启动pcscd守护程序:sudo service pcscd restart

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

答案 1 :(得分:2)

快速而肮脏的解决方案:

#include <stdio.h>

main()
{
    long s = 0, t = 0, n = 0;
    int c;
    while ((c = getchar()) != EOF)
        if (c == ' ')
            ++s;
        else if (c == '\t')
            ++t;
        else if (c == '\n')
            ++n;
    printf("spaces: %d tabulations: %d newlines: %d", s, t, n);
}

答案 2 :(得分:1)

import fixedint

def munge(val):
    x = val * 32
    x += 0x7fffffff
    return x

print(munge(fixedint.Int32(3)))
# prints -2147483553

为我工作。

sudo modprobe -r pn533_usb

sudo modprobe -r pn533

答案 3 :(得分:0)

在较新的 ubuntu(>1804) 上,还需要黑名单 pn533_usb

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