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
HomeAssistant - Polyaire AirTouch 4 Integration

HomeAssistant - Polyaire AirTouch 4 Integration Custom integration to add an AirTouch 4 AC Controller Installation: Copy contents of custom_components

7 Aug 05, 2022
Segger Embedded Studio project for building & debugging Flipper Zero firmware.

Segger Embedded Studio project for Flipper Zero firmware Установка Добавить данный репозиторий в качестве сабмодуля в корень локальной копии репозитор

25 Dec 28, 2022
Kwcpu - An unobtrusive CPU meter that fits in the default Windows 11 taskbar. Supports up to 32 cores.

kwcpu An unobtrusive CPU meter that fits in the default Windows 11 taskbar. Supports up to 32 cores. kwcpu is provided as a Rainmeter skin. By default

Jay Oster 2 Nov 07, 2022
Turns a compatible Raspberry Pi device into a smart USB drive for PS4/PS5.

PSBerry A WIP project for Raspberry Pi, which turns a compatible RPI device into a smart USB drive for PS4/PS5. Allows for save management of PS4 game

Filip Tomaszewski 2 Jan 15, 2022
Python script: Enphase Envoy mqtt json for Home Assistant

A Python script that takes a real time stream from Enphase Envoy and publishes to a mqtt broker. This can then be used within Home Assistant or for other applications. The data updates at least once

29 Dec 27, 2022
A simple portable USB MIDI controller based on Raspberry-PI Pico and a 16-button keypad, written in Circuit Python

RPI-Pico-16-BTn-MIDI-Controller-using-CircuitPython A simple portable USB MIDI controller based on Raspberry-PI Pico, written in Circuit Python. Link

Rounak Dutta 3 Dec 04, 2022
Used python functional programming to make this Ai assistant

Python-based-AI-Assistant I have used python functional programming to make this Ai assistant. Inspiration of project : we have seen in our daily life

Durgesh Kumar 2 Dec 26, 2021
A versatile program that uses the raspberry pi camera and provides it as a service

PiCameleon Is a daemon program meant to provide the RaspberryPi Camera as a service while running according to a configuration.

André Esser 52 Oct 16, 2022
A low power 1U Raspberry Pi cluster server for inexpensive colocation.

Raspberry Pi 1U Server There are server colocation providers that allow hosting a 1U server for as low as $30/month, but there's a catch: There are re

Paul Brown 627 Dec 31, 2022
Micropython-wifimanager-esp8266 - Simple Wifi Manager for ESP8266 using MicroPython

micropython-wifimanager-esp8266 Simple Wifi Manager for ESP8266 using MicroPytho

Abhinuv Nitin Pitale 1 Jan 04, 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
What if home automation was homoiconic? Just transformations of data? No more YAML!

radiale what if home-automation was also homoiconic? The upper or proximal row contains three bones, to which Gegenbaur has applied the terms radiale,

Felix Barbalet 21 Mar 26, 2022
a weather application for the raspberry pi and the Pimorioni Inky pHAT.

raspi-weather a weather application for the raspberry pi and the Inky pHAT

Derek Caelin 59 Oct 24, 2022
A Macropad using the Raspberry Pi Pico, programmed with CircuitPython.

A Macropad using the Raspberry Pi Pico, programmed with CircuitPython.

15 Oct 14, 2022
Example code and projects for FeatherS2 and FeatherS2 Neo

FeatherS2 & FeatherS2 Neo This repo is a collection of code, firmware, and files

Unexpected Maker 5 Jan 01, 2023
A install script for installing qtile and my configs on Raspberry Pi OS

QPI OS - Qtile + Raspberry PI OS Qtile + Raspberry Pi OS :) Installation Run this command in the terminal

RPICoder 3 Dec 19, 2021
Toy robot that traverses on a finite surface

Toy Robot Challenge - Release Notes November 12, 2021 New features Initialisation - Users can set the home position and heading of the robot. Position

Ze Fei Teo 0 Feb 03, 2022
Alarm Control Panel component for Zigbee Keypads using action_transaction field

hass_transaction_alarm_panel Alarm Control Panel component for Zigbee Keypads using action_transaction field. Works together with zigbee2mqtt Supporte

Konstantin 4 Jun 09, 2022
A custom mechanical keyboard inspired by the CFTKB Mysterium

Env-KB A custom mechanical keyboard inspired by the CFTKB Mysterium Build Guide and Parts List What is to do? Right now for the first 5 PCBs I have, i

EnviousData 203 Jan 04, 2023
MicroPython driver for 74HC595 shift registers

MicroPython 74HC595 A MicroPython library for 74HC595 8-bit shift registers. There's both an SPI version and a bit-bang version, each with a slightly

Mike Causer 17 Nov 29, 2022