Umsetzungs-Idee gesucht...

Ich habe ja eine Funktion eingebaut, dass der Raspbi und der Drucker aus gehen, sobald ein Druck nachts fertig wird und ich nicht selber ausschalten kann. Ausgelöst wird der Shutdown über das END_PRINT Makro, wo ich am Ende das
[gcode_macro POWER_OFF_PRINTER]
gcode:
RESPOND MSG="Waiting for cooling down to shut off."
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM=50
G4 P6000
host_shutdown # Calls safe shut down of Raspbi
tasmota_off # Calls Shell command to switch off Tasmota
[gcode_macro POWER_OFF_PRINTER]
gcode:
RESPOND MSG="Waiting for cooling down to shut off."
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM=50
G4 P6000
host_shutdown # Calls safe shut down of Raspbi
tasmota_off # Calls Shell command to switch off Tasmota
ausgelöst wird. Das würde ich nun gerne erweitern mit einer Funktion, die es mir erlaubt das
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM=50
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM=50
oder
G4 P6000
G4 P6000
abzubrechen, ohne dass ich Klipper neu starten muss. Verschiedene Ideen gehen mir da gerade durch den Kopf. Die einfachste Lösung wäre, in der printer.cfg zwei unterschiedliche END_PRINT Makros liegen habe und dann über den Slicer dann schon beim starten des Drucks zu bestimmen was am Ende passieren soll. Naja... Einfach wäre das. ...aber gibt es eine elegantere Lösung? Wie wäre es mit einem Pop-up in Mainsail während der 60 Sekunden Wartezeit, wo man mit OK/Cancel und einem Timeout den Shut-Down abbrechen kann, bzw. einfach laufen lassen kann. ...und da gehen mir gerade die Ideen aus.
51 Replies
Rigattoni
Rigattoni2y ago
Ja okay, das hatte ich auch schon gefunden, aber ich kriege da gerade keinen Kopf dran. Statt des G4 P6000 rufe ich dann ein
[delayed_gcode SHUT_DOWN]
initial_duration: 60.
gcode:
[delayed_gcode SHUT_DOWN]
initial_duration: 60.
gcode:
auf... Aber danach verlassen sie mich gerade. Irgendwie muss ich da dann einen Cancel rein bekommen, der praktisch das Abarbeiten des gcode abbricht, statt nach Ablauf einfach weiter geht...
flat-fuchsia
flat-fuchsia2y ago
[gcode_macro POWER_OFF_PRINTER]
gcode:
RESPOND MSG="Waiting for cooling down to shut off."
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=10

[delayed_gcode DELAYED_POWER_OFF_PRINTER]
initial_duration: 0.
gcode:
{% if printer.extruder.temperature > 50 %}
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=10
{% else %}
G4 P6000
host_shutdown # Calls safe shut down of Raspbi
tasmota_off # Calls Shell command to switch off Tasmota
{% endif %}
[gcode_macro POWER_OFF_PRINTER]
gcode:
RESPOND MSG="Waiting for cooling down to shut off."
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=10

[delayed_gcode DELAYED_POWER_OFF_PRINTER]
initial_duration: 0.
gcode:
{% if printer.extruder.temperature > 50 %}
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=10
{% else %}
G4 P6000
host_shutdown # Calls safe shut down of Raspbi
tasmota_off # Calls Shell command to switch off Tasmota
{% endif %}
abbrechen geht dann aber nur wären der Duration fase mit
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=0
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=0
mann könnte aber auch mit dem idle timeout arbeiten denn muss man halt dann länger setzen als die dein hotend zum auskühlen braucht.
Rigattoni
Rigattoni2y ago
@Raabi , Dann muss ich mir nur noch ein Makro erstellen, was dann das UPDATE_DELAYED_GCODE auf 0 setzt und das als Makro dann auf dem Interface sichtbar macht... Muss ich probieren, danke für den Tipp. Okay, habe das jetzt entsprechend umgesetzt und das passt. Dazu noch G4 auf 300000 gesetzt, damit timelaps auch fertig wird. Dazu natürlich ein Makro erstellt:
[gcode_macro StOP_POWER_OFF]
gcode:
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=0
[gcode_macro StOP_POWER_OFF]
gcode:
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=0
was nach dem berühmten "Done :-)" dann sichtbar ist und ich damit dann den ShutDown verhindern kann.
optimistic-gold
optimistic-gold2y ago
Ich kann das wählen auf der Web gui ob ich es einschalten oder ausschalten möchte die Funktion.. Kann auch während des Drucks gemacht werden.....
optimistic-gold
optimistic-gold2y ago
No description
Rigattoni
Rigattoni2y ago
@Callisto Kannst du mal bitte deine Makros dazu sharen? Wäre interessant, wo die Unterschiede liegen.
optimistic-gold
optimistic-gold2y ago
Kann ich morgen machen... Ist aber ein etwas komplizierteres. Und vom Strom wird das alles getrennt über eine Fritz Steckdose wenn die erkennt das die Wattzahl unter einem bestimmten Wert ist für paar Minuten. Das ist dann der Fall wenn alle Lüfter aus sind und der pi auch runter gefahren ist....
Rigattoni
Rigattoni2y ago
Das hier ist meine derzeitige Lösung, ich warte bis der Drucker abgekühlt ist:
#############################################################################################################
### PRINTER AND TASMOTA SHUT DOWN
### this macro allows you to turn off the printer
#############################################################################################################

[gcode_macro POWER_OFF_PRINTER_NOW]
gcode:
RESPOND MSG="Waiting for cooling down to shut off."
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM=50
G4 P6000
host_shutdown # Calls safe shut down of Raspbi
tasmota_off # Calls Shell command to switch off Tasmota

[gcode_macro POWER_OFF_PRINTER]
gcode:
RESPOND MSG="Waiting for cooling down to shut off."
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=10

[delayed_gcode DELAYED_POWER_OFF_PRINTER]
initial_duration: 0.
gcode:
{% if printer.extruder.temperature > 50 %}
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=10
{% else %}
G4 P300000
host_shutdown # Calls safe shut down of Raspbi
tasmota_off # Calls Shell command to switch off Tasmota
{% endif %}

[gcode_macro StOP_POWER_OFF]
gcode:
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=0


[gcode_shell_command host_shutdown]
command: poweroff
timeout: 3.
verbose: False

[gcode_macro HOST_SHUTDOWN]
gcode:
RUN_SHELL_COMMAND CMD=host_shutdown

#shell command to shutdown the tasmota
[gcode_shell_command tasmota_off]
command: curl "http://192.168.178.**/cm?user=*****&password=************&cmnd=Backlog%3BDelay%20300%3BPower%20OFF"
timeout: 2.
verbose: False

[gcode_macro TASMOTA_OFF]
gcode:
RUN_SHELL_COMMAND CMD=tasmota_off
#############################################################################################################
### PRINTER AND TASMOTA SHUT DOWN
### this macro allows you to turn off the printer
#############################################################################################################

[gcode_macro POWER_OFF_PRINTER_NOW]
gcode:
RESPOND MSG="Waiting for cooling down to shut off."
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM=50
G4 P6000
host_shutdown # Calls safe shut down of Raspbi
tasmota_off # Calls Shell command to switch off Tasmota

[gcode_macro POWER_OFF_PRINTER]
gcode:
RESPOND MSG="Waiting for cooling down to shut off."
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=10

[delayed_gcode DELAYED_POWER_OFF_PRINTER]
initial_duration: 0.
gcode:
{% if printer.extruder.temperature > 50 %}
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=10
{% else %}
G4 P300000
host_shutdown # Calls safe shut down of Raspbi
tasmota_off # Calls Shell command to switch off Tasmota
{% endif %}

[gcode_macro StOP_POWER_OFF]
gcode:
UPDATE_DELAYED_GCODE ID=DELAYED_POWER_OFF_PRINTER DURATION=0


[gcode_shell_command host_shutdown]
command: poweroff
timeout: 3.
verbose: False

[gcode_macro HOST_SHUTDOWN]
gcode:
RUN_SHELL_COMMAND CMD=host_shutdown

#shell command to shutdown the tasmota
[gcode_shell_command tasmota_off]
command: curl "http://192.168.178.**/cm?user=*****&password=************&cmnd=Backlog%3BDelay%20300%3BPower%20OFF"
timeout: 2.
verbose: False

[gcode_macro TASMOTA_OFF]
gcode:
RUN_SHELL_COMMAND CMD=tasmota_off
optimistic-gold
optimistic-gold2y ago
Hier mein Macro mit infos dazu ganz unten. Ich hab das in einen eigennen Macros Ordner gepackt undd mit include in der printer.cfg hinzugefügt.
[gcode_macro Motoren_aus]
gcode: M18


[gcode_macro SHUTDOWN]
variable_printer_active: 0
variable_wants_shutdown: 0
gcode:
{action_call_remote_method("shutdown_machine")}

[gcode_macro CONDITIONAL_SHUTDOWN]
gcode:
{% if printer["gcode_macro SHUTDOWN"].wants_shutdown == 1 %}
SHOW_MSG MSG="Conditional shutdown wants shutdown, waiting for cooling down then i will shutdown"
M140 S0 ; start heating the bed to what is set in Cura
M104 S0 T0 ; start heating T0 to what is set in Cura
TEMPERATURE_WAIT SENSOR="extruder" MAXIMUM=48
SHUTDOWN
{% endif %}

[gcode_macro Auto_Shutdown_Kontrolle] #[gcode_macro GET_COMPLETE_SHUTDOWN]
gcode:
{% set shutdown_wanted = printer["gcode_macro SHUTDOWN"].wants_shutdown %}
SHOW_MSG MSG="Cmpl shutd: {shutdown_wanted}"

[gcode_macro Auto_Shutdown] ##[gcode_macro SET_COMPLETE_SHUTDOWN]
gcode:
{% set wants_shutdown = params.ENABLE|default(1)|int %}
{% if wants_shutdown >= 1 %}
{% set wants_shutdown = 1 %}
SHOW_MSG MSG="print cmpl->shutdown"
{% else %}
SHOW_MSG MSG="print cmpl->stay on"
{% endif %}
SET_GCODE_VARIABLE MACRO=SHUTDOWN VARIABLE=wants_shutdown VALUE={wants_shutdown}

[gcode_macro SAFE_SHUTDOWN]
gcode:
{% if printer_active == 0 %}
SHOW_MSG MSG="Performing safe shutdown"
SHUTDOWN
{% else %}
SHOW_MSG MSG="Job is active. No shutdown!"
{% endif %}

[gcode_macro SHUTDOWN_HANDLER_START_PRINT]
gcode:
SET_GCODE_VARIABLE MACRO=SHUTDOWN VARIABLE=printer_active VALUE=1

[gcode_macro SHUTDOWN_HANDLER_STOP_PRINT]
gcode:
; This needs to be at the end of your stop_gcode!!!!!!!
SET_GCODE_VARIABLE MACRO=SHUTDOWN VARIABLE=printer_active VALUE=0
CONDITIONAL_SHUTDOWN

[gcode_macro SHUTDOWN_HANDLER_CANCEL_PRINT]
gcode:
SHUTDOWN_HANDLER_STOP_PRINT

[gcode_macro SHOW_MSG]
gcode:
{% set MSG = params.MSG|default("No msg")|string %}
M117 {MSG}
RESPOND MSG={'"%s"' % MSG}
[gcode_macro Motoren_aus]
gcode: M18


[gcode_macro SHUTDOWN]
variable_printer_active: 0
variable_wants_shutdown: 0
gcode:
{action_call_remote_method("shutdown_machine")}

[gcode_macro CONDITIONAL_SHUTDOWN]
gcode:
{% if printer["gcode_macro SHUTDOWN"].wants_shutdown == 1 %}
SHOW_MSG MSG="Conditional shutdown wants shutdown, waiting for cooling down then i will shutdown"
M140 S0 ; start heating the bed to what is set in Cura
M104 S0 T0 ; start heating T0 to what is set in Cura
TEMPERATURE_WAIT SENSOR="extruder" MAXIMUM=48
SHUTDOWN
{% endif %}

[gcode_macro Auto_Shutdown_Kontrolle] #[gcode_macro GET_COMPLETE_SHUTDOWN]
gcode:
{% set shutdown_wanted = printer["gcode_macro SHUTDOWN"].wants_shutdown %}
SHOW_MSG MSG="Cmpl shutd: {shutdown_wanted}"

[gcode_macro Auto_Shutdown] ##[gcode_macro SET_COMPLETE_SHUTDOWN]
gcode:
{% set wants_shutdown = params.ENABLE|default(1)|int %}
{% if wants_shutdown >= 1 %}
{% set wants_shutdown = 1 %}
SHOW_MSG MSG="print cmpl->shutdown"
{% else %}
SHOW_MSG MSG="print cmpl->stay on"
{% endif %}
SET_GCODE_VARIABLE MACRO=SHUTDOWN VARIABLE=wants_shutdown VALUE={wants_shutdown}

[gcode_macro SAFE_SHUTDOWN]
gcode:
{% if printer_active == 0 %}
SHOW_MSG MSG="Performing safe shutdown"
SHUTDOWN
{% else %}
SHOW_MSG MSG="Job is active. No shutdown!"
{% endif %}

[gcode_macro SHUTDOWN_HANDLER_START_PRINT]
gcode:
SET_GCODE_VARIABLE MACRO=SHUTDOWN VARIABLE=printer_active VALUE=1

[gcode_macro SHUTDOWN_HANDLER_STOP_PRINT]
gcode:
; This needs to be at the end of your stop_gcode!!!!!!!
SET_GCODE_VARIABLE MACRO=SHUTDOWN VARIABLE=printer_active VALUE=0
CONDITIONAL_SHUTDOWN

[gcode_macro SHUTDOWN_HANDLER_CANCEL_PRINT]
gcode:
SHUTDOWN_HANDLER_STOP_PRINT

[gcode_macro SHOW_MSG]
gcode:
{% set MSG = params.MSG|default("No msg")|string %}
M117 {MSG}
RESPOND MSG={'"%s"' % MSG}
#TODO: AUTO SHUTDOWN POSSIBLY NOT WORK ON ERRORS!

#place the file shutdown.cfg into you config dir
#include this on the top of your printer.cfg
# [include shutdown.cfg]

#Call this in your start_gcode:
# SHUTDOWN_HANDLER_START_PRINT

#Call this AT THE END OF YOUR stop_gcode:
# SHUTDOWN_HANDLER_STOP_PRINT

#Call this in your cancel_gcode:
# SHUTDOWN_HANDLER_CANCEL_PRINT

#if non exists you can allways set one:
#[gcode_macro CANCEL_PRINT]
#rename_existing: CANCEL_PRINT_BASE
#gcode:
# SHUTDOWN_HANDLER_CANCEL_PRINT
# CANCEL_PRINT_BASE
#TODO: AUTO SHUTDOWN POSSIBLY NOT WORK ON ERRORS!

#place the file shutdown.cfg into you config dir
#include this on the top of your printer.cfg
# [include shutdown.cfg]

#Call this in your start_gcode:
# SHUTDOWN_HANDLER_START_PRINT

#Call this AT THE END OF YOUR stop_gcode:
# SHUTDOWN_HANDLER_STOP_PRINT

#Call this in your cancel_gcode:
# SHUTDOWN_HANDLER_CANCEL_PRINT

#if non exists you can allways set one:
#[gcode_macro CANCEL_PRINT]
#rename_existing: CANCEL_PRINT_BASE
#gcode:
# SHUTDOWN_HANDLER_CANCEL_PRINT
# CANCEL_PRINT_BASE
Wie macht man diesen Rahmen um das Script?
flat-fuchsia
flat-fuchsia2y ago
mit ` 3 mal davor und 3 mal danach
Rigattoni
Rigattoni2y ago
@Callisto , ja danke für deine Lösung. Das sieht ganz gut und praktikabel aus. Da klau ich mir was raus... 😉
optimistic-gold
optimistic-gold2y ago
Mach das😉 👍
Bastii
Bastii2y ago
Wie schaltet ihr den Drucker dann wieder an? Immer über die Web Oberfläche des tasmota/shelly? Möchte das ganze nächste Woche neu machen und würde das gerne implementieren
optimistic-gold
optimistic-gold2y ago
Über mein Handy oder am PC....Mein Drucker ist an einer AVM FRITZ!DECT 200 eingesteckt.
No description
Want results from more Discord servers?
Add your server