Converting to Dynamic Macros
Follow this tutorial to convert your standard gcode_macro
to a Dynamic Macro.
printer.cfg
First, remove the include
line in your printer.cfg
referencing the file your macros are in. For example, if your macros are in macros.cfg
, remove the line:
from your printer.cfg
.
Dynamic Macros Configuration
Next, if you don't already have one, create a [dynamicmacros]
config section in your printer.cfg
and add your macro configuration to it:
printer.cfg | |
---|---|
KlipperScreen
If you convert your LOAD_FILAMENT
and UNLOAD_FILAMENT
macros to be dynamic, KlipperScreen may not recognize them and report an error. To fix this, add blank macros to your printer.cfg
, before your [dynamicmacros]
section. Example:
Unknown config object 'gcode_macro'
If you are getting a "Unknown config object 'gcode_macro'" error after converting your macros to Dynamic Macros, move your [dynamicmacros]
section to be after your [virtual_sdcard]
section.
Fluidd
Fluidd may not display macros after install DynamicMacros. As a workaround, you can switch to Mainsail, or define a standard gcode_macro
, then override it in a dynamic macro. Example:
normal_macros.cfg | |
---|---|
Nacro Names
Klipper has certain macro names reserved for core functionality. If you are experiencing errors, don't name your Dynamic Macros any of the following:
PAUSE
RESUME
CANCEL_PRINT
If you want to make those macros dynamic, first define them as a standard GCode macro:
Restart Klipper.
That's it. Your macros are now Dynamic Macros.