How downgrade Klipper version?

Basic Information:

Printer Model: ratrig VCore 3
MCU / Printerboard: Octopus Pro
Host / SBC rPi 4
klippy.log

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

Errors and log posted in other message.

Since I suspect the latest update is what’s causing me the problems… I want to install an older version of Klipper. Hacer un Downgrade. But I can’t find any information on how to do it. Does anyone know of any resources for making a Downgrade klipper

If you did use KIAUH for upgrade, then use KIAUH for rollback, there is a “Advanced”->“Rollback” command in KIAUH menu.

If you upgraded Klipper manually by pooling new code from Git
usually it’s done by this command

git pull

then you need to use Git to checkout your previous version(Revision).

It’s often not an easy task with possibility to get unsuccessful results, so official guide is not covering it, but I will put here some basic instructions - maybe somebody will need it.

To understand what version did you use previously - you need to analyze klippy.log file, it’s logging this info on each Klipper startup

Sample from your log in last startup

Starting Klippy…
Args: [‘/home/pi/klipper/klippy/klippy.py’, ‘/home/pi/printer_data/config/printer.cfg’, ‘-I’, ‘/home/pi/printer_data/comms/klippy.serial’, ‘-l’, ‘/home/pi/printer_data/logs/klippy.log’, ‘-a’, ‘/home/pi/printer_data/comms/klippy.sock’]
Git version: ‘v0.12.0-171-g2f6e94c9-dirty’
Untracked files: klippy/extras/beacon.py
Branch: master
Remote: origin
Tracked URL: https:// github . com/Klipper3d/klipper

From this we know that last time you was using main klipper repository (Tracked URL), you have version v0.12.0, revision sequence number 171 and git revision 2f6e94c9 and you have some custom changes in klipper files.
This info is derived from your latest “Git version” in log file

To confirm that your actual version is same as in log file you can go to klipper folder and execute command

cd ~/klipper
git describe --always --tags --long --dirty

This command will display same version (or some other version if your log is outdated), but this command is reflecting your real current version.

Ok, now you know which version do you have, you need to find your previous version which was working - to find it you need to look thru klippy.log files and find last successful session and extract from there your previous Git version.
in your log it was

Git version: ‘v0.12.0-159-g2425a746-dirty’

from this line we extract git revision, it was 2425a746
and it was 159 revision number, so you pooled 12 new changes (171-159).

You can use this info and analyze what was introduced between those versions by looking at Commits · Klipper3d/klipper · GitHub and analyze what was changed and does it have some relation to your troubles, often it’s just a documentation changes or some unrelated changes to experienced issue.

Downgrading version:
Now when you collected required info, you can try to go back, but before that make a full backup copy of klipper folder to other place, if something will go wrong - you will have a backup.

First you need to stop klipper

sudo service klipper stop

In most cases when klipper files don’t have any changes (dirty flag is not present in git version) it’s enough to execute single command for downgrade but it will erase all changes and restore requested vanilla version.

command for restoring your revision - it will erase all customizations in klipper files!

git reset --hard 2425a746

In your case you have dirty flag - this mean that your klipper have some custom changes, to analyze them you can execute

git diff

it will show all changes which was introduced, you should save it’s output to separate location for possible future use.

you still can try to do a “Soft” downgrade by executing following command

git reset --soft 2425a746

This command will try to return requested version and preserve your customizations (if it’s possible) but if it will fail - your last option is to use first approach which will erase customization and restore vanilla version and after that manually restore your customizations by following git diff output saved previously.

If something goes very wrong - you can remove klipper folder and restore it from saved backup copy.

When you did finish with downgrade, check your current version again

cd ~/klipper
git describe --always --tags --long --dirty

If everything is fine, you need to start klipper

sudo service klipper start

Then test your downgraded version and keep your backup copy of a klipper for some time.

P.S.
Sometimes your MCU firmware was kept un-updated for long time and you was using old MCU firmware build and fresh klipper build.
And now after you did upgrade your MCU firmware you want to go back to old MCU firmware.
For this kind of MCU firmware downgrade - you need to find previous MCU git version which is always recorded in log (example: Loaded MCU 'EBBCan' 106 commands (v0.12.0-85-gd785b396 ..... )

Then downgrade klipper to MCU git version, usually firmware don’t have customizations - so it’s easy to downgrade, then build firmware and flash it with downgraded version.

When MCU downgrade is done you can restore klipper to current state from backup and do another downgrade just for klipper host to desired version.
Steps and command are the same but you will have 2 downgrades to fully restore desired versions in MCU and Host

4 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.