Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

kaku-old

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kaku-old

Node KlikAanKlikUit (KaKu, old-style) driver for Raspberry Pi

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 30 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts