works with the ACR122 nfc reader, possibly with others, using node-nfc lib: https://github.com/camme/node-nfc
outputs a json message in stdout:
node index.js
output:
{"type":"detect","uid":"47-22-91-00"}
{"type":"remove","uid":"47-22-91-00"}
also, you could pipe these events into mclient:
node index.js | mclient -n blib -t rfid -i json
Combining the ACR122 with a Raspberry pi seems like a nice idea. It results in a compact setup that only needs a bit of power if you equip the raspberry pi with a wireless dongle.
The idea is as follows:
- make ACR122 work on RPi
- make the RPi discoverable over the network (using avahi)
- add mhub as a message server
- add a simple server to display a setttings / howto page
- allow configurable post hooks
- wrap the whole in a nice box
The execution is a bit more elaborate:
- setup the pi with a basic image
- boot, enable ssh
- change password
- make pi boot to console
sudo raspi-config- in boot options, choose console
- make pi discoverable [1]
sudo apt-get updatesudo nano /etc/dhcp/dhclient.confsend host-name "nfc-pi";don't forget the semicolon at the endsudo apt-get install sambasudo apt-get install winbindsudo nano /etc/samba/foreversmb.confworkgroup = WORKGROUPthis should be the windows network groupsudo nano /etc/nsswitch.confhosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 winssudo reboot! this does not work yet, not quite sure what's going on
- install git
- install nodejs
- install libnfc
- install the nfcReader package
git clone https://github.com/rikkertkoppes/nfcReader.gitcd nfcReadernpm install
- plug in the ACR122 and testrun (as root to be able to claim the USB interface)
sudo node index.js- this should react to nfc / rfid tags
- install mhub:
sudo npm install -g mub
- install forever
sudo npm install -g foreversudo npm install -g forever-service
- provision mserver as a service (to autostart it on boot and restart if it crashes)
sudo forever-service install mserver -s /usr/local/bin/mserversudo update-rc.d mserver defaultssudo service mserver start! this does not work yet, dunno what's going on
[1] More info: