Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to newer Klipper #158

Open
alegnn opened this issue Jun 7, 2024 · 17 comments
Open

Update to newer Klipper #158

alegnn opened this issue Jun 7, 2024 · 17 comments

Comments

@alegnn
Copy link

alegnn commented Jun 7, 2024

Hi !
Thanks again for your great work on this, I use it every day with my Ender 6 and I'd love for this project to remain active !
Would you be able to merge this with a more recent version of Klipper ?
Thanks a lot !

@xdadrm
Copy link

xdadrm commented Jul 24, 2024

@ale-chronics

@ale-chronics, you might find the attached bash script helpful. I've been using it for the past two years to keep my Klipper installation updated with the original Klipper while maintaining the Ender 6 patches from Desuuuu.

Just run the script in the directory where your ./klipper/ is located.
(Make sure you have a backup of your Klipper folder first.)

Also, remember that newer versions of Klipper may require updated firmware on the controller:
( cd klipper; make clean; make (might require make menuconfig, to update the .config file )

bash script :

#!/bin/bash
if [ ! -d klipper/.git ]; then
  git clone https://github.com/Klipper3d/klipper.git klipper
else
  echo "Klipper exists .."
fi

pushd klipper 


if ( git branch | grep desuuuu-ender6 -q ); then
  git switch desuuuu-ender6
else
  git branch desuuuu-ender6  
  git checkout desuuuu-ender6
fi

GIT_EDITOR=/bin/true git pull https://github.com/Klipper3d/klipper.git
GIT_EDITOR=/bin/true git pull -q -X ours --no-rebase https://github.com/Desuuuu/klipper.git

popd

@nipunarora8
Copy link

@xdadrm Will this work for CR10s pro. I have desuuuu's klipper installed on my board, rpi and the screen. Can you guide me how to update it?
Would be a great help as I am thinking to install eddy probe which is only supported with mainline klipper + I can keep my klipper updated.
Thanks

@zimmertr
Copy link

zimmertr commented Nov 23, 2024

I recently wrote this guide for installing upstream Klipper on an Ender 6. It just requires changing out the touchscreen: https://github.com/zimmertr/Ender-6-Klipper-Guide

@xdadrm
Copy link

xdadrm commented Nov 24, 2024

@xdadrm Will this work for CR10s pro. I have desuuuu's klipper installed on my board, rpi and the screen. Can you guide me how to update it? Would be a great help as I am thinking to install eddy probe which is only supported with mainline klipper + I can keep my klipper updated. Thanks

@nipunarora8 As I do not have a CR10, I'll not say "it works and here's how" ...hope the following still helps :

Klipper Software
All the script above does it transfer desuuuu's patches into upstream klipper and I use that rather regularly to upgrade my installation. So as long you can get your original klipper directory back, there is little you can break by just trying (a recent backup is always a good idea anyway).

Klipper Firmware on the MCU
Now that is a little trickier, if you're already on a 0.12 version (check klippy*logs for "Last MCU build version: v0.12.0"), if
it is lower on your MCU, communication between Klipper and the MCU will probably not work after the first step.
enter the klipper directory, copy .config from your old klipper directory if you started fresh, and try "make clean; make".
If you get errors, run "make menuconfig" to update .config with new options, usually going with the defaults is ok.
Once the firmware compiles, use out/klipper.bin to upgrade your CR10 MCU, via SDCard.
(also here, having your original .bin file available would allow you to downgrade back to where you have been.)

Display
I do not recall having had to upgrade the display after the initial conversion, so that should continue to work as is.

@zimmertr
A nice, well put together guide ! @nipunarora8 appears to not be using a PI Display but the patched original Creality Display.

@chirrupted
Copy link

chirrupted commented Nov 25, 2024

@xdadrm after adding the [t5uid1] section to printer.cfg (using your script), mainsail gives me an MCU Protocol error saying "mcu 'mcu': Unknown command: t5uid1_ping" at the end (and the screen stays on the klipper logo). could you please guide me in the right direction? I'm still new to klipper. once i remove the [t5uid1] section it doesn't give me an error anymore (but the screen still doesn't work).

@xdadrm
Copy link

xdadrm commented Nov 26, 2024

@chirrupted if you had to add the [t5uid1[ section to your config that sounds like you were NOT running desuuuu's klipper on your setup before ?!

**If that is the case, do not continue, revert back to your old klipper installation and look at @zimmertr 's approach. **

If you want to contine (and I don't know if the CR10s pro is the same as the Ender 6 - MCU and Display wise ..) :

The error sounds like your MCU firmware is not up-to-date - you could check with "grep T5 klipper/.config" it should look like this :

CONFIG_T5UID1_SERIAL=y
CONFIG_STM32_T5UID1_SERIAL_USART3=y
CONFIG_STM32_T5UID1_SERIAL_USART3_PB11_PB10=y

if it is not, use make menuconfig to change the settings, make and then reflash the mcu with the new compiled binary.

@chirrupted
Copy link

@xdadrm I use an Ender 5 Plus. anyways, I got it to work (just forgot to flash to the printer :P) however I can't click on the Move button and retracting and advancing filament doesn't work. when printing, the screen doesn't change either (stays on homescreen). before using the script everything worked.

@xdadrm
Copy link

xdadrm commented Nov 26, 2024

@chirrupted Hah, you got me there I've got you mixed up with @nipunarora8 :)

Anyway, glad it 'semi-worked' for you - from your description, I can only imagine that these might be incorrect for your machine / MCU,

CONFIG_STM32_T5UID1_SERIAL_USART3=y
CONFIG_STM32_T5UID1_SERIAL_USART3_PB11_PB10=y

@chirrupted
Copy link

@xdadrm thanks! though i think I'll be using an android phone instead :P sorry for wasting your time

@nipunarora8
Copy link

@xdadrm Thank you for your ideas. CR10s pro has the same screen as the ender 6 (I guess). And if I am not wrong, desuuuu also has Cr10s pro (because it was his config which I took while setting up klipper).
I will implement your ideas on my printer but I am very busy until the weekend. Will keep you updated. Thanks

@nipunarora8
Copy link

nipunarora8 commented Nov 28, 2024

Hey @xdadrm, I seem to use your script but no success. I put your script next to klipper folder, ran it, two scripts were having conflicts (src/atsamd/serial.c and src/atsamd/Kconfig) so I used the new version. The make and flashing went without errors. For flashing it generated a .elf file which I flashed using make flash FLASH_DEVICE=serial port

Now my klipper version in mainsail says klipper -> v0.0.0-4766-gdgus-reloaded-230526-0-gbaae7f3a-dirty-inferred

and I can't connect to mcu cuz I have an error gcode command SET_PRINT_STATS_INFO already registered
I commented this line in mainsail.cfg too, but still not luck.

Do you have an idea what can I do to make it work?
Thanks

@xdadrm
Copy link

xdadrm commented Nov 28, 2024

@nipunarora8 there should be no conflict, you can try moving your klipper directory to kipper.broken, and run the script again - that will pull mainline klipper and merge desuuuu's patches in and likely resolve the merge conflict as well as the SET_PRINT_STATS_INFO error.

( The script is 'dumb' and rather forcefully simply merges the two repositories together - often good enough but not failsafe )

Then, best copy your original .config (or kipper.broken/.config) to klipper/.config , rebuild and flash the firmware to be sure to have that match the klipper software.

Good luck !

Looking for SET_PRINT_STATS_INFO in the klipper source shows that it is only used in a single file: klippy/extras/print_stats.py

find . -type f -exec grep -l SET_PRINT_STATS_INFO {} +

./docs/Status_Reference.md
./docs/G-Codes.md
./klippy/extras/print_stats.py
./klippy/extras/pycache/print_stats.cpython-310.pyc

@nipunarora8
Copy link

@xdadrm It worked, thank you soo much.

The SET_PRINT_STATS_INFO was basically a problem because of mainsail.cfg. I updated mainsail and things went smooth.
The screen is also working fine as of now, but I will still check if it has any problems.

Thank's for helping. :)

@xdadrm
Copy link

xdadrm commented Nov 30, 2024

@nipunarora8 great to hear, thanks for the feedback !

@brumela
Copy link

brumela commented Dec 6, 2024

@xdadrm

bash script :

#!/bin/bash
if [ ! -d klipper/.git ]; then
  git clone https://github.com/Klipper3d/klipper.git klipper
else
  echo "Klipper exists .."
fi

pushd klipper 


if ( git branch | grep desuuuu-ender6 -q ); then
  git switch desuuuu-ender6
else
  git branch desuuuu-ender6  
  git checkout desuuuu-ender6
fi

GIT_EDITOR=/bin/true git pull https://github.com/Klipper3d/klipper.git
GIT_EDITOR=/bin/true git pull -q -X ours --no-rebase https://github.com/Desuuuu/klipper.git

popd

I did update to latest with your script, script works ok and also no errors when building... But after flashing new firmware, move (middle) button, and some buttons in setup are not working. Anyone with same problems?

My printer is Cr10sPro, with latest Desuuuu version of klipper screen was working Ok.

@xdadrm
Copy link

xdadrm commented Dec 6, 2024

@brumela first thing might be to try and start fresh, the script is 'dumb' and rather forcefully simply merges the two repositories together - often good enough but not failsafe.

Try moving your klipper directory to kipper.broken, and run the script again - that will pull mainline klipper and merge desuuuu's patches in. Then, best copy your original .config (or kipper.broken/.config) to klipper/.config , rebuild and flash the firmware to be sure to have that match the klipper software.

@tssk
Copy link

tssk commented Dec 15, 2024

@xdadrm Thank you for the script. I used it and it works great.

I am wondering if someone with the knowledge maybe could setup new repository that will be updated for the others that are not so skilled? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants