Giter VIP home page Giter VIP logo

moonshine's Introduction

moonshine

Controlling LEDs from Klipper using LED Control and a moonraker component. This repository contains the needed files and an installation script.

DEPRECATION WARNING

This is not actively maintained any more, as I am now concentrating on LED Effect. Please consider using this for controlling LEDs from Klipper. Alternatively you can also use the WLED support from moonraker.

Hardware setup

This supports WS2812B or SK6812 LED strips connected to a raspberry pi.

Check the section in the LED Control documentation on how to connect the LEDs.

Installation

This installation is adapted for MainsailOS, FluiddPi or a setup done by KIAUH. To install, clone the repository and run the installation script:

git clone https://github.com/julianschill/moonshine.git
cd moonshine
./install.sh

You can specify your klipper configuration directory and the moonraker directory with

./install.sh [-c /path/to/configuration_directory] [-m /path/to/moonraker]

if it is not in ~/klipper_config and ~/moonraker, respectively

This installs LED Control, adds an init.d script to start it at boot, links the module to moonraker, configures moonraker and adds gcode macros in the file ledcontrol.cfg.

Configuration

  1. Edit the file
/etc/default/ledcontrol

and change the numbers of LEDs to the number of your setup.

  1. Restart ledcontrol with
sudo service ledcontrol restart

LED Control should now be accesible with your browser under http://<ip_of_the_pi>:8000

  1. Add the following to your printer.cfg and restart klipper:
[include ledcontrol.cfg]

Calling the patterns and presets from Klipper

In the file ledcontrol.cfg exists a basic macro called SET_LED_CONTROL, which calls moonraker to set the patterns in LED Control. There are also the ids of the patterns and palettes in the comments.

Starting a preset

  1. Create a preset in the web interface and save it under some meaningful name.

  2. Call the macro to start this preset:

SET_LEDCONTROL PRESET="my_own_preset"

Change my_own_preset to the name you entered in the web interface

Modify settings directly

You can also change parameters by calling the macro:

SET_LEDCONTROL GROUP="main" BRIGHTNESS=0.7 SATURATION=0.5 PATTERN=0 SCALE=0.2 SPEED=0.4 PALETTE=0 GLOBAL_BRIGHTNESS=1.0 GLOBAL_SATURATION=1.0

You can set one or multiple parameters at once.

Parameters:

  • GROUP: The name of the LED group to configure, as named in the web interface (or the id, as defined in /etc/ledcontrol.json). If not specified the "main" group is selected.
  • BRIGHTNESS: The brightness for the group
  • SATURATION: The saturation value for the group
  • PATTERN: The pattern id (see [ledcontrol.cfg] for a list of built in ids)
  • SCALE: The scale value for the pattern
  • SPEED: The speed value for the pattern
  • PALETTE: The id of the palette (see [ledcontrol.cfg] for a list of built in ids)
  • GLOBAL_BRIGHTNESS: The brightness for all LEDs
  • GLOBAL_SATURATION: The saturation for all LEDs

Creating your own patterns and palettes (advanced)

You can create patterns and palettes over the UI of LED Control by opening http://<ip_of_the_pi>:8000 in your browser. Once you are happy with your settings you can get the ids of the patterns by calling http://<ip_of_the_pi>:8000/getfunctions and http://<ip_of_the_pi>:8000/getpalettes. This responds with a JSON object containing the data of the configured patterns and palettes. For better readability you can open the file in a JSON formatter tool such as https://jsonformatter.org/. We are looking for the ids of the patterns and palettes, which are the keys of the JSON objects. You can then use those ids additionaly to the provided ones in your klipper macros.

The saved configuration of LED Control, where the IDs can be found and edited can be found in

/etc/ledcontrol.json

moonshine's People

Contributors

julianschill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

moonshine's Issues

How to uninstall?

Hi - I'm bad at reading and realized this awesome looking package isn't what I need (controlling LEDs via MCU board, which has a port) as I don't have my LEDs wired to my Pi.

What process should I follow to uninstall or disable the components added? I started going through install.sh but my Linux-fu skills are not that great and I'd like to keep this Pi as clean as I can.

Thanks!

Support for mcu connected neopixel?

Using this for my 3d printer, with neopixel connected to an SKR e3 v3 and SKR pico and my rasp pi as the host. Is there a way to designate those pin connections to utilize this script or must it be connected to the pi?

If not, is it fine to have this git floating in my filespace or should I figure out how to uninstall? There is no uninstall script in the repo and honestly I'm not confident with navigating pi beyond written instructions and the local config files for my printer.

Thanks

Question -- Future dotstar compatibility? Also how to look at other MCU pins

Hi there, currently using your led-effects plugin with great success for two sets of dotstar runs. I asked this over at led-control with no answer, but wanted to see if you had any insight by chance. Is there going to be dotstar support in the future? Also, I have my LEDs connected to a Pico that's plugged into my main 4b via USB. Right now it's all dotstars but will be adding some neopixel leds, so I am wondering if there's a method to get led-control to look at the Pico's pins and/or the controller board's neopixel header. Thanks!

Issues defining RGB Order

Maybe its my fault, but I'm failing at assigning the right Pixel Order. I tried to define it via ssh with "sudo ledcontrol --led_count 150 --led_pixel_order GRB" but it still keeps in RGBW Mode. Also tried editing the ledcontrol.default file.

Can't edit etc/default/ledcontrol

I can not edit the file etc/default/ledcontrol...
When I open the file though Putty or WinSCP, it is in a read-only state and I can not change the permissions of the file.

This means that when I want to edit the file I get a Access Denied error in Putty...
I therefore cannot change my setup...

Webinterface Working but

not in Klipper. Is there a better description available ? Its so confusing. How to configure the Leds on Heating up the bed ? how i configure the leds after cooling down ....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.