klipper icon indicating copy to clipboard operation
klipper copied to clipboard

Reposting Temperature Reactive LED

Open WarriorClub opened this issue 6 years ago • 9 comments

I am trying now to include the temperature reactive LED's to printer config. I have added a separate LED config file [tempreactLED.cfg]" to the config and included the codes from Mental on "tempreactLED.cfg". It says the tempreactLED.cfg is not valid. Not sure why it is not working.

klippy.log

I hope this is the right way to attach the log. Could not find clearer instructions on how to.

WarriorClub avatar Oct 24 '20 15:10 WarriorClub

MissingSectionHeaderError: File contains no section headers.
file: /home/pi/tempreactLED.cfg, line: 2
'M105.1\n'
File contains no section headers.
file: /home/pi/tempreactLED.cfg, line: 2

theopensourcerer avatar Oct 24 '20 15:10 theopensourcerer

S

MissingSectionHeaderError: File contains no section headers.
file: /home/pi/tempreactLED.cfg, line: 2
'M105.1\n'
File contains no section headers.
file: /home/pi/tempreactLED.cfg, line: 2

Sorry. I am still new to all this. What is a section header?

WarriorClub avatar Oct 24 '20 15:10 WarriorClub

It's the bit in the square brackets, e.g:

[printer] or [neopixel my_neopixel].

Try posting the contents of your tempreactLED.cfg file. because klipper can't read it none of your config is shown in the log (which it normally would be) ;-)

theopensourcerer avatar Oct 24 '20 15:10 theopensourcerer

Sorry, for some reason it would not allow for cfg file so I changed it with log as extension. Here is my tempreactLED tempreactLED.log

WarriorClub avatar Oct 24 '20 15:10 WarriorClub

I'm not familiar with what you are trying to achieve but the first section header doesn't look correct to me. Just "[macro]" is not valid I believe... See the examples for gcode macros:

https://github.com/KevinOConnor/klipper/blob/master/config/example-extras.cfg#L396

theopensourcerer avatar Oct 24 '20 15:10 theopensourcerer

I am just trying to get the LEDs to change colour depending on the temperature of the nozzle. I got this code from Mentals https://klipper.info/macro-examples-1/mentals-temperature-reactive-leds. I will have to take a closer look at the appropriate section headers for this but for now here the full log.

klippy.log

WarriorClub avatar Oct 24 '20 15:10 WarriorClub

Just delete the first three lines of your file. The author was explaining what the output will be, not that you were supposed to copy that part. Your file should look like this I believe:

[neopixel temp_leds]
pin:                                P1.18 
chain_count:                        1

[gcode_macro M105]
rename_existing:            M105.1
gcode:  

   M105.1

   #if the extruder is off
   {% if printer.extruder.target == 0 %}

      #Set the LED to red if the extruder is off but is still hot, otherwise 
      # set the color to green
      {% if printer.extruder.temperature > 60.0 %}
         SET_LED LED=temp_leds RED=1 GREEN=0 BLUE=0 INDEX=0  TRANSMIT=1
      {% else %}
         SET_LED LED=temp_leds RED=0 GREEN=1 BLUE=0 INDEX=0  TRANSMIT=1
      {% endif %}     

   {% else %}

         #if the extruder temp is at target temperature 
         {% if printer.extruder.temperature >= printer.extruder.target - 4.0 %}
            SET_LED LED=temp_leds RED=1 GREEN=0 BLUE=0 INDEX=0  TRANSMIT=1

         #if the extruder is still heating
         {% else %}
            {% set scaler = printer.extruder.temperature|float / printer.extruder.target|float %}
            SET_LED LED=temp_leds RED={ scaler|float * 1 } GREEN=0 BLUE=0 INDEX=0  TRANSMIT=1
         {% endif %}  

   {% endif %}

theopensourcerer avatar Oct 24 '20 16:10 theopensourcerer

Thank you. I omitted those lines but still no luck. Not sure what the pin: 1.18 is.

klippy.log

WarriorClub avatar Oct 24 '20 21:10 WarriorClub

Hello,

It looks like there hasn't been any recent updates on this Klipper github issue. If you created this issue and no longer consider it open, then please login to github and close the issue. Otherwise, if there is no further activity on this thread then it will be automatically closed in a few days.

Best regards,

~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

github-actions[bot] avatar Nov 15 '20 00:11 github-actions[bot]