LED effects plugin for klipper

Overview

LED Effects for Klipper.

This plugin allows Klipper to run effects and animations on addressable LEDs, such as Neopixels, WS2812 or SK6812.

The main work has been done by Paul "Mental" McGowan.

Installation

cd ~
git clone https://github.com/julianschill/klipper-led_effect.git
cd klipper-led_effect
./install-led_effect.sh

Configuration

Documentation can be found here.

Comments
  • Problem with colors after update

    Problem with colors after update

    Hello, before the last update all the configured colors worked correctly. After the last update instead of having the red led I have the green one. The neopixel configuration is correct, the problem seems to be the plugin.

    Thank you

    bug question 
    opened by panik988 17
  • Internal error during ready callback:

    Internal error during ready callback:

    Hello,

    After using this for a day or so I started tweaking some more effects for my usecase. While doing so I pressed the save and restart button while an effect was still active. Resulting in Internal error during ready callback: Once the underlying issue is corrected, use the "FIRMWARE_RESTART" command to reset the firmware, reload the config, and restart the host software. Printer is shutdown

    If I go into my loggfile I can find the following error mentioned :

    Unhandled exception during ready callback
    Traceback (most recent call last):
      File "/home/pi/klipper/klippy/klippy.py", line 205, in _connect
        cb()
      File "/home/pi/klipper/klippy/extras/led_effect.py", line 397, in _handle_ready
        
      File "/home/pi/klipper/klippy/extras/led_effect.py", line 740, in __init__
    
        
    MemoryError
    Transition to shutdown state: Internal error during ready callback: 
    

    removing the led_effects plugin solves this and I can re-use my printer. doing a fresh install of the led_effect plugin now causes the same behaviour of the above message. (I believe that it has written something in the MCU memory?)

    any way to solve this without me needing to reflash both my MCU's? klippy (2).log

    bug fixed_in_next_version 
    opened by BelgianGuyWithALaser 16
  • RGB to RGBW color conversion with color temperature

    RGB to RGBW color conversion with color temperature

    The RGB colors are converted to RGBW values, when a RGBW strip is connected. This also means, that a color temperature has to be configured.

    Currently the color temperature of the white led is hardcoded. This has to be moved to the configuration.

    enhancement 
    opened by julianschill 12
  • LED effects seem to cause issue with recent update

    LED effects seem to cause issue with recent update

    Love the LED effects, but I have just updated Klipper, Moonraker and the Raspberry Pi OS via the links in Fluid and now I get an error 'internal error during ready callback: PrinterNeoPixel instance has no attribute 'chain_count' If I comment out the effects in the config file then everything back to normal but no LED Effects. Declaring Neopixels in the config is still okay just not the effects.

    bug 
    opened by srothwel 11
  • Error config

    Error config

    I put into config this code from docs:

    [led_effect critical_error]
    leds:
        neopixel:tool_lights
        neopixel:bed_lights
    layers:
        strobe         1  1.5   add        (1.0,  1.0, 1.0)
        breathing      2  0     difference (0.95, 0.0, 0.0)
        static         1  0     top        (1.0,  0.0, 0.0)
    autostart:                             false
    frame_rate:                            24
    run_on_error:                          true
    

    And I have error:

    Internal error during ready callback: 'float' object cannot be interpreted as an integer
    Once the underlying issue is corrected, use the
    "FIRMWARE_RESTART" command to reset the firmware, reload the
    config, and restart the host software.
    Printer is shutdown
    

    In log:

    Traceback (most recent call last):
      File "/home/klipper/klipper/klippy/klippy.py", line 205, in _connect
        cb()
      File "/home/klipper/klipper/klippy/extras/led_effect.py", line 382, in _handle_ready
        self.layers.insert(0, layer(handler       = self,
      File "/home/klipper/klipper/klippy/extras/led_effect.py", line 659, in __init__
        for c in range(0, len(self.paletteColors)):
    TypeError: 'float' object cannot be interpreted as an integer
    Transition to shutdown state: Internal error during ready callback: 'float' object cannot be interpreted as an integer
    
    bug enhancement 
    opened by dagov42 10
  • Leds flickering when printing

    Leds flickering when printing

    Hi, sorry to report this but I am have a problem with klipper-led-effect while printing, I have two channels One for a status led with 8 led and a toolhead led with 2

    While printing I am finding that the blink is very random and flicker and the toolhead led are while and will just turn on and off random

    I have the led on a decated controller running klipper firmware

    When I run the gcode when not printing it will work fine

    I am running the latest klipper and fluidd software

    opened by quicksilverstar 9
  • SET_LED after gets overwritten after stopping LED effects

    SET_LED after gets overwritten after stopping LED effects

    So my printer sits idle with two effects running, a rainbow gradient for case lights and one for stealthburner leds. In my print_start I call SET_LED_EFFECT EFFECT=party STOP=1 and SET_LED_EFFECT EFFECT=party2 STOP=1 to stop that effect and then I call a standard klipper set_led command to set the case lights to full white, and then the SB macro for STATUS_HEATING.

    Sometimes this all works correctly, most times what happens is the effects stop, the case lights do NOT set to white and the SB does set to status heating, sometimes neither LED strip gets set and they're just off after the effects turn off.

    If I do it manually it's fine, if I put the set led calls later in the Print_start macro it's fine, it seems like a timing issue of some sort, like they're being executed too close together and something doesn't work right

    bug question fixed_in_next_version 
    opened by julianschill 8
  • How do I start with one effect then after a time, automatically switch to another?

    How do I start with one effect then after a time, automatically switch to another?

    I see the FADETIME option but it seems that has to be tied to a macro? I'd like the machine to boot up with one effect then after a couple seconds switch to another one. Imagine a comet effect for a couple seconds then switching to a static color. Can I use the FADETIME as part of the effect description and make it autostart: true ?

    opened by Gliptopolis 7
  • "AttributeError: PrinterNeoPixel instance has no attribute 'led_helper'" When effect is in config

    Hi, I'm not terribly familiar with this stuff, but after installing the plugin via the provided install script and adding an effect to my printer config, I get:

    Unhandled exception during run
    Traceback (most recent call last):
      File "/home/pi/klipper/klippy/klippy.py", line 201, in run
        self.reactor.run()
      File "/home/pi/klipper/klippy/reactor.py", line 269, in run
        g_next.switch()
      File "/home/pi/klipper/klippy/reactor.py", line 310, in _dispatch_loop
        timeout = self._check_timers(eventtime, busy)
      File "/home/pi/klipper/klippy/reactor.py", line 156, in _check_timers
        t.waketime = waketime = t.callback(eventtime)
      File "/home/pi/klipper/klippy/extras/led_effect.py", line 192, in _getFrames
        chain.led_helper.led_state[index] = (0.0, 0.0, 0.0, 0.0)
    AttributeError: PrinterNeoPixel instance has no attribute 'led_helper'
    Transition to shutdown state: Unhandled exception during run
    

    I've got this in my config:

    #############
    # Neopixels #
    #############
    
    [neopixel rail_light]
    pin: P1.24
    chain_count: 25
    color_order: GRB
    initial_RED: .5
    initial_GREEN: 0
    initial_BLUE: .5
    
    [led_effect idle]
    autostart:              true
    frame_rate:             24
    leds:
        neopixel:rail_light (1-25)
    layers:
        breathing  10 1 top (.5,.5,1)
    

    I'm not quite sure if this is a bug or user error on my part, and I'm not sure what to do in order to troubleshoot this.

    Thank you in advance for any help.

    opened by ryryog25 6
  • Repeated

    Repeated "Neopixel update did not succeed" error until klipper crashes

    With any LED effects enabled klipper continuously gives "Neopixel update did not succeed" error until klipper overloads and crashes. Fresh install of klipper and LED control module installed did not resolve issue. klippy (5).log .

    opened by drb1981 5
  • After new Klipper update Printer wont boot with certain effect enabled. Zero error message just cant connect to mcu

    After new Klipper update Printer wont boot with certain effect enabled. Zero error message just cant connect to mcu

    When I have a Led Effect defined as Comet, Bed Temp, Progress or twinkle, the newest version of klipper v0.10.0-384-g5517a856 fails to start with only a cannot connect to mcu error. Once those lines are removed it boots fine. So far static and linear fade have worked.

    opened by Jo3yDaPh1sH 5
  • Internal error caused by combination of effects

    Internal error caused by combination of effects

    When I tried to use a set of effects by adding it to the configuration file and restarting klipper, Klipper wouldn't start citing: Internal error during ready callback: 'colorArray' object has no attribute 'copy'

    This is what I added:

    autostart:              false
    frame_rate:             24
    leds:
        neopixel:caselight
    layers:
        pattern    0.4   1.0      add   (0.0, 0.5, 1.0), (0.3, 0.5, 0.5), (0.0, 1.0, 0.0) 
    

    I found that I could swap pattern with other styles to make it work. This pattern config worked great in the simulator.

    bug fixed_in_next_version 
    opened by spikeygg 3
  • Unknown command:

    Unknown command: "STOP_LED_EFFECTS"

    Hey I have this mostly set up and working, but was looking for a way to turn off the LEDs. I found the STOP_LED_EFFECTS gcode command in the documentation, but klipper doesn't seem to recognize is. Followed the install instruction in the readme and haven't noticed any errors in my logs.

    Any advice? Thanks!

    opened by abrenoch 1
  • Install Path changes

    Install Path changes

    Since Klipper is now using $ { HOME } /printer_data/config instead of $ { HOME } /klipper_config/ it might be a good idea to update the install script, maybe have a legacy version available for those with older installs also.

    fixed_in_next_version 
    opened by mlee12382 1
  • This specific config crashes the latest klipper version

    This specific config crashes the latest klipper version

    I did a little experiment that didn't work but still had this config section in my led_effects.cfg file: `#####################

    whole_top_strip

    #####################

    [led_effect top_strip_stroboscope] leds: neopixel:top_strip autostart: false frame_rate: 60 layers: strobe 110 100 top (0.0, 0.0, 0.0, 1.0)

    [gcode_macro stroboscope] gcode: STOP_LED_EFFECTS SET_LED_EFFECT EFFECT=top_strip_stroboscope`

    when starting klipper after I updated tonight, I got this error message. This was only happening on the chain connected to my klipper expander, so I tried upgrading the mcu there and on the octopus for good measure to all be on the latest klipper version, but no luck until I figured out it was this led effect that caused it, giving the following error in klippy.log:

    Unhandled exception during run Traceback (most recent call last): File "/home/pi/klipper/klippy/klippy.py", line 217, in run self.reactor.run() File "/home/pi/klipper/klippy/reactor.py", line 292, in run g_next.switch() File "/home/pi/klipper/klippy/reactor.py", line 340, in _dispatch_loop timeout = self._check_timers(eventtime, busy) File "/home/pi/klipper/klippy/reactor.py", line 158, in _check_timers t.waketime = waketime = t.callback(eventtime) File "/home/pi/klipper/klippy/extras/led_effect.py", line 177, in _getFrames frames = [(effect, effect.getFrame(eventtime)) for effect in self.effects] File "/home/pi/klipper/klippy/extras/led_effect.py", line 177, in <listcomp> frames = [(effect, effect.getFrame(eventtime)) for effect in self.effects] File "/home/pi/klipper/klippy/extras/led_effect.py", line 413, in getFrame layerFrame = layer.nextFrame(eventtime) File "/home/pi/klipper/klippy/extras/led_effect.py", line 485, in nextFrame return self.thisFrame[self.frameNumber] IndexError: list index out of range Transition to shutdown state: Unhandled exception during run klippy (10).log

    Full klippy.log attached to the issue.

    enhancement fixed_in_next_version 
    opened by Nyegaard 3
  • Example for daisy chained LEDs

    Example for daisy chained LEDs

    Hi @julianschill

    could you please provide an example on how the configuration would look like for daisy chained LEDs on a single PIN? For example PB0 on a Octopus 1.1 with four segments of WS2812b.

    Thank you for your help!

    support 
    opened by andreklug 6
Releases(v0.0.9)
  • v0.0.9(Nov 15, 2022)

    What's Changed

    Improvements and fixes

    • Updated simulator for heater and stepper effects
    • Fix bug in heater effect by @Nailig in https://github.com/julianschill/klipper-led_effect/pull/97
    • Optimize enabling and disabling so it executes immediately
    • Better error handling when only defining one color for chase effect

    New effects:

    • Temperature sensor: color based on temperature of temperature sensors, that don't have a target value
    • Stepper Color: Color based on position of axis
    • Pattern: A pattern, that gets shifted along the chain

    New Contributors

    • @Nailig made their first contribution in https://github.com/julianschill/klipper-led_effect/pull/97 Thank you!

    Full Changelog: https://github.com/julianschill/klipper-led_effect/compare/v0.0.8...v0.0.9

    Source code(tar.gz)
    Source code(zip)
    ledeffect-simulator-macos.zip(16.35 MB)
    ledeffect-simulator-win.exe(15.98 MB)
  • v0.0.8(Oct 23, 2022)

  • v0.0.7(Oct 6, 2022)

    This update adds direct RGBW support. Define your colors with either 3 or 4 values. If the 4th value is provided, it will be sent to the white LED of your RGBW strip.

    The conversion from RGB to RGBW has been completely removed, so your colors might look different after the update.

    What's Changed

    • RGBW support by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/90
    • Added documentation for RGBW support by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/92
    • Merge develop into master by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/93

    Full Changelog: https://github.com/julianschill/klipper-led_effect/compare/v0.0.6...v0.0.7

    Source code(tar.gz)
    Source code(zip)
  • v0.0.6(Sep 21, 2022)

    What's Changed

    Configuration changes

    • Cut-off for gradient effect now determines the length of the gradient

    New Features and Bugfixes

    • Python3 compatibility by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/66
    • Python3 by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/68
    • Julianschill/issue61 Disable effects for specific LEDs by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/80
    • Fixes progress effect to turn off all LEDs when progress==0 by @guru-florida in https://github.com/julianschill/klipper-led_effect/pull/73
    • Make finer transition for gradient effect by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/86
    • Calculation of stepper position (as %) is incorrect for non-zero min … by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/87

    New Contributors

    • @guru-florida made their first contribution in https://github.com/julianschill/klipper-led_effect/pull/73

    Full Changelog: https://github.com/julianschill/klipper-led_effect/compare/v0.0.5...v0.0.6

    Source code(tar.gz)
    Source code(zip)
  • v0.0.5(Jun 25, 2022)

    What's Changed

    • Python3 compatibility (#66) by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/67

    Full Changelog: https://github.com/julianschill/klipper-led_effect/compare/v0.0.4...v0.0.5

    Source code(tar.gz)
    Source code(zip)
  • v0.0.4(Jun 25, 2022)

    Bugfix Release

    What's Changed

    • Julianschill/issue3 by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/33
    • Support temperature fans for heater effects by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/34
    • diffuse from heatsource, not LED 3 by @ksanislo in https://github.com/julianschill/klipper-led_effect/pull/27
    • Julianschill/issue38 by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/39
    • Julianschill/issue38 by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/40
    • Fix effects for new klipper implementation by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/43
    • Fix for newest Klipper update. Fix shutdown handling. by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/53
    • Fix for newest Klipper update. Fix shutdown handling. (#53) by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/54

    New Contributors

    • @ksanislo made their first contribution in https://github.com/julianschill/klipper-led_effect/pull/27

    Full Changelog: https://github.com/julianschill/klipper-led_effect/compare/v0.0.3...v0.0.4

    Source code(tar.gz)
    Source code(zip)
  • v0.0.3(Jan 24, 2022)

    This is the alpha for the upcoming 0.1.0 release. Please use with care and report any bugs.

    What's Changed

    • Fixed all effect layers @julianschill in https://github.com/julianschill/klipper-led_effect/pull/18
    • Fix color order handling and offset handling for dotstar LEDs by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/22
    • Fix reverse direction behaviour of comet and chase by @julianschill in https://github.com/julianschill/klipper-led_effect/pull/26
    • Support for tabulator in effect layer config by @TodWulff in https://github.com/julianschill/klipper-led_effect/pull/23

    Known issues:

    • Documentation is not up-to-date
    • Effects, that run concurrently on the same LED are not added, but overwritten
      • Work-around: Use SET_LED_EFFECT EFFECT=<name> STOP=1 or STOP_LED_EFFECTS to stop an effect or all effects prior to starting a new one
    • Due to lack of peripheral support for neopixels in Klipper, effects might be interrupted by motor movements
      • Work-around: Use a separate MCU (e.g. KlipperExpander) for controlling LEDs.

    New Contributors

    • @julianschill made their first contribution in https://github.com/julianschill/klipper-led_effect/pull/18
    • @TodWulff made their first contribution in https://github.com/julianschill/klipper-led_effect/pull/23

    Full Changelog: https://github.com/julianschill/klipper-led_effect/compare/v0.0.2...v0.0.3

    Source code(tar.gz)
    Source code(zip)
  • v0.0.2(Nov 13, 2021)

  • v0.0.1(Nov 13, 2021)

Owner
Julian Schill
Julian Schill
Plug and Play on Internet of Things with LoRa wireless modulation.

IoT-PnP Plug and Play on Internet of Things with LoRa wireless modulation. Device Side In the '505_PnP' folder has a modified ardunino template code s

Lambert Yang 1 May 19, 2022
Programming of Robotics Systems course at the University of Aveiro, Portugal, 2021-2022.

Programação de Sistemas Robóticos Miguel Riem Oliveira Universidade de Aveiro 2021-2022 Projeto AtlasCar Projecto RACE IROS 2014 AtlasCar2 ATOM IROS 2

Miguel Riem de Oliveira 22 Jul 13, 2022
Simple Microservice to control 433Mhz wireless sockets over HTTP, e.g. on a RaspberryPi

REST-light is a simple microservice to control 433Mhz wireless sockets over HTTP, e.g. on a RaspberryPi. The main usage is an easy integration of 433M

Pascal Höhnel 1 Jan 09, 2022
An open source operating system designed primarily for the Raspberry Pi Pico, written entirely in MicroPython

PycOS An open source operating system designed primarily for the Raspberry Pi Pico, written entirely in MicroPython. "PycOS" is an combination of the

8 Oct 06, 2022
Parametric open source reconstructions of Voron printed parts

The Parametric Voron This repository contains Fusion 360 reconstructions of various printed parts from the Voron printers

Matthew Lloyd 26 Dec 19, 2022
Create a low powered, renewable generation forecast display with a Raspberry Pi Zero & Inky wHAT.

GB Renewable Forecast Display This Raspberry Pi powered eInk display aims to give you a quick way to time your home energy usage to help balance the g

Andy Brace 32 Jul 02, 2022
Philippe 1 Jan 09, 2022
View your medication from Medisafe Cloud in Home Assistant

Medisafe View your medication from Medisafe Cloud in Home Assistant. This integration adds sensors for today's upcoming, taken, skipped, and missed do

Sam Steele 12 Dec 27, 2022
This repo uses a stereo camera and gray-code-based structured light to realize dense 3D reconstruction.

Structured-light-stereo This repo uses a stereo camera and gray-code-based structured light to realize dense 3D reconstruction. . How to use: STEP 1:

FEI 20 Dec 31, 2022
Simples Keylogger para Windows com um autoboot implementado no sistema

MKW Keylogger Keylogger simples para Windos com um autoboot implementado no sistema, o malware irá capturar pressionamentos de tecla e armazená-lo em

3 Jul 03, 2021
A modular sequencer based on Pi Pico & EuroPi

PicoSequencer A modular sequencer based on Pi Pico & EuroPi by Zeno Van Moerkerke / Keurslager Kurt For now it is 'only' a trigger sequencer, but I si

5 Oct 27, 2022
An alternative to Demise-Assistant-Batch made entirely in Python for more capabilities.

Demise-Assistant-Python An alternative to Demise-Assistant-Batch made entirely in Python for more capabilities. IMPORTANT NOTE Demise-Assistant-Batch

SkelOrganisation 1 Nov 24, 2021
DIY split-flap display

The goal is to make a low-cost display that's easy to fabricate at home in small/single quantities (e.g. custom materials can be ordered from Ponoko or similar, and other hardware is generally availa

Scott Bezek 2.5k Jan 05, 2023
Blender Camera Switcher

Blender Camera Switcher A simple camera switcher addon for blender. Useful when use reference image for camera. This addon will automatically fix the

Corgice 1 Jan 31, 2022
A python library written for the raspberry pi.

A python package for using certain components on the raspberry pi.

Builder212 1 Nov 09, 2021
Andreas Frisch 1 Jan 10, 2022
Play a song with a 3D printer.

MIDI to GCODE Play a song with a FDM 3D printer. SLA printers don't have motors, so they cannot play music. Warning: Be ready to turn off the 3D print

Patrick 6 Apr 11, 2022
Pure micropython ESP32 SPI driver for sdcard and screen at the same SPI bus

micropython-esp32-spi-sdcard-and-screen-driver Proof of concept of Pure micropython espidf SPI driver for sdcard with screen at the same SPI bus (exam

Thomas Favennec 7 Mar 14, 2022
Transform a Raspberry Pi into a network diagnostic machine.

EtherView Last updated jan 30, 2022. Welcome to the EtherView project! This is a project to transform a RaspberryPi into a portable network diagnostic

1 Jan 30, 2022
A refreshed Python toolbox for building complex digital hardware

A refreshed Python toolbox for building complex digital hardware

nMigen 1k Jan 05, 2023