MMM-PiLights
-
I have been using MMM-PiLights RGB LED string driver module for several years now https://github.com/jc21/MMM-PiLights. It’s currently listed in the MagicMirror 3rd party list but fails
npm install
with MagicMirror 2.17.1 / node 14.18.3 / npm 6.14.15 due to outdated dependencies on the nan and spi-device packages. If enough people are interested it would be great if @bugsounet would include this as a supported 4th party module.
[TLDR]
MMM-PiLights controls a variable number of WS2801 or LPD8806 RGB LEDs connected as a series string to the Raspberry Pi via its SPI interface, using SPI0_SD0 and SPI0_SCLK. It can be triggered from an internal Magic Mirror notification or a HTTP interface. It flashes the LEDs in a particular color. Despite its limited functionality I found it useful to indicate when MMM-Hotword detects a wake up word, when I was using the old MMM-V2GoogleAssistant. I am now transitioning to the 4th party version of Google Assistant here. I have installed versions of node v14.18.3 and npm 6.14.15 in preparation of that transition, and I have all of my other modules working. I have not yet installed MMM-Detector or MMM-GoogleAssistant, though I do have the Google Assistant demo library working properly.MMM-PiLights will not install with these node/npm versions. The problem is in the required lpd8806-node module which also appears to be abandoned:
https://github.com/Trekky12/LPD8806-node
It has dependencies on outdated versions of nan (@2.14) and spi-device (@2.09) which won’t compile with my versions of node and npm. To fix this, lpd8806-node needs to be updated to nan 2.15.0 and spi-device to 3.1.2. The updated version of lpd8806-node then needs to be included in package.json of MMM-PiLights and a new package-lock.json file generated.I initially tried installing the correct versions of nan and spi-device and ran electron-rebuild. That failed in multiple places. For instance, lzma-native fails to build properly. I managed to get it installed using MagicMirror-rebuild (thanks, @bugsounet ! ) and manual updates as follows:
cd ~/MagicMirror/modules git clone https://git hub.com/jc21/MMM-PiLights.git cd ~/MagicMirror/modules/MMM-PiLights npm i magicmirror-rebuild ./node_modules/.bin/MagicMirror-rebuild /* this fails due to outdated spi-device */ npm install nan@2.15.0 --save npm install spi-device@3.1.2 --save ./node_modules/.bin/MagicMirror-rebuild
I have a C/C++ programming background but little-to-no experience with js, node and npm. If picking this up as a supported package is not possible, I’d appreciate if someone would point me to info about how to generate new package-lock.json files with updated dependency versions. I’ll fork PiLights and lpd8806-node to my own repository and try to do the updates.
Thanks!
-
Hi @mlewus
Interesting, I could integrated it in GA v4 with
EXT_PiLights
module
I can try to fix it if you want
of course I can give you access to the library in order to maintain it.Note, You can usewith v2/v3 even if GA v4 is under coding
-
-
I use the LPD8806. I looked at the changes you made and installed from your repository. It installed without error. I will test it tomorrow morning and make sure the LEDs work. Thanks, I really appreciate this!
-
EXT-PiLights installed with no complaint. I am using LPD8806 LEDs and it works as it should. Thanks so much for this!
-
@mlewus
Hi, I will code EXT-Led (with this module based and recoded) and I will Hard coding some Led sequence in GatewayAre you ready for testing my code in some days ?
-
My mirror is working with Pi-Lights test module you previously provided. I can test the new module at any time.
-
@mlewus:
I have doneGateway
, So i will code the new plugin
But … I have no Led strip actually for testing
I will do itfrom scratch and with close eyes
Do you use any recipes actually for working with LED ?
Can you send me for helping ?Actually Gateway is ready for receive order from GA
I will use status of GA for blinking LED with colors[ Color : Status of GA ]
- blue_pulse : Listen
- white_pulse: Standby
- lightblue_pulse : Continue
- red_pulse : Error
- green_pulse : Reply
- orange_pulse: Think
- pink_pulse: Hook
What do you think of this color schema ?
-
Looks good to me. if you need some strip LEDs I can send them to you wired for the Pi, or I can do testing here. I am currently away from home at my son’s wedding. I’ll be back in a couple of days. Let me know how you’d like to proceed.