File contains no section headers. file: '/home/user/printer_data/config/printer.cfg', line: 2 'x_count = 5\n'

Basic Information:

Printer Model: Artillery Sidewinder X2
MCU / Printerboard: STM32F401

klippy.log

Describe your issue:

Hi there,

it´s my first time installing Klipper and I used this video https://www.youtube.com/watch?v=7iQK6uSapJ0&ab_channel=EtherealProject3D

I followed the video step by step withput any problems, but after I edited the printer.cfg with my mcu I get this error in den mainsail interface:

Klipper reports: ERROR

File contains no section headers.
file: ‘/home/user/printer_data/config/printer.cfg’, line: 2
‘x_count = 5\n’

Once the underlying issue is corrected, use the “RESTART”
command to reload the config and restart the host software.
Printer is halted

I have only rudimental Linux knowledge and I just don´t where the problem might be.

I really hope that you can help me. The other knowledge base posts about the section header issues where not the same as mine, atleast I think so.

klippy (2).log (7.3 KB)

Your printer.cfg is basically empty, doesn’t specify the path to the mainboard, and the \n usually points to corruption or wrong encoding, i.e. due to using an incompatible text editor, or copy/pasting from a document with the wrong encoding.

Post your printer.cfg

printer.cfg (6.7 KB)

Sorry, I were only allowed to post 2 links max in my description. So this is the printer.cfg from the video above. Im not at home right now, so this one is without my own mcu, but at home I copied it at the right line.

I used notepad++ to edit the printer.cfg, although the edit was only adding my mcu in the right line.

It looks like the SAVE_CONFIG section is corrupted; it has config settings with no section header. It seems like this was probably a bed mesh that someone tried to remove but left some of the lines behind. You should probably just delete the entire section.

Thx, when I come home later I will try that out. Since I have no clue of coding and programming I was really adraid of deleting something since it clearly says to not removing anything beneath that line.

Actually, there are two issues:

Delete exactly the red marked block.

And then you have not fully configured your printer:

[mcu]
serial:  /dev/serial/by-id/

You have not entered a valid serial. See Installation - Klipper documentation

Thank you very much, will try that out. Yeah like I said, right now I´m not at home, this is the “blank” version from the video. At home I added my own mcu :slight_smile:

But I would like to know, what does this part says and why do I have to delete it? Just curious.

This relates to a bed mesh. It makes no sense to have it in an example config anyway, as it is unique to each bed.
Furthermore, it is only a fragment / incomplete and that’s why your Klipper is not starting.

THANK YOU VERY MUCH! You are a real life saver. Now it works and also the suggested functioning tests were all positive!