How To: Install Klipper on a CR-30

Wading through Klipper docs or trying to get answers from the Klipper community can take a long time, so here’s a quick guide to getting Klipper up and running on your CR-30.

Note that my setup (printer.cfg) remaps the fans for silent running when not printing (see Silent fans on CR 30 while idle (github.com))

Before you get started, you should understand that Klipper splits the classic “firmware” that runs on your control board into two parts. One is a very small mcu firmware that actually runs on your control board, and the other is klippy which is a python program running on a computer (usually a PI) connected to the the control board. klippy connects to the “real” serial port and creates a “fake” serial port (/tmp/printer) that your spooler (like OctoPrint) connects to.

For this example, I will use a Raspberry PI. You will have to adapt the instructions if you use something else.

In the root of the home directory of the pi user, clone the Klipper repo:

git clone https://github.com/KevinOConnor/klipper

You will need the mcu config file in a later step and it’s best to fetch it now:

curl https://static.grid.space/tmp/cr30-klipper/printer.cfg > printer.cfg

Then change directories to the Klipper scripts directory and run a script to install dependencies necessary to build the mcu firmware. I do not recommend using other people’s binaries since the protocol between mcu and klippy changes from time to time and would invalidate later steps.

cd klipper
./scripts/install-octopi.sh

Once that is done, you will need a valid .config file to build the mcu binary. Fetch the following config file:

curl https://static.grid.space/tmp/cr30-klipper/config > .config

This will create the .config file and you can now run:

make

When that completes, the mcu binary will be in out/klipper.bin

Copy that file to an SD card and rename to something like firmware-klipper-yymmdd.bin – typically this is done from your desktop using a command like

scp pi@<pi-ip-address>:klipper/out/klipper.bin <path-to-local-SD-card>/firmware-unique-name.bin

Place the SD card into the CR-30’s SD slot and turn it off (wait 5 seconds) and back on.

The LCD screen will be blank until the python klippy program on the PI starts taking to the mcu. This is normal.

On the PI, run:

sudo service klipper restart

And the LCD should come alive. At this point, klippy is running and OctoPrint can connect to /tmp/printer. You will also have a log file /tmp/klippy.log that you can tail to see what Klipper is up to.

If something is amiss, this log file will tell you why.

3 Likes

hi i ve done everything as mentioned but the screen from the printer is still blank

this means the klippy service can’t talk to the serial port. so either the board wasn’t flashed correctly, or something like octoprint is holding the serial port so the service can’t talk to it.

Your printer.cfg has some old syntax in it thats depreciated now and needs to be updated. All of the “default_parameter_x , default_parameter_y, default_parameter_e” values in the pause and resume macros need to be pushed into the gcode section: eg " {% set E = params.E|default(1) %}"

Have you got a working config that you can share? The printers I have running Klipper haven’t been updated in 6 months (because they just work), so I’d like to be able to provide an updated file without going through the update on the printers.

I’m still mucking through it. I was able to suppress the errors and boot but I’ve been trying to figure out settings for my mods. At the moment I’m getting a halt after the initial purge line runs, I believe because the printer thinks its being told to move out of bounds. As soon as I have a working config I’ll post it with comments for my particular machine modifications.

Thanks for the pointers! I am actually trying to drive the printer from the Creality Sonic Pad. Does this setup work through that device as well? Just got the pad yesterday and have it running my V1 Pro already. It allows a lot of tuning and the print mill could really use that, as quality is not what one would hope.

Never heard of it til you brought it to my attention. As long as it’s normal Klipper under the hood and you can access the full klipper config, it should work just fine with the right setup. The stock CR-30 Marlin leaves a lot to be desired.

Thanks, and thanks for the quick reply. I have requested a setup from Creality, but will follow your instructions and see what happens.

Whelp, still at it. Do you happen to have just the file for the machine, or does that depend on the klippy version? Still trying to get it running from the sonic pad.

Following your instructions, ran install-octopi… it ran the apt-update portion and errored
E: Repository ‘Index of /debian buster InRelease’ changed its ‘Suite’ value from ‘testing’ to ‘oldstable’
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.

sudo apt-get update --allow-releaseinfo-change

Ran make
make: arm-none-eabi-gcc: Command not found
make: *** [Makefile:64: out/src/sched.o] Error 127
Tried and failed with
sudo apt-get install build-essential
Tried again with
sudo apt-get install gcc-arm-none-eabi
*** LONG INSTALL***

Ran make again, got to Linking out/klipper.elf
then errors

/src/i2ccmds.c:111: undefined reference to `i2c_software_write’
collect2: error: ld returned 1 exit status
make: *** [Makefile:72: out/klipper.elf] Error 1

No mcu binary. Sadness. Hope others are more successful.

I have not tracked Klipper development for over a year. You always had to build the binary to match the user-space library. It is a limitation of a fast-moving project like that.

1 Like