Skip to content

Control my Intertechno switches on Raspberry Pi using Node.js

License

Notifications You must be signed in to change notification settings

raimohanska/node-intertechno-sender

 
 

Repository files navigation

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.

About

Control my Intertechno switches on Raspberry Pi using Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 84.1%
  • JavaScript 13.3%
  • Python 2.6%