0.0.4 • Published 7 years ago

node-intertechno-sender v0.0.4

Weekly downloads
9
License
GPL-2.0
Repository
github
Last release
7 years ago

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/)

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.