mtw3d / mtw_klipper_config

Klipper Configurations for MTW Printers
0 stars 1 forks source link

Were are the status LEDs getting their name #1

Open DrJeff opened 2 years ago

DrJeff commented 2 years ago
[gcode_macro LIGHTS]
gcode:
  {% set NAME = params.NAME|default(PrimaryLEDs)|string %}

I don't think my LEDs are getting a name I get an error in the console about no SET_LED

// Unknown command:"SET_LED"

where does the Name come from?

DrJeff commented 2 years ago

So I'm using MM3 but there are no references to the LED controller

mtw3d commented 2 years ago

Unfortunately Klipper is not compatible with the stock MM3 LEDs. You can replace them easily using standard NeoPixel LED strips using either the ws2812 (RGB) or the SK6812 (RGBW) controller. Our code is currently only written to support RGB controllers, but adapting it to RGBW would be pretty trivial. In the code below, for example, you would have to add a W variable, and set the appropriate value. Otherwise it would work as is.

Assuming you are using a SKR Mini E3 controller, these are plug and play with the controller and you can drive up to 8 LEDs natively, or add this adapter to drive up to 30 LEDs. Arbitrary lengths are also possible with an external power supply. You could also drive them from a Rambo, but I have never installed them on a RAMBo, so I can't give assembly details.

As for that macro, that doesn't seem to have been updated after a recent Klipper code change. What file is that from?

This is the LIGHTS macro from macros-led.cfg that has been updated to work with the new style:

[gcode_macro LIGHTS]
gcode:
  {% set NAME = params.NAME|default(PrimaryLEDs)|string %}
  {% set R = params.R|default(0)|int %}
  {% set G = params.G|default(0)|int %}
  {% set B = params.B|default(0)|int %}
  {% set I = params.I|default(0)|int %}
  {% set T = params.T|default(1)|int %}

    {% if I|int == 0 %}
    SET_LED LED={NAME} RED={R|float / 255} GREEN={G|float / 255} BLUE={B|float / 255} TRANSMIT={T}
    {% else %}
    SET_LED LED={NAME} RED={R|float / 255} GREEN={G|float / 255} BLUE={B|float / 255} INDEX={I} TRANSMIT={T}
    {% endif %}