Giter VIP home page Giter VIP logo

rfid-chafon's Introduction

#RFID-Chafon

I recently bought a usb rfid reader. The "driver" and the "app" were propietaries solutions for windows xp and not usable by mac or linux. So I decided to reverse engineer the protocol and implement this small node js lib.

Installation

$ npm install debug

Usage

Example readtag.js:

var RFID = require('./index');

let rfid = new RFID('/dev/tty.usbserial');

rfid.open()
	.then(() => {
		return rfid.read().then(result => {
			console.log(result);
			rfid.close();
		});
	}).catch(e => {
		console.error(e);
		rfid.close();
	});

Example writetag.js:

var RFID = require('./index');

let rfid = new RFID('/dev/tty.usbserial');

rfid.open()
	.then(() => {
		return rfid.write().then(result => {
			console.log(result);
			rfid.close();
		});
	}).catch(e => {
		console.error(e);
		rfid.close();
	});

rfid-chafon's People

Stargazers

Henry Coarite avatar Caique de Camargo avatar Giuseppe Rodriguez avatar a avatar Aaron Oxenrider avatar V3 avatar Rian avatar Alberto avatar Rafael Neri avatar black23 avatar Patrick Weingärtner avatar Justin McCormick avatar

Watchers

V3 avatar ulfalfa avatar

rfid-chafon's Issues

Error

When running the code sample I get an error:
TypeError: RFID is not a constructor
It occurs at the second line in my code which is the sample code is thus:

var RFID = require('@ulfalfa/rfid-chafon');
 
let rfid = new RFID('/dev/ttyUSB0');
 
rfid.open()
    .then(() => {
        return rfid.read().then(result => {
            console.log(result);
            rfid.close();
        });
    }).catch(e => {
        console.error(e);
        rfid.close();
    });```

Card on/off information

Hi !
This is a great looking library.
I was wondering if you had implemented a card on/off functionnality.

When using PC/SC reader like ARC122U we easily get access to the on/off feature.

I guess we could poll and open close the device, but it looks kind of dumb.

Thanks,

G

CRC algorithm

I am able to connect to the rfid device ( chafon CF-RU5306 ), I can also send CMDS successfully which already pre-written in demo code ( Nodejs ) , but the issue I am having now is generating the CRC based on Buffer data. Would it be possible to share the also that you worked with please. Here the manual example which I could not replicate in javascript after many tries.
unsigned char CheckSum(unsigned char *uBuff, unsigned short iBuffLen)
{
unsigned char uSum=0;
unsigned short i = 0;
for(i=0;i< iBuffLen;i++)
{
uSum = uSum + uBuff[i];
}
uSum = (~uSum) + 1;
return uSum;
}
Manual reference https://drive.google.com/drive/folders/1GOMv5qGVvhCxKYK_7vSQAX9fz6ssXskk

rfid compatible device

Please can you tell us which device is compatible ?
We would like to rfid reader to read until 5 meters Frequency:865-868Mhz,902-928MHz.
Maybe all of them are compatible? the Portable UHF RFID Bluetooth Reader
Model:CF-H301 for exemple

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.