Skip to content
MagicMirror Module to control a led strip attached to a Raspberry Pi
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE Initial commit Sep 19, 2016
MMM-PiLights.js
README.md
node_helper.js
package.json

README.md

MMM-PiLights

MagicMirror Module to control a led strip attached to a Raspberry Pi

Requirements

This module is specifically meant for the Raspberry Pi system, using SPI and a LPD8806 LED strip. It may be compatible with other LED strips, but this has not been tested.

Buy the LPD8806 LED Strip here and learn how to connect it here

If using Raspbian, you will need to enable SPI:

sudo raspi-config

then navigate to Advanced options and enable SPI

Module installation

Clone the module and npm install:

cd ~/MagicMirror/modules
git clone https://github.com/jc21/MMM-PiLights.git
cd MMM-PiLights
npm install

Add the module config to ~/MagicMirror/config/config.js

modules: [
    {
        module: 'MMM-PiLights',
        config: {
            ledCount: 64,
            device: '/dev/spidev0.0'
        }
    }
]

Module Configuration Options

Option Type Default Description
ledCount Integer 64 Number LEDs on your strip
device String /dev/spidev0.0 The SPI Device for your LED strip

Trigger from another module

If you're developing a module and want to trigger a light sequence, here's an example of what you'd use in your module:

this.sendNotification('PILIGHTS_SEQUENCE', 'blue_pulse');

My other MagicMirror module is able to trigger light sequences with notifications: MMM-IFTTT

Trigger from a endpoint

The GET endpoint is pretty simple:

http://yourmagicmirror/PiLights?sequence=blue_pulse

From the command line:

curl -X GET "http://yourmagicmirror/PiLights?sequence=blue_pulse"

Available Sequences

  • white_pulse
  • blue_pulse
  • lightblue_pulse
  • red_pulse
  • green_pulse
  • orange_pulse
  • pink_pulse

More to come later.

You can’t perform that action at this time.