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
Intel Realsense t265 into Unreal Engine

t265_UE Intel Realsense t265 into Unreal Engine. Windows only, and Livelink plugin is 4.26.2 only at the moment. Might recompile it for different vers

Bjarke Aagaard 30 Jan 02, 2023
Create (templateable) cameras that display qr codes in homeassistant

QRCam This custom component creates cameras displaying qrcodes. The QRCodes can be static or generated from templates. If you use a template as conten

Jannes Müller 5 Oct 06, 2022
Doughskript interpreter for converting simple command sequences into executable Arduino C++ code.

Doughskript interpreter for converting simple command sequences into executable Arduino C++ code.

Svjatoslav 2 Jan 11, 2022
For use with an 8-bit parallel TFT touchscreen using micropython

ILI9341-parallel-TFT-driver-for-micropython For use with an 8-bit parallel TFT touchscreen using micropython. Many thanks to prenticedavid and his MCU

3 Aug 02, 2022
FHEM Connector for FHT Heating devices

home-assistant-fht from: https://github.com/Rsclub22 FHEM Connector for FHT Heating devices (connected via FHEM) Requires FHEM to work You can find FH

5 Dec 01, 2022
Real-time Coastal Monitoring at the University of Hawaii at Manoa

Coastal Monitoring at the University of Manoa Source code for Beaglebone/RPi-based data loggers, shore internet gateways, and web server. Software dev

Stanley Lio 7 Dec 07, 2021
gdsfactory is an EDA (electronics design automation) tool to Layout Integrated Circuits.

gdsfactory 3.5.5 gdsfactory is an EDA (electronics design automation) tool to Layout Integrated Circuits. It is build on top of phidl gdspy and klayou

147 Jan 04, 2023
A flexible data historian based on InfluxDB, Grafana, MQTT and more. Free, open, simple.

Kotori Telemetry data acquisition and sensor networks for humans. Documentation: https://getkotori.org/ Source Code: https://github.com/daq-tools/koto

83 Nov 26, 2022
A circle of LEDs

This repository contains all the design files, production files and example code for a simple circular LED display.

Pim de Groot 15 Aug 21, 2022
Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Hirokazu Ishida 12 Nov 19, 2022
A Raspberry Pi Pico plant sensor hub coded in Micropython

plantsensor A Raspberry Pi Pico plant sensor hub coded in Micropython I used: 1x Raspberry Pi Pico - microcontroller 1x Waveshare Pico OLED 1.3 - scre

78 Sep 20, 2022
LED effects plugin for klipper

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

Julian Schill 238 Jan 04, 2023
Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API.

Hildebrand Glow (DCC) Integration Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API. T

Aniket 153 Dec 30, 2022
Playing diabolo with two robot arms in ROS + Gazebo

Playing diabolo with robots This repository holds the ROS packages for playing diabolo with two UR5e robot arms on ROS Melodic (Ubuntu 18.04). Read ou

23 Dec 18, 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
Philippe 1 Jan 09, 2022
Alternative firmware for ESP8266 with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at

Alternative firmware for ESP8266/ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability

Theo Arends 59 Dec 26, 2022
Python implementation of ZMP Preview Control approach for biped robot control.

ZMP Preview Control This is the Python implementation of ZMP Preview Control app

Chaobin 24 Dec 19, 2022
Zev es un Bot/Juego RPG de Discord creado en y para aprender Python.

Zev es un Bot/Juego RPG de Discord creado en y para aprender Python.

Julen Smith 3 Jan 12, 2022
AERO 421: Spacecraft Attitude, Dynamics, and Control Final Project.

AERO - 421 Final Project Redevelopment Spacecraft Attitude, Dynamics, and Control: Simulation to determine and control a satellite's attitude in LEO.

Gagandeep Thapar 3 Dec 16, 2022