[FR] Multiple Config File support

Hi all,

so giving the fact that there is a big difference between the printer config (rotations, steps, sensors, pid etc…) and the board config (pins) i thoght why not enabling klipper users to load 2 or more config files when every new config will overwrite (or populate) the configuration.

that way we can have a printer config file for ender 3 with all printer specific settings and a seperate board file for SKR mini, Creality v4.2.7, RAMBo etc with board specific settings.

this may allow easier migration between boards and wider adoption for new printers and boards.

i looked at the code and it seems a bit tricky for me given all the autosave config and wrappers in use.

i can try and code it but i need help understanding all of the configuration loading process.


You can already include as many config files as you like. Isn’t that already solving this issue? My printer.cfg includes the config file for my printer from the klipper config directory in the first line, then I can add and override as many settings as necessary.

I would use [board_pins] like for example for 8 bit Meaa boards and there you go…

[board_pins arduino-mega]
    ar16=PH1, ar17=PH0,ar48=PL1, .....

step_pin: ar17
dir_pin: !ar16
enable_pin: !ar48

Instead of ar0, ar17 … write STEP_X, DIR_X, ENABLE_X
it’s up to you.
Save the [board_pins] setting in a separate cfg file and use [include] to load it into the configuration.


Well that’s kinda awkward…
So I guess the only FR would be to separate configurations in the repo so people could get an easy start with upgraded boards printers…

That would be a merge what will be accepted?