Macros

This section describes how to add a START_PRINT and END_PRINT macro in Klipper which will replace the gcode that is usually set in your Slicer software. I see moving the Start/End Print gcode from the Slicer to Klipper as an advantage, as you can update the gcode in your printer.cfg in Klipper directly, instead of having to open your Slicer, change the settings and then re-slicing the file you want to print.

These steps are optional, you can leave Start/End gcode in your slicer and still be able to print a file successfully in Klipper. If you will not be doing these Macros, you can continue to the First Print section.

Start and End Print Macros
  • Adding [gcode_macro START_PRINT] and [gcodemacro END_PRINT] to your printer.cfg;

  • From the MainsailOS web interface, click Machine, then click on printer.cfg;

Machine > printer.cfg
  • Scroll down until you see the [pause_resume] section;

  • Copy all of the text from the Start_Print_and_End_Print.txt file above and paste it just after the [pause_resume] section in the printer.cfg file;

You can add this macro anywhere in the printer.cfg file, but to keep things clean I added it just above the existing macros already present in the printer.cfg file.

Start and End Print Macros
  • Click the Save & Restart button near the top right of the window;

    • This will save the printer.cfg file and and restart Klipper;

Last updated