Configuring the strips
In this tutorial, we will guide you on how to create a separate configuration file (.cfg) in the Klipper Web interface to store LED effect configurations and code, and how to reference it in the main printer.cfg
file. This approach helps keep your configurations tidy and modular.
Create the Configuration File
Open the Klipper Web Interface Log in to your Klipper Web interface.
Find Config Files In the web interface, locate the “Config Files” option.
Create a New File Click on the “Create File” option, enter the filename, for example:
led_effects.cfg
, and save it.

Editing LED Effect Configuration
In your configuration file, each LED strip connected to an IO pin requires a unique definition. This includes specifying the data pin (and clock pin if needed) and the number of LEDs in the strip. Ensure that each strip is defined by its type first.
How to Differentiate WS2812、SK6812 and APA102 LEDs by Appearance
WS2812 : Have 4 pins;
SK6812 :Have 4 pins,Can see a separate white LED on the surface.
APA102: Have 6 pins; they typically contain a black component inside.
Most of the products available on the market are WS2812 and SK6812.
If you are still unsure, you can directly ask the seller to confirm the type of LED.

In the newly created led_effects.cfg
file, add configuration entries for each LED strip on your setup. The pin settings vary based on the type of LED strip you are using:
WS2812 (Neopixel LED Strips): Only the
data_pin
is needed, as these strips use a single-wire communication protocol and don’t require a clock signal. Color order: enter GRB.[neopixel name_lights] # hotend_rgb is the custom name for this LED strip pin: # Replace with the actual pin used for RGB LEDs chain_count: # Number of LEDs in the RGBW strip color_order: GRB # Color order for RGBW LEDs
SK6812 (Neopixel LED Strips): Only the
data_pin
is needed, as these strips use a single-wire communication protocol and don’t require a clock signal. Color order: enter GRBW.[neopixel name_lights] # hotend_rgb is the custom name for this LED strip pin: # Replace with the actual pin used for RGB LEDs chain_count: # Number of LEDs in the RGBW strip color_order: GRBW # Color order for RGBW LEDs
APA102 (Dotstar LED Strips): Both
clock_pin
anddata_pin
are required since these strips use the SPI communication protocol, with theclock_pin
aiding in stable data transmission:[dotstar name_lights] # bed_lights is the custom name for this LED strip data_pin: # Data pin connected to the MCU pin clock_pin: # Clock pin connected to the MCU pin (used only for LEDs requiring a clock signal, like APA102) chain_count: # Number of LEDs in the RGBW strip color_order: GRB # Color order for RGBW LEDs
Use this method to define all LED strips on your printer.
Modify the printer.cfg
File
printer.cfg
FileOpen the Main Configuration File In the Klipper Web interface, find and open the
printer.cfg
file.Reference the LED Effect Configuration At the very top of the
printer.cfg
file, add the following line to reference theled_effects.cfg
file you just created:[include led_effects.cfg]
Make sure to include the square brackets around the reference.

Restart Klipper
After completing the above steps, you need to restart Klipper for the new configuration to take effect. You can restart it through the control panel in the web interface.
Last updated