Creating a Klipper image using OctoPi 1.1.0

I have been struggling to create a new OctoPrint image for what seems like an eternity, but is probably only two weeks. After finding out that they don't make microSD cards like they used to, I had trouble getting Klipper to work. With some help from the Klipper discourse group (https://klipper.discourse.group) I was able to resolve the issues that prevented Klipper from working.

The last time I created a OctoPrint image with Klipper was in 2020, starting with Octopi 0.17. I wrote a lot of notes so that if I needed to create another new image, I would have something to work with. This turned out to be both good and bad. Good in that it gave me some good starting points, bad in that there have been a lot of changes to Klipper.

When I followed my previous work flow, I ended up with an image where it appeared that Klipper was not working. Even worse, when I attempted to fix the problem the "fix" caused Python 2.7 to be installed, antithetical to the whole endeavor.

My new work flow is:

  1. Create the Octopi 1.1.0 image using the Raspberry Pi Imager
  2. Install KIAUH (Klipper Installation And Update Helper)
  3. Use KIAUH to install Klipper
  4. Install Samba to allow me to move files from my Mac to the Raspberry Pi image
  5. Copy my Klipper priner.cfg file to the /home/pi/printer_data/config directory
  6. Open OctoPrint on my browser and restore my backup.

Changes to Klipper that affected my installation:

  1. The location for the Klipper printer.cfg file has changed. The default location used to be in /home/pi, assuming you are using the pi account. The new location is /home/pi/printer_data/config. This makes a lot of sense, but if you put the printer.cfg in the old location then Klipper won't work. This needs to be changed in the OctoKlipper configuration.
  2. The serial port for the printer has changed from /tmp/printer to /home/pi/printer_data/comms/klippy.serial. If this is not correct, OctoPrint will not be able to use the printer. One minor sticking point is that I first tried ~/printer_data/comms/klippy.serial and OctoPrint did not allow me to use that. This needs to be changed in the OctoPrint and OctoKlipper configurations.
  3. The Klipper log file has changed from /tmp/klippy.log to /home/pi/printer_data/logs/klippy.log. If you don't change this you will get a warning about there not being a Klipper log file. This needs to be changed in the OctoKlipper configuration.
  4. The older versions of Klipper stored the Klipper service definition file in /etc/init.d, the newer versions of Klipper store the service definition in /etc/systemd/system.
  5. Do not use ~/klipper/scripts/install-octopi.sh. The script was written over four years ago and will install Python 2.7. It also does not include the changes to the file locations noted above and uses the older init.d method.