Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STATUS_LEDS not called when using neopixel_caselight_effects.cfg without status_leds*.cfg #537

Closed
1 task done
qratz opened this issue Mar 7, 2024 · 20 comments
Closed
1 task done
Labels
Not an issue This is not an issue question Further information is requested stale Issue that appear to be inactive, mark for potenial closing if stale for longer time

Comments

@qratz
Copy link

qratz commented Mar 7, 2024

Klippain branch

  • I confirm using the main branch

Version

v4.3

Describe the bug and expected behavior

when including neopixel_caselight_effects.cfg without any of the status_leds config files, caselight effects are not triggered in any of the macros, like START_PRINT, END_PRINT, etc.
The call to STATUS_LEDS in those scripts is only processed if variable_status_leds_enabled is set to True.
As a quick fix i replaced
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %}
with
{% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled or printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_enabled %}
in all those scripts.

Additional information and klippy.log

No response

@qratz qratz added bug Something isn't working triage This is a new issue to be sorted (automatic label) labels Mar 7, 2024
@Frix-x Frix-x added Not an issue This is not an issue and removed triage This is a new issue to be sorted (automatic label) labels Mar 7, 2024
@Frix-x
Copy link
Owner

Frix-x commented Mar 7, 2024

This is not a bug but "normal":

  • The goal of status leds is for some devices to show the printer status with colors. Usually on a Voron printer, it's some leds on the StealthBurner, but this can be anything else
  • The caselights leds are not using colors and so on to avoid a "Disco light show" and just illuminate the machine as standard lights should do

However, you are right, the caselight effects I don't know what they should do... But your fix would break the two previous point because standard caselights would also get the colors...

@Frix-x Frix-x added question Further information is requested and removed bug Something isn't working labels Mar 7, 2024
@EricZimmerman
Copy link
Contributor

Id think most peoples case lights are all white vs RGB?

@Benoitone
Copy link
Collaborator

Benoitone commented Mar 7, 2024

This is not a bug but "normal":

* The goal of status leds is for some devices to show the printer status with colors. Usually on a Voron printer, it's some leds on the StealthBurner, but this can be anything else

* The caselights leds are not using colors and so on to avoid a "Disco light show" and just illuminate the machine as standard lights should do

However, you are right, the caselight effects I don't know what they should do... But your fix would break the two previous point because standard caselights would also get the colors...

For me status_leds_enabled AND status_leds_caselight_enabled use RGB instead of light_enabled witch use white leds.
So I think @qratz is right and is fix can be a good one???
I think status_leds_caselight_enabled has been introduce to be able to control neopixel caselight and/or status_led in STATUS_LEDS macro.
For me it's a bug... and a PR for this can be a good one...
because if include in printer.cfg:
[include config/hardware/lights/neopixel_caselight.cfg]
or
[include config/hardware/lights/neopixel_caselight_effects.cfg]
without any
# [include config/hardware/lights/status_leds.cfg] # Standard StealthBurner style LEDs
# [include config/hardware/lights/status_leds_rainbow_barf.cfg] # Rainbow Barf StealthBurner style LEDs
# [include config/hardware/lights/status_leds_effects.cfg] # Standard StealthBurner style LEDs
# [include config/hardware/lights/status_leds_rainbow_barf_effects.cfg] # Rainbow Barf StealthBurner style LEDs
it doesn't work...

@qratz
Copy link
Author

qratz commented Mar 8, 2024

I was looking at this issue when switsching my V0.2 to klippain. It has the "Disco on a Matchstick"-PCB boards and a BARF-style board for the kirigami bed mount. To get the lights actually do something except lighting up, i applied that quick adjustment. I actually thought that the idea of caselight_effects was to actually use the effects, especially because of this section in status_leds.cfg:

    {% if printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_enabled%}
        {% if printer["gcode_macro _USER_VARIABLES"].status_leds_effects_enabled == False %}
            _SET_ALLLEDS_BY_NAME LEDS="caselight" COLOR={status_color[color].caselight} TRANSMIT=1
        {% else %}
            SET_LED_EFFECT EFFECT={"cl_" + status_color[color].caselight} REPLACE=1 FADETIME=0.5
        {% endif %}
    {% endif %}

So there is a call to set "cl_" effect, but it is basically only used once in startup.cfg to set the caselight effect to READY. That is why i thought there i was something missing there.

@Benoitone
Copy link
Collaborator

All the case light effect are based on this, like QGL, heating, pause, printing etc...

@Benoitone
Copy link
Collaborator

Maybe must add
variable_status_leds_enabled: True
In the case lights hardware config files?

@qratz
Copy link
Author

qratz commented Mar 8, 2024

Maybe must add variable_status_leds_enabled: True In the case lights hardware config files?

If you are not using actual status_leds, but only caselights, this leads to SET_LED_EFFECT calls to statuslights which are not defined.

@Benoitone
Copy link
Collaborator

so maybe add a new user_variable like variable_neopixel_leds_enabled = True in all lights using neopixel leds:
neopixel_caselight.cfg
neopixel_caselight_effects.cfg
status_leds.cfg
status_leds_effects.cfg
status_leds_rainbow_barf.cfg
status_leds_rainbow_barf_effects.cfg

and use neopixel_leds_enabled instead of status_leds_enabled in all macros?

@Benoitone
Copy link
Collaborator

#541

@Surion79
Copy link
Contributor

i have neo pixel sticks in my printer and only use them for white and off. how can this be achieved with this change? I don't need a fully colored printer for the whole print. i like it white for better timelapse videos

@EricZimmerman
Copy link
Contributor

Don't use the LED effects cfg?

@Surion79
Copy link
Contributor

i want to use it for toolhead but not for case light?

@Benoitone
Copy link
Collaborator

This PR is only for the issue happening when only one of the neopixel caselight is include in printer.cfg without any status_led

@Benoitone
Copy link
Collaborator

But if you only want white color for caselight neopixel you can include neopixel_caselight.cfg in your printer.cfg and override _LEDS_COLORS_DEFINITION macro

@teookie
Copy link

teookie commented Mar 16, 2024

I noticed this problem on a new printer with RGB caselights and no stealthburner LED's. Uncommenting neopixel_caselight in printer.cfg enables all the caselight effects, but they are never called by PRINT_START or other macro's because the macros all have IF statements that only trigger if "status_leds_enables" is true, but not "status_leds_caselights".

Seems like making the change below would be minimal impact but would fix the problem:

ADD TO MACROS:
{% set status_leds_caselights_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_enabled %}

ADD AN "OR" CONDITION TO STATUS LEDS CALLS IN MACROS:

{% if status_leds_enabled or status_leds_caselight_enabled %}
        STATUS_LEDS COLOR="BUSY"
    {% endif %}

(I should say I have no idea if the syntax for the "or" statement I'm proposing is correct or not, but I think you get the idea. :) )

Copy link

📌 This issue has been marked as stale because it has not had activity in the past 30 days.
To keep it open, please respond to this message or add new information. Otherwise, this will be closed in 14 days.
Thank you for your contributions!

@github-actions github-actions bot added the stale Issue that appear to be inactive, mark for potenial closing if stale for longer time label Apr 15, 2024
Copy link

This issue was closed due to inactivity for 14 days. Feel free to reopen it if you think it was an error or if you have new information or progress to share

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
@Frix-x Frix-x reopened this Apr 30, 2024
@github-actions github-actions bot removed the stale Issue that appear to be inactive, mark for potenial closing if stale for longer time label May 1, 2024
Copy link

github-actions bot commented Jun 1, 2024

📌 This issue has been marked as stale because it has not had activity in the past 30 days.
To keep it open, please respond to this message or add new information. Otherwise, this will be closed in 14 days.
Thank you for your contributions!

@github-actions github-actions bot added the stale Issue that appear to be inactive, mark for potenial closing if stale for longer time label Jun 1, 2024
Copy link

This issue was closed due to inactivity for 14 days. Feel free to reopen it if you think it was an error or if you have new information or progress to share

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 16, 2024
@Didier-T
Copy link

Bonjour,
je me permet de réouvrir le sujet car il me semble que mon souci y est lié.

Dans le cadre de ma configuration j'aimerai pouvoir utiliser le caselight sans led effect et le status led avec led effect, mais actuellement la variable d'activation du led effect est commune aux deux type d'éclairage.

La solution la plus simple serait de modifier deux fichier :

  1. "config/hardware/lights/neopixel_caselight_effects.cfg" ligne n°6

    • de variable_status_leds_effects_enabled=True
    • a variable_status_leds_effects_caselight_enabled=True
  2. "macros/hardware_functions/status_leds.cfg" ligne n°215

    • de {% if printer["gcode_macro _USER_VARIABLES"].status_leds_effects_enabled == False %}
    • a {% if printer["gcode_macro _USER_VARIABLES"].status_leds_effects_caselight_enabled== False %}

Par avance merci de prendre un peu de temps pour cette légère amélioration

@Didier-T Didier-T mentioned this issue Nov 20, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not an issue This is not an issue question Further information is requested stale Issue that appear to be inactive, mark for potenial closing if stale for longer time
Projects
None yet
Development

No branches or pull requests

7 participants