Unable to Print GCode files

Basic Information:

Printer Model: Prusa Mk3S+ Bear
MCU / Printerboard: Einsy Rambo boards - AVR atmega2560 V 1.1b
klippy-3.log (1.2 MB)

Describe your issue:

I’ll admit to being a new user of klipper. I have klipper installed, functioning and generally working well with my Prusa Mk3S+ printer. My issue seems to be my inability to get mainsail to tell klipper to execute the G-Code files I’ve saved to the Raspberry Pi in the correct ~/printer_data/gcodes directory. Mainsail states it’s unable to load the file. I’ve looked at both my mainsail.cfg and printer.cfg files and feel I have SDCard Path correctly set to "Path: ~/printer_data/gcodes. I even checked the user file permissions on the directory which appear correct.

I may easily be posting this message in the wrong location, for that in advance I’m sorry. Appreciate any constructive feedback in this regard. I’ve searched the internet and found it appears to be mainsail/klipper configuration issues only I’m not yet able to fix this. Have spent the last 3 days searching for answers. Feedback/assistance greatly appreciated.


Hello @TDactyl !

I’m not familiar with Mainsail, but you usually do not upload a file directly to a folder.

I assume it’s like OctoPrint: You drag and drop the file onto the Mainsail GUI.

Or you use:


This is important that Mainsail can create some meta data. Whey you directly copy the file to the folder, Mainsail does not know it is there.

You also can upload a file directly from a slicer:

It seems you have a typo in the config:

path = ~/printer_datas/gcode
on_error_gcode = CANCEL_PRINT

printer_datas should read printer_data

The file uploads just fine to Mainsail (at least I can see it in the print dialogue box and used the “drag & drop” method to put it there. I’m guessing perhaps I need to recompile Klipper or mainsail or something, since as noted below I can find NO reference to the incorrect printer_datas/gcodes although do find it in the klippy log file… not sure if the top of the file is most recent or bottom of the file, however in either case I still am unable to get it to register.

Moonraker notes it is expecting a different path… only it’s configuration doesn’t seem to have any path information (may easily be me not understanding the configuration file and how to read/interpret)

I agree klippy log file shows the incorrect path, however I’m not understanding where it is getting that path information from… when I look at my printer.cfg file the SDCard reference is different. Do you know if I need to re-compile klipper or something?
printer.cfg (17.8 KB)

Currently I assume if I reboot the pi it would restart both klipper and mainsail and use the saved configuration files…is this assumption correct?

The information you are showing are contradicting. From the top of your klippy.log:

Starting Klippy...
Args: ['/home/bappi/klipper/klippy/klippy.py', '/home/bappi/printer_data/config/printer.cfg', '-l', '/home/bappi/printer_data/logs/klippy.log', '-I', '/home/bappi/printer_data/comms/klippy.serial', '-a', '/home/bappi/printer_data/comms/klippy.sock']

This indicates that you are running Klipper under the user bappi.
As such the statement in your printer.cfg
path: ~/printer_data/gcodes
would expand to
path = /home/bappi/printer_data/gcodes.
Note that the ~ is just a shortcut to /home/<current user> in Linux

Your screenshot states that Klipper actually runs as user pi and has configured the path as:
path = /home/pi/printer_data/gcode_files
but Moonraker expects:
path = /home/pi/printer_data/gcode

Some pointers:

  • Clarify under which user you are actually running and make sure it is followed through everywhere. In doubt, start over and use KIAUH, which makes sure that the correct paths are used everywhere
  • Such a warning like in your screenshot also occurs if you modify [virtual_sdcard] path but do not restart Moonraker.
  • In a klippy.log always the end is the most recent entry.
  • The klippy.log is always right (simple truth in Klipper). It reflects the settings that Klipper got from the cfg files. If it is not what you expect, then you have to search for the issue in the configs / installation you are using
  • Also attach the file mainsail.cfg here, as it might contain conflicting information
  • The folder you are referencing must actually exist (it is not created automatically), otherwise such a message will be raised as well (of course exist under the correct user, whereas the user does not matter. pi is just the most common one, so often found in guides etc.)

Thanks, I agree and acknowledge your correctness on ~ just replacing the front portion of the path statement. I’ll make a backup copy of my printer.cfg file. I did use KIAUH to install moonraker/mainsail/klipper but perhaps messed something up along the way.

I didn’t know moon raker needed to be restarted… goes searching for how to do that… perhaps that is all my issue is.

My intent was for user pi, I’m not sure where the heck BAPI came from other than an error typing somewhere. Attached is my mainsail.cfg file

The folder does exist (~/Printer_data/gcode).

mainsail.cfg (11.5 KB)

Perhaps a dumb question, but can I just re-run the KIAUH installer (after downloading my printer.cfg file) and it will overwrite files or am I better to rm the entire directory and start over?

Ok, I have good news only this leads to more questions. I suspect I failed to restart MoonRaker after configuration file changes such that they could take effect. When I restarted moon raker and rebooted the RPi the MoonRaker error message cleared.

Now I still don’t know why klipper is looking in the root klipper folder for GCode_Files, but if I create it and copy gcode here it works and allows the printer to print… well almost I got a movement out of range I need to figure out but it’s a step in the correct direction. When I look at the Klippy.log file I see it pointing to NOT the directory I want it to, only unsure how or what files to edit to get Klipper to actually use my intended ~/Printer_Data/Gcodes … more reading tomorrow.

The other great news is now my RPi camera also works…

Still wondering if I can just re-run KIAUH file to have it re-install the configuration files and have it point to the correct directory I want it to use… anyone have feedback on this…

I know my RPi is currently suffering from the By-ID bug, however if I read the correct web forum, in theory I may have fixed this. I think this was the only other sorta challenge to get klipper running the first time.

Post a new klippy.log, please.

TBH, I’m not sure how KIAUH would handle this. There are multiple files involved, all across the Linux system, that contain path information. It requires some in-depth Linux knowledge to check and backtrack all of them.
The safest approach would be:

  1. Backup your printer.cfg
  2. Provision a new SD card with a fresh Linux
  3. Update Linux and potentially fix the systemd bug as per Debian Bullseye Bug causing Klipper to no longer find the printer board
  4. Create a new user that you want to use for Klipper or use the default one (recommended)
  5. Use KIAUH to install everything, under the user that you want
  6. Restore your printer.cfg


I hope you are aware that Linux is a case-sensitive operating system. So ~/Printer_Data/Gcodes and ~/printer_Data/gcodes are different paths

Edit 2:

path: ~/printer_data/gcodes
on_error_gcode: CANCEL_PRINT

Your mainsail.cfg also includes a [virtual_sdcard] section. Working with includes is nice to keep things tidy but poses a high risk of creating unwanted effects. Klipper will take the last statement that it processes, i.e. in the sequence as given in the printer.cfg