Giter VIP home page Giter VIP logo

klipper-led_effect's People

Contributors

buzztiaan avatar guru-florida avatar julianschill avatar ksanislo avatar mapleleafmakers avatar mlee12382 avatar nailig avatar reemo3dp avatar todwulff avatar voidtrance avatar zerojarvis 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  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  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  avatar  avatar  avatar  avatar

Watchers

 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

klipper-led_effect's Issues

[Feature Request] Disable effects for specific LEDs

Currently im doing effects for my StealthBurner LEDs but it looks like when i set 2 effects that they both remain on which is fine.

It would be nice to have the ability to turn off all effects for specific LEDs like sb_leds which are 3 neopixels. And best would be to have the ability to turn off also a range of them. Like sb_leds (2-3).

For now i have to turn off all the effects that are defined for the specific LEDs. And since there is like 10 of them for only sb_leds you can imagine this is less then ideal.

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

led_effects is borked for use with dotstar led chains

As requested, this is your reminder... ;-)

"Hagbard V2.1070 Thank you. I think I know what the issue is. I made a change to read the color_order from the config, and apparently for dotstar there isnt such a configuration. So for dotstar I have to assume the default color order. Should be a quick fix, once I'm home. Would you mind creating an issue on github as a reminder for me?"

Thread start: https://discord.com/channels/460117602945990666/635687829254701107/925020306156970024

Add code for endstop state and RPi host and MUC temperature sensors?

I would like to have a temp status light for MCU and Pi Host CPU temps.
An endstop state would also be useful.

This is the line in printer.cfg that plots the temp in the on-screen graph if that helps.

[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 10
max_temp: 100

[temperature_sensor pico]
sensor_type: temperature_mcu
sensor_mcu: pico
min_temp: 10
max_temp: 100

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.

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

"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.

SET_LED_EFFECT only works once per effect

It seems that SET_LED_EFFECT will only trigger an effect once.

Example
SET_LED_EFFECT EFFECT=a works
SET_LED_EFFECT EFFECT=b works
SET_LED_EFFECT EFFECT=a stays on 'b'

HEATER effect only produces a static colour

In principle, this effect is great but it doesn't seem to work. I have it configured like this

[...]

[neopixel chamber]
pin: P1.24
chain_count: 144
initial_RED: 0.031
initial_GREEN: 0.031
initial_BLUE: 0.031
color_order: GRB

[...]

[led_effect preheat]
leds:
neopixel:chamber (106-140)
autostart: true
frame_rate: 24
heater: heater_bed
layers:
heater 45 1 top (0,1,0),(1,0,0)

I expected this to start up green, then transition to red as the bed heats up, but it just stays a solid green until it finally goes out when the bed reaches temperature.

Maybe I'm doing it wrong?

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.

Fire and heater_fire bug

The heater and heater fire animations when set to cutoff 1 do not stop working when the heater cools, they just stop displaying. For example if you use the 2 config examples and autostart bed efects and pannel idel the machine will breathe as it powers on, display fire untill temp and shutoff. pn cooling it displays back down untill min temp but then it stop breathe starting and stays on the first colour of the fire animation list, eg red.

Missing example-extras.cfg

Starting to get this setup when I went to the link for example-extras.cfg in the LED_EFFECT.md, the link to the file is invalid.

Update effects to new architecture

The frame handler has changed and not all effects have been adjusted to that new format. The following effects currently do not work and have to be updated:

  • Heater
  • AnalogPin
  • Stepper
  • Fire
  • HeaterFire
  • Progress

Fading for effects

Add a parameter to SET_LED_EFFECT to specify a fading time. This willbe used to fade in an effect when starting it and fade out an effect when stopping it.

Hardware support for addressable LEDs on MCUs

Currently the communication with the LEDs is done in software, which needs a lot of resources. The goal would be to use microcontroller hardware support for the communication. This could also be done for the Raspberry Pi.

This is something, that has to be done directly in Klipper and is only loosely related to this project. This issue is just a reminder.

Command to disable a single effect

Currently there is only a command to stop all Effects (STOP_LED_EFFECTS), but it would be useful to be able to deactivate single effects.

Effet K2000

Hi,

is it possible to make an effect like k2000, comet in one direction then in the other ?
Thanks

Can I assign different effect layers to different LEDs in one led_effect?

Great work!
It seems I need to define multiple led_effect to indicate one printer statue if I want to have different effects on different LEDs. Am I missing something? If not, is there any plan to change the way of defining led_effect?

Also, it would be helpful if I can directly configure part of the LED strips as curent "leds".

Not native English user, sorry for the grammary fault.

Dim lights when z-axis is closer to 0

Hi,

I noticed that when my z-axis is closer to the print bed, the LEDs on the extruder reflects too much light causing my streaming camera to lost all the details.
Is there a way to dim LEDs based on position of a stepper?

Wled

is it possible to Control a wled string with the script ?

[Feature Request] Gauge Effect

As you mull on the roadmap for LED_Effects, please consider adding a gauge effect for things such as axis position, axis velocity/rates, temps, completion percentage, etc. This would enable using led strips or matrices to visually display operating parameters in [near-] real-time.

An example use case is depicted here: https://i.imgur.com/BV00C4y.png (granted, X/Y/Z position indications are sort of redundant considering one can just look at the printer volume if in visual proximity of the printer, but having the axis' needle color modulated based on velocity - green to yellow to red would ratchet the neatness/geek factor through the roof, and one would be able to position the led strip/array away from the printer itself (i.e. on the wall or desk of the upstairs office when the printer is downstairs in the basement or located in a different room).

Also, if an axis' end-stop trigger could be detected, said axis background could be strobed a configurable color. Each gauge's background could be a user defined pallet, with the 'gauge needle' separately definable and possibly dynamic (i.e. velocity based color change on the axis position indication, as described above - considering the sample image, doing so could free up a couple of the led rows/columns for use to depict other gauges, etc.).

Other gauges that come to mind are MCU temp, Chamber Temp, Fan Operation Verification (speeds), humidity, and connectivity/machine state indication (not necessarily an element appropriate for depicting via a gauge, and likely possible to implement currently, but stated in the interests of stimulating thought and completeness).

Anyways, please advise if additional dialog is warranted/needed/desired. Take care and Thank You for your continued effort on this Klipper module. It is most appreciated.

-t

Blend frames instead of overwrite

At the moment the effect for LEDs gets overwritten by the other effect, when the LED belongs to multiple active effects. The desired behaviour is that they blend together, so that both effects are visible.

[Feature Request] Toggle or gcode command as toggle for use with gcode_button

I suppose what I have in mind is a feature request.

Currently,

Defined effect called panel_idle that can be controlled via the gcode command SET_LED_EFFECT EFFECT=panel_idle. Calling the command enables this effect. It can be disabled again by calling SET_LED_EFFECT EFFECT=panel_idle STOP=1`

What I would like to propose is perhaps when running a command that is already in effect, turns it off, instead of requiring STOP=1

Or perhaps the author has a different approach in mind where one could toggle a particular set of LEDs (enclosure lights for example) on/off via a physical gcode_button.

I understand not many people have physical buttons so I'll understand if it is not considered.

heater layer turns back on when disabling heater

First of all thanks for making this and making it available to us, really cool project!

I made the following config to light up my led strip in red, when the extruder heater is trying to reach a target temperature and be white when it is idle or reached its temperature:

[led_effect tool_effects]
autostart: true
frame_rate: 24
heater: extruder
leds:
    neopixel:leds
layers:
    heater  50 1 top    (1,0,0),(1,1,1)
    static  0  0 add    (1,1,1)

This works, but it also turn the heater layer back on when the extruder heater is switched off, resulting in the led strip also becoming red when it is cooling down before it reaches 50. Is this by design and if so how should I configure this so that it only turns red when the extruder is heating up?

[Feature Request] Turn off all effect

Maybe I have missed something obvious. but is there a way to turn off all effect so that the next effect if enabled can be the only one on. unless auto set lights. I want Macros to be able to be set at the start, mid and end of a print. I know I can right long code repeating all possible effects that might be on. but an all off would be good.

Direction of comet effect can`t be reversed

Changing the effect rate to negative does not affect the direction of comet.

reproduce:

comet -1 1 top (0.8, 1.0, 1.0),(0.0, 0.8, 1.0),(0.0, 0.0, 1.0)

and

comet 1 1 top (0.8, 1.0, 1.0),(0.0, 0.8, 1.0),(0.0, 0.0, 1.0)

have the same direction starting from the first led in a chain.

Flickering, checked voltage

Hi,
Thank you for developing this cool project. I have cheked my strip voltage, it's stable at 5v and isolated it from other wires, but it seems to be flickering. Do you have any other ideas to fix it?

  • led strip: SK6812
  • led unit counts: 60
  • mcu board: spider v1.1

[Feature Request] Runtime Instantiation/Edit of Effect

Please consider and evaluate feasibility of being able to instantiate/define an effect from gcode during runtime.

Having to have a myriad of possible effects defined at service startup that aren't editable/callable with parameters/variables is cumbersome.

Thank you, in advance.

-t

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

Effects examples

Hi
I would love to see more examples for each effect and not just short info.
for example a chase of gradient rainbow effect.. and so on.

Where to place "color_order_GRB: true" statement

Hi,

first I want to say that you did great work.
Unfortuanly I don`t know where to put in the "color_order_GRB: true" statement.
I´ve tried in the config of my LED, in the config of my LED-Effect and in the config of the LED-Effect in the leds: section.
Please give me a hint.

Best regards
Markus

Printer does not start up

Hello!

I installed everything as per to the instructions but when I define the effects, on the config file, printer does not start up.

[neopixel chamber_neopixel]
pin = PB6
chain_count = 69

[led_effect panel_idle]
autostart = true
frame_rate = 24
leds =
neopixel:chamber_neopixel
layers =
breathing 10 1 bottom (0.5,0.5,1.0)

I get this message:

Unhandled exception during run
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

Just to clarify, my LEDs work fine, and I don't believe that's the issue.

run_on_error does not work

Nice work. Though the docs is a little hard to understand.

I can't seem to get critical_error to work, even when i get errors mid print or mcu shutsdown.
I have it set to

[led_effect critical_error]
leds:
    neopixel:case_light (1, 9, 10, 18)
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:                            30
run_on_error:                          true

Doesn't seem to work

Installed via the script, using the "breathing panel_idle" lines in the config doc, I get an error from klipper

Internal error during ready callback: could not convert string to float: [(.5
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 try and make my own code, addressing arrays of LEDs hooked to my printer, I get index out of range errors.

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.