klipper-led_effect
klipper-led_effect copied to clipboard
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
You can try to add
SAVE_GCODE_STATE NAME="a name" Your gcode macros, then RESTORE_GCODE_STATE NAME="a name"
That tends to help mine. Also if you have any on a delay, then you MUST wait for the time to run out. Otherwise they glitch up.
After writing all of the below, I just now noticed this issue was opened by the repo owner. Thus, as he's already aware of this, my comment isn't really helping anything, except maybe to contribue some elaboration, for whatever that may be worth.
I like to have a default LED effect on my Stealthburner (I have the Rainbow Barf in the logo, it's fun). I also use these macros to automagically set the logo and nozzle LEDs based on certain states/activities (e.g. STATUS_BUSY
turns the logo LEDs red).
I've modified those macros to include STOP_LED_EFFECTS LEDS="neopixel:sb_leds (1-8)"
as the first command, but most times it doesn't work; the LEDs continue with the effect, or sometimes the effect gets stuck with weird colors. Sometimes if I repeat the STATUS_*
macro two, three, seven times, it'll eventually work, but most of the time it doesn't.
But like you said, if I run the contents of the macro manually in the console, it works fine.
Other things I've tried (for posterity):
- adding the
STOP_LED_EFFECTS ...
multiple times at the start of those macros, doesn't seem to help. - adding
G4 ...
(dwell) commands to induce various delays. - @burntcoinpurse's suggestion to use
[SAVE|RESTORE]_GCODE_STATE
I really dig this module, and may find myself digging into the source more to see if I can help.
Try.
STOP_LED_EFFECTS Don't add the the LED strand. Or SET_LED LED="Your_led_name" RED=O GREEN=0 BLUE=0 If you're trying to run multiple effects at different times on 1 strip, you can try making macros for each one. Also if they are on delays or fadetimes, you have to let that time run out before you can issue more commands.
Try STOP_LED_EFFECTS
I haven't tried that as I have three neopixel groups across two RGB channels, and I didn't have a reason to stop everything everywhere. But for testing purposes, may as well give it a shot and See What Happens™
If you're trying to run multiple effects at different times on 1 strip...
I'm trying to keep things simple while setting this up, so there's only three effects defined, each one running on only one of the three neopixel groups.
Also if they are on delays or fadetimes, you have to let that time run out before you can issue more commands.
Good point. No delays or fades in my config, but good to know.
Thanks for the input!
I fixed this already in the develop branch. I have to do some more testing before I release it.
I fixed this already
Orly? That must be commit 1feb95e. I thought I was using develop branch, but apparently I overlooked something on my end.
Thanks brotha, sorry for the spam!
If you are in fact running the develop branch and still have the issue, let me know, please.
I certainly remember running git checkout develop
, but apparently I never ran the install-led_effect.sh
script. So, yeah, confirmed: I am two kinds of idiot :)
It works perfectly.
Thanks, and my apologies for the unnecessary traffic.