node-intertechno-sender

Rootless control of my Intertechno switches. Fork of https://github.com/n8henrie/node-rcswitch-gpiomem.


Keywords
rpi, raspberrypi, rcswitch, 433, rf, wireless, intertechno
License
GPL-2.0
Install
npm install node-intertechno-sender@0.0.4

Documentation

node-intertechno-sender

Controls my Intertechno outlets on Raspberry Pi / Node.js.

Shameless frankenteinized fork of https://github.com/n8henrie/node-rcswitch-gpiomem.

Requirements

  • 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 data BCM Pin. (see http://wiringpi.com/pins/)
  • Currently doesn't compile with Node.js version 10 and above.

Usage

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)

API

Configuration

rcswitch.enableTransmit(int pin)

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.`

Return true if pin is an integer, false otherwise.

rcswitch.disableTransmit()

Disable transmission (set the pin to -1 which disable any following function call).

Return true.

rcswitch.send(char* codeWord)

Return true.