Affichage des articles du décembre, 2015

RFID RC522 on Raspberry PI with NodeJS

It's kind of hard to succeed in this. Most of tutorials are uncomplete. Here is my compilation.

Everything is done on the PI

0) Install node
sudo dpkg -i node_latest_armhf.deb

1) Update your PI: 
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo rpi-update
sudo apt-get clean

2) Configure the SPI group:
sudo groupadd -f --system spi
sudo adduser pi spi # assuming the pi account is the one that will access SPI
sudo nano /etc/udev/rules.d/90-spi.rules

Then add this to the file :
SUBSYSTEM=="spidev", GROUP="spi"

3) Configure the PI:
sudo apt-get install build-essential
sudo npm install -g node-gyp
sudo raspi-config
  under Advanced Options - enable Device Tree
  under Advanced Options - disable SPI
sudo reboot

4) Compile the spi_bcm2835 driver:
tar -zxf bcm2835-1.46.tar.gz
cd bcm2835-1.46
sudo make check
sudo make install
sudo modpro…