What's new
VORON Design

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members!

Klipper LED effect

Daylight starting sets my case light (daylight on a stick) 24v leds to a certain brightness. They are separate from the Disco stick XXL I'm trying to get to work.
I did some further testing and it has something to do with the output pins I'm trying to 'hijack' on the board. I wired the disco stick to the neopixel slot and it works great. No issues. But I lose my bed LED that I have wired up to show the bed temp reflected as LED color. Seems like no matter what other pin I use on the BTT Octopus it doesn't want to work. When I use the EXP1 pins or TFT pins (both 5v for the bed led now it goes to the wrong colors). I'm thinking for my wiring I need a second neopixel slot.
Klipper expander perhaps?
For my case lightning with 42 Neopixels I use FAN output on 5v for power and PB6 for data, works great.
 
Daylight starting sets my case light (daylight on a stick) 24v leds to a certain brightness. They are separate from the Disco stick XXL I'm trying to get to work.
I did some further testing and it has something to do with the output pins I'm trying to 'hijack' on the board. I wired the disco stick to the neopixel slot and it works great. No issues. But I lose my bed LED that I have wired up to show the bed temp reflected as LED color. Seems like no matter what other pin I use on the BTT Octopus it doesn't want to work. When I use the EXP1 pins or TFT pins (both 5v for the bed led now it goes to the wrong colors). I'm thinking for my wiring I need a second neopixel slot.
Klipper expander perhaps?
On my Octopus I am using the NeoPixel port for the SB LEDs and hijacked the BL Touch port for my NeoPixel case lights. Works great.
 
On my Octopus I am using the NeoPixel port for the SB LEDs and hijacked the BL Touch port for my NeoPixel case lights. Works great.
Man my setup must be funky. I tried exactly that multiple times and it’s going all wonky.
I ended up adding a klipper expander for the 2nd neopixel slot and finally things are working smoothly and predictably.
 
For my case lightning with 42 Neopixels I use FAN output on 5v for power and PB6 for data, works great.
Tied PB6, PB7 PA9 and most of the PE block and they all acted the same. Only spot that continues the proper effect while printing without going schizophrenic is the neopixel slot.
I tried taking 5v from a fan spot, bl touch and direct from the 5v psu.
 
Mine is on PB6. It just worked. 🤷‍♂️ GND & 5V also from the two adjacent pins there. I use BTF Lighting WS2812B strips for the case lights on that port. It's on a 250 Trident, so maybe wire length? I've seen some people with issues on 300 & 350 that I haven't seen.
 
Tied PB6, PB7 PA9 and most of the PE block and they all acted the same. Only spot that continues the proper effect while printing without going schizophrenic is the neopixel slot.
I tried taking 5v from a fan spot, bl touch and direct from the 5v psu.
That's kinda strange... Are you sure your connections (crimps, cables) are ok? I had such erratic problems only with bad crimps.
 
Mine is on PB6. It just worked. 🤷‍♂️ GND & 5V also from the two adjacent pins there. I use BTF Lighting WS2812B strips for the case lights on that port. It's on a 250 Trident, so maybe wire length? I've seen some people with issues on 300 & 350 that I haven't seen.
Maybe that’s it. I’m using disco on a stick instead of 2812 strips and my wire runs are pretty long up the corner pillar
 
Loving this plug-in but have recently run into an issue after adding the Rainbow Barf module which increases my index to 52 LEDS. The Rainbow Barf and the two nozzle LEDs are at the end of the chain. When I run a simply set_led command i get this error:

Error on 'set_led led=sb_leds red=1 green=1 blue=1 white=1 index=52 transmit=1': INDEX must have maximum of 45

There's no mention of a maximum length in Klipper manuals? Any thoughts?
 
Loving this plug-in but have recently run into an issue after adding the Rainbow Barf module which increases my index to 52 LEDS. The Rainbow Barf and the two nozzle LEDs are at the end of the chain. When I run a simply set_led command i get this error:

Error on 'set_led led=sb_leds red=1 green=1 blue=1 white=1 index=52 transmit=1': INDEX must have maximum of 45

There's no mention of a maximum length in Klipper manuals? Any thoughts?

In your neopixel chain definition, there is a `chain_count` where you can set it to 52:

Code:
[neopixel sb_leds]
pin: PD3
chain_count: 3    // This is what you would increase if you are adding more LEDs in the same wiring chain as your `sb_leds`
color_order: GRB

Post your relevant code blocks here and we can get more eyes on it.
 
Is there a way to have an affect that works on the max value of two heaters?
The heater effect is tied to single specific heater, though you could create a separate macros for each heater, both with 'add' effect, and call them together when needed. The 'add' effect will work with existing Neopixel RGB values, but too much and they'll just go white.

For example:

[led_effect heater_effect_1]
frame_rate: 24
leds:
neopixel: some_neopixel
heater: heater_bed
layers:
temperature 20 60 add (0, 0, 0.3)

[led_effect heater_effect_2]
frame_rate: 24
leds:
neopixel: some_neopixel
heater: extruder
layers:
temperature 20 250 add (0.3, 0, 0)

And call both [heater_effect_1] and [heater_effect_2] in your macro. Just theoretical. I have not tested this lol.
 
Add this line to your effect definition:

endstops: x, y, z

You can also use probe in place of Z, but on my machine (I have Tap) it only reacts with z.
It's in the docs, but within the Additional effect level parameters section. I've already hit him up on moving that to the homing section--I missed it too.
 
Can anyone post the config that uses "homing" effect? I can't figure out what parameters it needs

This is pulled directly from my Micron, where all my defined neopixels flash on endstop triggers or probing. Autostart is set to true to start at boot.

Code:
[led_effect probe_flash]
autostart:              true
frame_rate:             24
leds:
    neopixel:front_button_led
    neopixel:neopixel_sticks
    neopixel:neopixel_dragonburner
endstops:
    x, y, z, probe
layers:
    homing        2.5    0    add      (0.3, 0.3, 0.4, 0.3)
 
This is pulled directly from my Micron, where all my defined neopixels flash on endstop triggers or probing. Autostart is set to true to start at boot.

Code:
[led_effect probe_flash]
autostart:              true
frame_rate:             24
leds:
    neopixel:front_button_led
    neopixel:neopixel_sticks
    neopixel:neopixel_dragonburner
endstops:
    x, y, z, probe
layers:
    homing        2.5    0    add      (0.3, 0.3, 0.4, 0.3)
I get an error with this code :( 2023-05-27 15_24_01-ERROR – Mozilla Firefox.png
 
Klipper LED effect

This is the thread for the Klipper Plugin to run RGB effects on neopixels & co from within Klipper
Check it out here.

hockey afford GIF


Latest release:
Pre-Release v0.0.10

Highlights:
Effects can now be stopped more easily
Effects can now replace effects runnning on the same LEDs
New Effect: Homing (triggers on endstops and probe)

Happy RGBing!
can you update the program to reflect the HD Barf leds? HD Barf has 25 neopixels
 
This is from my functioning config:
Code:
[led_effect logo_homing]
leds:
    neopixel:sb_leds (1-8)
autostart: false
frame_rate: 24
endstops: x, y, z
layers:
    breathing 8 0 add (0,0.6,0.2),(0,0.46,0.15)
    chase 0.25 0.25 add (0,0.6,0.2)
    homing 4 0 top (0.75,0.75,1.0)

This is my SB w/ Rainbow Barf definition:
Code:
[neopixel sb_leds]
pin: PB0
#chain_count: 3
chain_count: 10
color_order: GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRBW,  GRBW
initial_RED: 0.0
initial_GREEN: 0.0
initial_BLUE: 1.0
initial_WHITE: 0.0
# logo (Rainbow Barf PCB) = neopixel:sb_leds (1-8)
# nozzle = neopixel:sb_leds (9,10)
For the HD version, just adjust the chain_count, add the appropriate number of "RGB" items in the color_order, and update your led_effect leds call to the appropriate chunk of leds.
 
Looks like your definition for ‘bottom_leds’ has some syntax errors. Can you paste the relevant code blocks for the neopixel definition and your effect macro?
[neopixel bottom_leds]
pin: PB6
chain_count: 42
color_order: GRB
initial_RED: 0.0
initial_GREEN: 0.0
initial_BLUE: 0.0

[led_effect homing_probe]
autostart: true
frame_rate: 24
leds:
neopixel: bottom_leds
endstops:
x, y, z, probe
layers:
homing 2.5 0 add (0.3, 0.3, 0.4, 0.3)
 
Last edited:
Top