我正在做一个树莓派项目。我正在尝试为 ACR1251U-A1 NFC 标签安装驱动程序包。
这个包首先需要安装 pcsc-lite 包。但据我在互联网上搜索后了解,pcsc-lite 1.8.13 不适用于 Raspbian OS。
我的主管坚持认为应该在 Raspberry Pi 上安装 pcsc-lite 1.8.13 以使 NFC 标签工作。
是否可以在 Raspbian 上安装它?如果是这样,你能帮我怎么做吗?
我能够使用 Raspberry Pi B+ 和 Raspberry Pi 2在 Raspbian ( ) 上的 NodeJS 中安装pcscd
守护进程和使用pcsc-lite
包装器。Linux raspberrypi 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux
这里是来自GitHub 上我的项目完整指南的要求安装摘录:
安装 PC/SC 和 libnfc (参考: nfc-tools , libnfc ):
sudo apt-get install pcscd libusb-dev libpcsclite1 libpcsclite-dev dh-autoreconf cd /opt/ sudo wget https://github.com/nfc-tools/libnfc/archive/libnfc-1.7.1.zip sudo unzip libnfc-1.7.1.zip cd libnfc-libnfc-1.7.1/ sudo autoreconf -vis sudo ./configure --with-drivers=all sudo make sudo make install
此外,您可能需要授予用户驱动设备的权限。在 GNU/Linux 系统下,如果你使用
udev
,你可以使用提供的udev
规则。例如在 Debian 下:sudo cp /opt/libnfc-libnfc-1.7.1/contrib/udev/42-pn53x.rules /lib/udev/rules.d/
确保正确识别 NFC 读取器:
sudo nfc-list
修复
error while loading shared libraries: libnfc.so.4: cannot open shared object file: No such file or directory
:(参考)echo '/usr/local/lib' | sudo tee -a /etc/ld.so.conf.d/usr-local-lib.conf && sudo ldconfig
如果您的内核版本> 3.5,则可能
pcscd
并且nfc-list
也会报告此错误:Unable to claim USB interface (Device or resource busy)
由于pn533
驱动程序的自动加载。要读取
pcscd
dameon 输出,您可以使用以下命令运行它:pcscd -f -d
- 检查安装了哪个内核版本:
uname -a
黑名单
pn533
和nfc
驱动程序(参考:Arch Linux wiki Touchatag RFID Reader,nfc-tools forum):sudo nano /etc/modprobe.d/blacklist-libnfc.conf
添加以下行:
黑名单 pn533 黑名单 nfc
禁用内核模块:
modprobe -r pn533 nfc
重启
pcscd
守护进程:sudo service pcscd restart