Controls my Intertechno outlets on Raspberry Pi / Node.js.
Shameless frankenteinized fork of https://github.com/n8henrie/node-rcswitch-gpiomem.
- Like the c++ version of rcswitch, WiringPi must be installed in order to compile.
- To work without root by way of
/dev/gpiomem
part to work, it should be run on Raspbian Jessie with wiringPi >= 2.29 - Both the data and the power Pins of the 315/433Mhz emitter must be connected
to the RPi. Note the number of the
WiringPi dataBCM Pin. (see http://wiringpi.com/pins/) - Currently doesn't compile with Node.js version 10 and above.
var sender = require('node-intertechno-sender'); // May throw an error if /dev/gpiomem is not accessible
sender.enableTransmit(18); // Use **BCM** pin 18
sender.setRepeatTransmit(5); // Set number of repeat transmissions
// Turn the first switch off. Switches 0..5 are supported.
sender.setState(0, false)
Enable transmission on BCM pin
. On Jessie should "just work". NB: if you to not want to use /dev/gpiomem
, you'll need to first export the pin with the wiringPi gpio
utility to avoid needing root.`
pin
- (Number) data Pin to use following the WiringPi schema
Return true if pin
is an integer, false otherwise.
Disable transmission (set the pin to -1 which disable any following function call).
Return true.
codeWord
- (String) codeword. Can use this to send the binary RF code, see: http://n8henrie.com/2015/12/rf_pi
Return true.