Skip to content

PC/SC lite HTTP wrapper for reading from a remote card reader (RFID & NFC).

License

Notifications You must be signed in to change notification settings

magic890/rfid-reader-http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rfid-reader-http

PC/SC lite HTTP wrapper for reading from a card reader (RFID & NFC).

Tested card reader

  • ACS ACR122 (ACR122U-A9)

Prerequisites

For running the installation step, due to its dependency from node-pcsclite, this project requires node-gyp, so please read carefully and satisfy their installation requirements, otherwise it may fails compiling the node module.

You may have to install the proper driver for your card reader.

Requirements installation

Mac OS X

  1. Download the ACS ACR122U Drivers for Mac OS X 10.x via the download page or via direct link for PC/SC Driver Installer 1.1.0 (Mac 10.5, Mac 10.6, Mac 10.7, Mac 10.8, Mac 10.9, Mac 10.10) (2014-09-17 306KB). You have to install it even if the installer is not properly signed.

    It will install the useful driver in: /usr/libexec/SmartCardServices/drivers/ifd-acsccid.bundle

Raspberry Pi (ARM) (Debian)

NOTE: At this time, Raspberry Pi 1 models have issue running NodeJS, due to wrong architecture identification (ARMv7 instead of ARMv6). This guide works properly on Raspberry Pi 2 (refence 1 2).

  1. Install the latest version of NodeJS and npm, as stated in the official guide:

     curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -
     sudo apt-get install --yes nodejs
    
  2. 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/

  3. 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

Install

  1. git clone https://github.com/goodotcom/rfid-reader-http.git
  2. cd rfid-reader-http
  3. npm install

Usage

  • Run as process: node index.js
  • Run in background (detached output): nohup node index.js &

About

PC/SC lite HTTP wrapper for reading from a remote card reader (RFID & NFC).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published