Skip to content

dxprog/mewo-pi-device

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

MeWo Pi Device

A node library that allows a MeWo emulated hub to control GPIO pins on a Raspberry Pi.

Installation

npm install --save mewo-pi-device

Note: GPIO pins can only be controlled while running as root.

API

PiDevice(deviceName, responder, [ pins ])

Object constructor.

  • deviceName: The name of the device
  • responder: The UPnpBroadcastResponder object
  • pins: A pin number or array of pin numbers for this device to control

Example

const { UPnpBroadcastResponder } = require('mewo');
const { PiDevice } = require('mewo-pi-device');

const GPIO_PIN = 40;

const responder = new UPnpBroadcastResponder();
responder.init().then(() => {
  const piDevice = new PiDevice('pi-device', responder, GPIO_PIN);
  responder.registerDevice(piDevice);
});

About

A MeWo device wrapper for Raspberry Pi GPIO

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published