Bugsounet Coding

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    MMM-PiLights

    Idea of new modules ?
    2
    7
    165
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mlewus
      mlewus last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • bugsounet
        bugsounet Main Coder last edited by

        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 🙂

        1 Reply Last reply Reply Quote 0
        • bugsounet
          bugsounet Main Coder last edited by bugsounet

          @mlewus

          can you try this ?
          just clone it and npm install it
          config is actually the same like original (except: the module name), I have not (again) modify main code
          tell me if:

          • install is ok ?
          • launch properly ?
          • functionality are ok ?
          • what type of led do you use ? (ws2801 or lpd8806 ?)
          1 Reply Last reply Reply Quote 0
          • mlewus
            mlewus last edited by mlewus

            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!

            1 Reply Last reply Reply Quote 0
            • mlewus
              mlewus last edited by mlewus

              EXT-PiLights installed with no complaint. I am using LPD8806 LEDs and it works as it should. Thanks so much for this!

              1 Reply Last reply Reply Quote 0
              • bugsounet
                bugsounet Main Coder last edited by

                @mlewus
                Hi, I will code EXT-Led (with this module based and recoded) and I will Hard coding some Led sequence in Gateway

                Are you ready for testing my code in some days ?

                1 Reply Last reply Reply Quote 0
                • mlewus
                  mlewus last edited by

                  My mirror is working with Pi-Lights test module you previously provided. I can test the new module at any time.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB | @bugsounet ©2022