#Parsing Error

1 messages · Page 1 of 1 (latest)

edgy anvil
#

Hello, everyone
I'm new here in the channel.
My printer is a FLSUN Q5 with clipper and mainsail.
Now I have a problem that I can't solve.
As soon as I create my own G code with IF and else conditions, I get an error message. Unfortunately, I can't find anything in the documentation for Klipper and Mainsail.
The error is:
File contains parsing errors: /home/mks/klipper_config/mainsail.cfg
[line 137]: " {% if printer.homed_axes != 'XYZ' %}\n"
[line 138]: '\t\tG28\t\t\t\n'
[line 139]: '\t{% endif %}'

This is my code in the Mainsail.cfg file.

[gcode_macro Test]
{% if printer.homed_axes != 'XYZ' %}
G28 #Home All Axes
{% endif %}

The code is kept very simple because I want to understand the problem of if and else what I'm doing wrong here. Thank you once again for your help.
Greetings Black

abstract pewter
#

pls upload your klipper log and your full config file

sullen night
#

You missed a very important keyword …

[gcode_macro Test]
goode:
    {% if printer.homed_axes != 'XYZ' %}
        G28            #Home All Axes
    {% endif %}```
#

It’s the word gcode: without that Klipper does not register everything below as macro code

edgy anvil
#

thanks a lot. without the marker gcode: i have the erros, with the marker all is good.

sullen night