No Description

Peter Sotnikov de394ef90f Always show heating 3 months ago
.gitignore 876699b26d fix: 3 months ago 92c30c89d2 Add service file, update README. 4 months ago de394ef90f Always show heating 3 months ago
ledstrip.service 37c0779dba uni config 3 months ago


This script will take the printer status from Klipper/Moonraker and apply different effects to a WS281x LED strip.

The code has been migrated from the OctoPrint-WS281x_LED_Status ( plugin to work with Klipper.

Directions for use

  1. Clone/copy code to file on Raspberry Pi running Klipper and Moonraker
  2. Make script executable
    1. chmod 744 ./
  3. Install prerequsits
    1. pip3 install requests rpi_ws281x adafruit-circuitpython-neopixel
  4. Change values in script (LED pin, colors, reverse)
  5. Optionally, change effect called for standby, paused, and error states
  6. Run script before starting print
    1. ./

Directions to run as a systemd service

  1. Copy contents of ledstrip.service to /etc/systemd/system/ledstrip.service
  2. Modify User, Group, WorkingDirectory, and ExecStart to match your setup
  3. Run systemctl daemon-reload to enable the service
  4. Run systemctl enable ledstrip to have the service start on boot

Single run for static colors

Will only work by itself, not if running as a service

./ <red> <green> <blue> <brightness:optiona>

  ./ 255 255 255 255 ## Full brightness white
  ./ 255 0 0 ## Red with default brightness specified in the script

To call from gcode shell commands (thanks to JV_JV for the setup directions)

Add custom entries to printer.cfg

[gcode_shell_command led_off]
command: ./home/pi/ 0 0 0
timeout: 2.
verbose: True

[gcode_shell_command led_white]
command: ./home/pi/ 255 255 255
timeout: 2.
verbose: True

[gcode_shell_command led_purple]
command: ./home/pi/ 255 0 255
timeout: 2.
verbose: True

[gcode_macro LED_OFF]

[gcode_macro LED_WHITE]

[gcode_macro LED_PURPLE]
    RUN_SHELL_COMMAND CMD=led_purple

rpi_ws281x library instructions for needed changes depending on GPIO pin used: