Standard printer.cfg format and information

I’ve been thinking about asking this question for a while and it keeps popping up as something to ask every time I look at somebody’s printer.cfg file or when configuration errors pop up here. A couple of things that would be nice would be a standard set of printer specifications that encompasses the latest recommendations and Klipper updates as well as a set of includable definition files for controller boards.

The need for a standard standard set of printer specifications came from the discussion in Unhandled exception during run, while printing from Sd LCD MENU thread and the recommendation that the “virtual_sdcard” specification is recommended to look like:

[virtual_sdcard]
path: ~/gcode_files
on_error_gcode = 
	CANCEL_PRINT

As for the controller board I would think that having a standard pin and device specification for a controller would be nice to simplify the work of setting up a new printer and reducing the chance for errors. I know this is somewhat problematic because of the various stepper driver chips that controller boards can be set up with along with the differences in pulleys, leadscrews, Z Axis sensor types, displays, etc. Still, it would be nice to have a common repository so that people can put in their definition for a controller board that other people can use as a reference.

I don’t really feel qualified to propose a standard format for the printer.cfg file and I would like to understand issues that other people have with the concept.

Take a look in the example_config directory (~/klipper/config), it contains config files for most popular printers and controller boards. I don’t know that they are standardised as such, however they do provide a great starting point

1 Like

Thank you - I didn’t know it was there (along with the “docs” folder). Quite complete from what I can see.

I’ve been finding board printer.cfg files on GitHub.

That’s basically what I’m looking for along with guidelines as to how to modify them in a standard way - there additional commands to add like the virtual_sdcard example above as well as what to do for different driver chips.

Thanx again!

1 Like

As mentioned, the main Klipper repo has a number of example config files. In general, they try to follow the guidelines at: Example configurations - Klipper documentation

There has also been discussions on the past about changing the layout of these example configs: Reworking example config files to have pin aliases at top of file

Finally, note that we’ll probably add a default for the virtual_sdcard on_error_gcode parameter after the v0.11.0 release.

-Kevin

Hi Kevin,

Thank you for the pointers. I keep forgetting about the depth of documentation Klipper has.

One of the things I thought would be useful would be pin aliases for the different boards but I’m not sure how to propose that as it becomes problematic when you’re working with toolhead running Klipper and you have printers which, for one reason or another, don’t use the predefined IO pins/functions for the “standard” due to other concerns. I can see that was discussed (with similar concerns).