rc522-i2c

0.1.3 • Public • Published

RFID RC522 on Raspberry PI with NodeJS (I2C version)

node.js module to access a rfid reader with rc522 chipset which is connected a raspberry pi

Fork of

https://github.com/ocsacesar/rc522 modified for accessing i2c version such as RC522 I2C V1.1 and reworked to async addon based on https://github.com/paulhauner/example-async-node-addon

Update: you can now configure which pin is connected to RST Pin and which i2c address is used.

Purpose

This node module is to access RFID reader with a rc522 chipset (e.g. link to ebay) via GPIO interface of the raspberry pi.

Functionality

The module is currently only able to read the serial number of the tag which is hold onto the reader.

Example

var rc522i2c = require("rc522-i2c");

console.log('Ready!!!');
// pin RPI_V2_GPIO_P1_37 see bcm2835.h, i2c-address,callback 
rc522i2c.getSerial(26,0x28,function(rfidSerialNumber){
    console.log(rfidSerialNumber);
});

Save and run: (Is necessary "sudo")

sudo node rfid.js

NOTE: Running as root NOTE: if you use multipe i2c devices, make sure that the bus is free. I had issues with an RTC so i have to disbable the overlay in /boot/config.txt.

Dependents (0)

Package Sidebar

Install

npm i rc522-i2c

Weekly Downloads

0

Version

0.1.3

License

none

Last publish

Collaborators

  • epike