rpi-433-tristate
Simple NodeJS module receive decimal codes and send tristate signals through 433Mhz device on RaspberryPI 2
Disclaimer
It's a fork from eroak but my PR got no attention. So i made my own package.
Dependencies
Building WiringPi
pi@raspberrypi ~ $ git clone git://git.drogon.net/wiringPi...pi@raspberrypi ~ $ cd wiringPi/wiringPipi@raspberrypi ~/wiringPi/wiringPi $ sudo su...root@raspberrypi:/home/pi/wiringPi/wiringPi# ./build
Installation
npm install rpi-433-tristate
Usage
Firstly, make sure you are running your application as root or with sudo, else the Raspberry Pi will not let you output/input to the GPIO and you'll get an error.
sudo node myscript.js
Please note that there are different and confusing ways to reference a channel. This module supports wPi schema. Once wiringPi is installed, in your CLI you can run gpio readall
and check the wPi column or consult https://projects.drogon.net/raspberry-pi/wiringpi/pins/
gpio readall
Example
var rpi433 = rfSniffer = rpi433; rfEmitter = rpi433; rfEmitterTri = rpi433// Receive (data is like {code: xxx, pulseLength: xxx})rfSniffer; // SendrfEmitter; // Send TriState signalrfEmitterTri; /* Or : rfEmitter.sendCode(code);rfEmitter.sendCode(code, { //You can overwrite defaults options previously set (only for this sent) pin: 2, pulseLength: 350});rfEmitter.sendCode(code, callback);rfEmitter.sendCode(code, { pin: 2, pulseLength: 350}, callback);*/ //rpi-433 uses the kriskowal's implementation of Promises so,//if you prefer Promises, you can also use this syntax :rfEmitter ;