3

I'm working on a raspberry pi project. I'm trying to install a driver package for ACR1251U-A1 NFC tag.

This package requires to install pcsc-lite package at first. But as I understand after a search on the internet, pcsc-lite 1.8.13 is not possible for raspbian OS.

But my supervisor persists that pcsc-lite 1.8.13 should be installed on raspberry pi to make nfc tag work.

Is it possible to install it on raspbian? If it is so, could you help me how to do that?

  • 1
    Hello and welcome! What do you mean by "is not possible for raspbian"? Is there no package provided or is it not possible to install/run it for whatever reason? If it is just no package, could it be installed from source? – Ghanima Apr 23 '15 at 21:08
  • Ghanima, when I try to install with the command apt-get install libpcsc1 1.8.13, the raspberry pi automatically installs me an earlier version 1.8.4-1+deb7u1. And the problem is, my supervisor persists that, the nfc reader doesn't work because this version is wrong version for nfc-reader and raspberry pi suitability. I'm stuck at this point. – yusuf Apr 23 '15 at 21:12
  • 1
    Could the correct version be installed from source? Or could apt-get not be forced to install a specific version only? (Sorry I am not into apt-get so I cannot tell.) – Ghanima Apr 23 '15 at 21:15
  • well, I have tried to download libpcsc1 1.8.13 from repository, but the problem is I couldn't install it. I think there is no specific installation in raspbian for libpcsc1 1.8.13. But I'm not sure. – yusuf Apr 23 '15 at 21:17
  • Assuming that you ran sudo apt-get update before installing, your only option may be to install from source. – Steve Robillard Apr 23 '15 at 21:50
6

I was able to install pcscd daemon and using pcsc-lite wrapper in NodeJS on Raspbian (Linux raspberrypi 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux) using Raspberry Pi B+ and Raspberry Pi 2.

Here an extract of the Requirements installation from the full guide of mine project on GitHub:

  1. Install PC/SC and libnfc (references: 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
    

    Additionaly, you may need to grant permissions to your user to drive the device. Under GNU/Linux systems, if you use udev, you could use the provided udev rules. e.g. under Debian: sudo cp /opt/libnfc-libnfc-1.7.1/contrib/udev/42-pn53x.rules /lib/udev/rules.d/

  2. Make sure the NFC reader is properly recognized:

    sudo nfc-list
    
    1. To fix: error while loading shared libraries: libnfc.so.4: cannot open shared object file: No such file or directory (reference)

      echo '/usr/local/lib' | sudo tee -a /etc/ld.so.conf.d/usr-local-lib.conf && sudo ldconfig
      
    2. If you have kernel version > 3.5, probably pcscd and also nfc-list will report this error: Unable to claim USB interface (Device or resource busy) 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

2

The nfc-tools.org website has good directions for how to install on ubuntu systems.

Here is how I did it on my Raspberry Pi 3 B running Raspbian 8.0 (jessie)

sudo apt-get install pcscd libusb-dev libpcsclite1 libpcsclite-dev dh-autoreconf libudev-dev libusb-0.1-4
sudo wget -O /lib/udev/rules.d/93-pn53x.rules https://raw.githubusercontent.com/nfc-tools/libnfc/master/contrib/udev/93-pn53x.rules

cd ~
git clone https://github.com/nfc-tools/libnfc.git
cd libnfc
git checkout libnfc-1.7.1
git clean -d -f -x
rm ../libnfc*.deb #may not exist
git remote|grep -q anonscm||git remote add anonscm git://anonscm.debian.org/collab-maint/libnfc.git
git fetch anonscm
git checkout remotes/anonscm/master debian
git reset
dpkg-buildpackage -uc -us -b
sudo dpkg -i ../libnfc*.deb

Next plug in NFC device, wait 30 seconds. May have to unplug then plug in again. Now you can run nfc-list to see if your device is detected.

If you are still running into problems stop the pcsc daemon (sudo service pcscd stop) then manually run sudo pcscd -f -d to monitor the output.

Note: You will have to restart pcscd and unplug and re-plug your device to use it over pcsc after running nfc-list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.