This package has been deprecated

Author message:

This package has been deprecated, please use `kaku-rpi` instead.

kaku-old

1.0.0 • Public • Published

kaku-old

Node.js driver for Raspberry Pi to control old-style KlikAanKlikUit (KaKu) devices using a 433Mhz transmitter.

The required hardware setup for this module is documented here (we're only using the transmitter module). It consists of a simple, cheap 433Mhz transmitter (like this one) hooked up to the RaspPi's GPIO pins.

Attribution

The core of the code is based on original work from Randy Simons.

Installation

First, make sure that you have a compiler and toolchain installed on your RaspPi.

Then, install the module:

$ npm i kaku-old

This will install the module, and its requirement (rpio). On limited hardware (like a Model A), installation may take a few minutes.

Usage

const kaku = require('kaku-old')(PIN, [PERIODUSEC, REPEATS]);

// Switch a device on or off:
kaku.switch(ADDRESS, DEVICE, STATE)

// Shortcuts:
kaku.on(ADDRESS, DEVICE)
kaku.off(ADDRESS, DEVICE)

Arguments:

  • PIN: the GPIO pin that the transmitter is hooked up to. This is the physical pin number, not the GPIO (mapped) number. Referring to the hardware page linked to above, it's using pin 11 (which is BCM GPIO pin number 17, but again, we're using the physical pin number, so 11).
  • PERIODUSEC: number of microseconds to sleep between high/low transitions. This should be 375 (which is also the default).
  • REPEATS: number of times to repeat commands. This should be 8 (= the default).
  • ADDRESS/DEVICE: KaKu works with addresses (A, B, C, …) and devices (1, 2, 3, …). An outlet is configured to listen on a particular ADDRESS/DEVICE pair.
  • STATE: whether to switch the outlet on (1/true) or off (0/false).

Example

Switching the device C2 on, and a second later, off again:

const kaku = require('kaku-old')(11);

kaku.on('C', 2);
setTimeout(() => kaku.off('C', 2));

Readme

Keywords

none

Package Sidebar

Install

npm i kaku-old

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • robertklep