This E-Stop code I pasted into the printer.cfg file is getting errors when I hit SAVE & RESTART.

I edited and trimmed the code down to this:

[gcode_button e-stop]

pin: rpi:gpio26

press_gcode:
{% do call_method("printer.emergency_stop") %}

release_gcode:
{% if event.elapsed_time > 1.0 %}
{% do call_method("machine.reboot") %}
{% endif %}


Resulting error:

Error loading template 'gcode_button e-stop:press_gcode':
jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'do'.
Was this page helpful?