Git Product home page Git Product logo

wiegand-node's Introduction

Wiegand 26 and Wiegand 34 module for Node.js and using on Raspberry Pi

The Wiegand interface is a de facto standard commonly used to connect a card reader or keypad to an electronic entry system. Wiegand interface has the ability to transmit signal over long distance with a simple 3 wires connection. This module uses interrupt pins from Raspberry Pi to read the pulses from Wiegand interface and return the code and type of the Wiegand.

Installation

npm install wiegand-node

Example


"use strict";

const Wiegand = require('wiegand-node');

var pinD0 = 4,  //DATA0 of Wiegand connects to RPi GPIO04 (Pin 7)
    pinD1 = 17; //DATA1 of Wiegand connects to RPi GPIO17 (Pin 11)

const w = new Wiegand({ d0: pinD0, d1: pinD1 });
w.begin();
w.on('reader', (idDec, idRFID, idHex) => {
  console.log(idDec); // RAW data
  
  console.log(idRFID); // EM format
  
  console.log(idHex); // Mifare format

});

Settings


const w = new Wiegand(
    { 
        d0: int, // the number of your GPIO PIN. This means eg. "4" for "GPIO04", not 7 from "Pin 7" | default 4
        d1: int  // the number of your GPIO PIN. This means eg. "17" for "GPIO17", not 11 from "Pin 11" | default 11
        debug: bool // enable debug console output | default false 
    }
);

Available Watchers


w.on('reader', (idDec, idRFID, idHex) => {
    // stuff
});
w.on('reader_failed_parity', (data) => {
    // stuff
});

Contributors

Reals
Elompenta

wiegand-node's People

Contributors

reals79 avatar elompenta avatar agent123983 avatar simontaga avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.