Jump to content

Updated my Klipper... oh.. dear...


Recommended Posts

Just made the "mistake" to run an "update all" on Moonraker, including Happy Hare and Klipper... should have known better...

After MANY changes needed to get Happy Hare ""hardware.cfg" working again, since they took out the need to have the [extruder] part in there, but also the [manual_extruder_stepper extruder] parts..

It takes some tinkering to get it all corrected, so happy hare seems to be ok I think...

The problem with my system is, that it has Canbus (old config) now its Katapult, a MMU aka enraged rabbit aka Happy Hare, and a beacon.

But now...

So Lets see if I can get it running today again...

MCU Protocol Error

image.png.9941168a592aa1394a25cce4d6906d3e.png

Link to comment
Share on other sites

I think I am going to update my canbus device to Katapult version, this means putting them in DFU mode by putting the jumper (boot/bios) on there and pressing the boot button.

After that you are able to push a Katapult firmware to it, once done, I should be able to push Klipper firmware on it.

Link to comment
Share on other sites

voron-update.gif.48a3224ae1b09481ffe440e99b6b62d0.gif

That fun error. Basically, you will need to reflash your MCUs with the current version of Klipper. Go back to the setup docs for your various controllers and run through the part where you flash the MCU again. You will have to do this for each one.

  • Like 1
  • Haha 2
Link to comment
Share on other sites

The latest klipper updates have brought so many new good things. 

 

What I know of, is that all kinds of plugin scripts (some KlipPain scripts, ShakenTune, klicky and some others)  loose their Symlinks, so reinstalling them (with latest update from their github) helps.

Your beacon is USB, so no need to do anything there. They also do not have any updates or support, so you are good there...

For the other ones...

 

I thought Katapult / Canbus was generating the same binaries, whatever you specify, for backward compatibility. If you have not updated your katapult on your CAN devices (U2C, Octopus, Mellow Fly, Mellow ERCF), you can do that. BUT, officially you DO NOT HAVE TO.
You only need to update katapult, which is the BOOTLOADER (you know... which makes it easy to flash things, so you do not have to connect cable, press dfu button), ONLY when you want to change your can network speed... from 1.000.000 to 500.000 for example.. Otherwise, it will still work.

It is smart to update your other can devices over katapult to their latest firmware... I will suggest using the manual from Esoterical: https://canbus.esoterical.online/Updating.html

You can also check out the script I wrote in case you want to automate things... You will probably have to add your ERCF CAN board to the script updates...

I am sure you have already figured everything out... But let us know if you have any questions.

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, claudermilk said:

voron-update.gif.48a3224ae1b09481ffe440e99b6b62d0.gif

That fun error. Basically, you will need to reflash your MCUs with the current version of Klipper. Go back to the setup docs for your various controllers and run through the part where you flash the MCU again. You will have to do this for each one.

Yeah.... thats what I am trying to do now, and done it many times on new printer so you would think.... no problem.. right?

Well, I cant get my Fly sht36v2 into boot0 DFU modus, I dont know why, but it WONT show me the device.

Soooooo, Im starting over 100%, reimage my PI, install katapult, Happyhare, everything.. oh boy...

 

1 hour ago, Dirk said:

I thought Katapult / Canbus was generating the same binaries, whatever you specify, for backward compatibility. If you have not updated your katapult on your CAN devices (U2C, Octopus, Mellow Fly, Mellow ERCF), you can do that. BUT, officially you DO NOT HAVE TO.
You only need to update katapult, which is the BOOTLOADER (you know... which makes it easy to flash things, so you do not have to connect cable, press dfu button), ONLY when you want to change your can network speed... from 1.000.000 to 500.000 for example.. Otherwise, it will still work.

It is smart to update your other can devices over katapult to their latest firmware... I will suggest using the manual from Esoterical: https://canbus.esoterical.online/Updating.html

You can also check out the script I wrote in case you want to automate things... You will probably have to add your ERCF CAN board to the script updates...

I am sure you have already figured everything out... But let us know if you have any questions.

Thanks for the link I will check it out, but like I said, cant get my PI to see the canbus devices, and managed to update katapult on the Octopus, but my FLY canbus doesnt want to go into DFU mode, it seems.

I have just decided to just make a backup of all files and go clean from 0... Oh, I am sure I will hate myself more later...

Link to comment
Share on other sites

36 minutes ago, Buurman said:

Soooooo, Im starting over 100%,

I think you are making a lot of work for yourself...

But if you feel good with that, nobody will be able to hold you back 🙂

 

If you can not see one of the devices, you can usually try to find out the cause of why. https://canbus.esoterical.online/troubleshooting/no_uuid.html

 

BUT, if you are going to start over, consider seriously following Esotericals guide. It is good, foolproof and it is being tested and tried and improved every day over and over again. Check out voron discord channel can-toolhead-boards. In fact if you come there NOW, they will help you figure out why your mellow is not showing. 

If you follow this guide, you can simply follow the 'update' page next time klipper updates and you get the same problem. You can also use the CAN update script I wrote, and it will be done in under 3 minutes 🙂

 

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Dirk said:

I think you are making a lot of work for yourself...

But if you feel good with that, nobody will be able to hold you back 🙂

If you can not see one of the devices, you can usually try to find out the cause of why. https://canbus.esoterical.online/troubleshooting/no_uuid.html

BUT, if you are going to start over, consider seriously following Esotericals guide. It is good, foolproof and it is being tested and tried and improved every day over and over again. Check out voron discord channel can-toolhead-boards. In fact if you come there NOW, they will help you figure out why your mellow is not showing. 

If you follow this guide, you can simply follow the 'update' page next time klipper updates and you get the same problem. You can also use the CAN update script I wrote, and it will be done in under 3 minutes 🙂

thanks, I will give it another try with your link, seems good documented, I also followed the other ones and its very good!

I sometimes think I have seen everything, but updating stuff .. clearly is another thing I can improve on.. really appriciated, thanks!

Link to comment
Share on other sites

2 hours ago, Dirk said:

Succes ermee @Buurman!

Bedankt Dirk!

Well, after many tries I decided to replace my FLY SHT36v2 since I am unable to get it into BOOT/DFU modus, No idea why, but it seems like it got fried during updating or corrupt firmware.. no idea, maybe I just did something wrong and uploaded a wrong firmware to it, although, I cant imagine I did...

Replaced it, and new one works..

Now I only still need to install all my shit again 😛 

Fun fact, even after building 20+ vorons now, youre still learning... 

Link to comment
Share on other sites

Why would a perfectly working PCB, die when you update klipper? I don't think so. But sometimes time you spend to figure it out, is more money than you invest in a new one.

If you have always flashed your CAN devices with Katapult / Canboot, you should not need to press any buttons... Or if you did set it (Like Esotericals guide suggest), then double clicking the reset button will put you in katapult mode.

Katapult is the bootloader and you can directly flash.

In case you have fucked up your SHT36V2, by flashing some wrong firmware, it is always posssible to re-program it with an ST link like this one or this one, since it is an STM chip. 

I have already updated klipper twice the last two days, but just saw there is yet another update. I will try and see what happens. Maybe this will be my chance to try out my script 🙂

 

Edited by Dirk
Link to comment
Share on other sites

1 hour ago, Buurman said:

I am unable to get it into BOOT/DFU modus

If you have the board's UUID (in printer.cfg file or displayed in mainsail, you can just flash the new firmware with:

python3 ~/katapult/scripts/flash_can.py -i can0 -f <firmware.bin> -u <myuuid>

No need to put in DFU mode. This is how I done mine ( 2 x Mellow Fly SHT36v2 and 4x Mellow fly SB2040)

 

BTW - also works in updating the Cartographer probe

  • Like 1
Link to comment
Share on other sites

16 minutes ago, Dirk said:

I will try and see what happens. Maybe this will be my chance to try out my script 🙂

😞

Unfortunately. Update was without a problem. I have updated, no dirty-klippers 😐

 

12 minutes ago, mvdveer said:
python3 ~/katapult/scripts/flash_can.py -i can0 -f <firmware.bin> -u <myuuid>

No need to put in DFU mode.

This command is similar to the latest section of the script I had made.

Only that scripts uses the flashtool.py script. Before flashing, it also stops and afterwards starts the klipper service.

@Buurman, when I just was on Esotericals page, I saw he has added an extra page to his website. If you wish you can run it and see the debug information it generates. Which is not little...

If you wish to, I can look at it (or others). Just send me the link, here or over DM.

 

 

  • Like 1
Link to comment
Share on other sites

11 minutes ago, Dirk said:

This command is similar to the latest section of the script I had made.

Will have to use it in future to save time 🤣. As I said before - great script - thanks!

  • Like 1
Link to comment
Share on other sites

Well, now I'm stuck in this issue. I got Klipper updated, reflashed the Octopus MCU and it was basically working. The webcam and KlipperScreen were borked. I got the webcam responding, but not reliably, so I tried installing crowsnest. That was a no go since the Pi was still on Buster, so I tried updating in place, which naturally failed. The printer still worked, but KlipperScreen was well and truly dead. I just tried uninstalling it through KIAUH and reinstalling. Well, that blew up really good. It hung part way through and now the Pi won't even boot.

I have another SD card, so I flashed a completely fresh  install of Debian and Klipper. Great, I get the Pi booting and Klipper working. I can recover the entire old SD card, so all settings are accessible. But, now it cannot see the Octopus any more! I am connected via GPIO, so it's connecting on ttyAMA0. That's a no-go, so I tried pulling the data pins and connecting via the USB-C port on the Octopus. Still no joy, though I'm not 100% sure the cable I found isn't charging only.

I reflashed the Octopus via SD for the GPIO and confirmed the file renamed to firmware.cur. Still no joy.

So now I'm wondering what the next step is. 

Link to comment
Share on other sites

You are using a normal raspberry Pi? Any reason why you are not creating a mainsail SD card with Raspberry Pi manager?

I htink its so easy, everything is already in there... exept Klipperscreen, but thats one command copy and execute.

Also why the GPIO pins to the octopus, a simple USBA to USBC cable between them works perfectly, super stable, I have build 20 vorons like this and most of them have over 6000 hours of printing without ANY issues.

But maybe you have your reasons, and maybe very good ones too, I am just saying, thiis is how I do it, but maybe you need more USB ports free?

Link to comment
Share on other sites

6 hours ago, claudermilk said:

it's connecting on ttyAMA0

I have never connected using ttyAMA0, but it all should not be that different. 

What I notice, is like you already did and managed, that the sd card was somehow mangled and fixed that. 

Your situation and your setup sound complex and I think I am unfortunately unable to give you any advise... But if I were you, I would start from scratch...

And keep the general recommendation from @mvdveerin mind, to unplug ALL cables if you want to flash octopus / bring it in DFU mode..

And the usual suspects, like the right cable, you already know... 

Link to comment
Share on other sites

Yeah, the annoying thing is the hardware side has been working for years--this isn't a new build. It's software. I guess I can pull the SD card and reflash from scratch.

@Buurman, I connected via GPIO to avoid the separate 5V power supply. The 250 Trident is crowded enough down there without two supplies. It worked without a hitch at initial build. For some reason it's being difficult now.

  • Haha 1
Link to comment
Share on other sites

Clear! yeah, I just started over, but if you backup your config files, its not that bad I must say, had it running in a few hours from scratch, and thats with canbus and enraged rabbit.. 

  • Like 1
Link to comment
Share on other sites

1 hour ago, claudermilk said:

For some reason it's being difficult now.

I think the software side is one thing which changes very often.

I have lately also seen many problems with the klipper screen integration. Or as a result of its functionality. People apparently want klipper screen to work exactly as mainsail /fluid, but the developers think differently about that...

I think the smartest thing to do, is to start from scratch and do every single component one by one.

That's what I did when I couldn't get my printer back up after exchanging the spider MCU for the octopus MCU.

Flash octopus, connect check. If okay, connect next....

If you are going to start with a new sd card, I have heard only the latest version of the 64 bit linux works well with CAN... Might you ever decide to use it 🙂

And it seems not to be available as a mainsail is package. So you need to install the latest 64 bit light OS and then install KIAUH.

 

The hardware part... Wires that move all the time... Break. Even if you have the best ones with harness and protection and certification for movement. This might even explain why your first flash did not go well.

Very regularly an argument to make the step to CAN. 😄

Link to comment
Share on other sites

No CAN! Nope, no. 😆I don't want to add more problems, and I'm perfectly happy with the hartk PCB right now. That wire harness is fresh and not an issue.

So yeah, I'm thinking going back to scratch. The wiring was fine until I borked the Debian install, so I'm pretty sure it's just a software issue. I think the version of Debian is now past the one with the bug, so that shouldn't be the problem. My initial install way back when was the MainsailOS image; I'm going with a standard Debian Lite 64 bit via Raspberry Imager, then installing KIAUH and setting up Klipper that way; it worked easy with the V0.

I may have gotten ahead of myself with copying over my recovered config files. I may just get the bare-bones basic one running so the boards are talking, then copy-paste restore stuff. Ugh.

backtothebeginning.gif.69119e96fa9b46e0dfc882bd7bd3d83a.gif

  • Like 2
  • Voron FTW! 1
  • Haha 1
Link to comment
Share on other sites

1 hour ago, claudermilk said:

I don't want to add more problems

Sorry for suggesting. I lost A LOT by stepping over to CAN.

Oldskool.thumb.jpg.cf7b3833f8fd38bf2e97b39bfd8e12af.jpg

 

1 hour ago, claudermilk said:

Debian Lite 64 bit via Raspberry Imager, then installing KIAUH

I have indeed seen several more experienced people recommend this route. It seems not to have been 'a' bug. But apparently a whole bunch that affects communications between the RPI and peripherals.

 

expopinion.thumb.jpg.7f64c88d460eb2e8fa676d757492f0ae.jpg

 

I think your plan is a solid one. Have fun 😉

Link to comment
Share on other sites

I did confirm the USB cable I tried to use appears to be charging only. I grabbed one I know is for data as well. I let the printer sit yesterday and worked on some other projects. I'll attack this again this weekend I think.

I did kind of get through to the test and ??? steps on that guide. It's just the darn boards won't talk to one another right now. Once I can get them over their tiff I'm off and running again. I wonder if installing the 32bit version might be better? Klipper isn't all that intensive and the Pi4 is already overkill for the demands. 🤔

Link to comment
Share on other sites

2 hours ago, claudermilk said:

I wonder if installing the 32bit version might be better?

I am quite sure, the 32 bit version would also be okay. Most used to opt for 32 bit, because of the apparent bugs in 64 bit OLDer versions.

But if you have a 64 bit Rpi, it would be waste of resources not to install a 64 bit OS. But 32 bit is apparently more stable and more tested. So if you have strange errors, why not.

2 hours ago, claudermilk said:

charging only

This, also cost me several tens of hours trying to 'flash' things. So when I need a data usb cable, I always verify by connecting it to my phone (always nearby) to my laptop and see if it connects in data mode and not just charging 🙂

Link to comment
Share on other sites

WAIT! Forget all the following! SUCCESS!!! \o/  For the heck of it I threw lsusb at the SSH and saw the ID changed. So with fingers crossed and breath held, I thres ls /dev/serial/by-id and holy cow there was a Klipper_stm32f446xx listing! I threw that into the bare-bones Mainsail printer.cfg and they are talking again! Time to reprise this gif. 😁

itsworking-sm.gif.f16f18db082343af79541a9843707ec8.gif

Some progress. I reimaged the Pi SD car with the 32bit current Debian. Tried with the GPIO connection, no joy. So I switched to the new USB cable I got. It took a press of hte reset button, but I got a DFU mode device ID! Yay, next step: redo make for USB communication. When I tried to flash make threw some errors.

pi@bluetrident:~/klipper $ make flash FLASH_DEVICE=0483:df11
  Building hid-flash
gcc -c -Wall -std=gnu99 -I . `pkg-config libusb-1.0 --cflags` main.c -o main.o
gcc -c -Wall -std=gnu99 -I . `pkg-config libusb-1.0 --cflags` hid-libusb.c -o hid-libusb.o
gcc -c -Wall -std=gnu99 -I . `pkg-config libusb-1.0 --cflags` rs232.c -o rs232.o
gcc -no-pie main.o hid-libusb.o rs232.o `pkg-config libusb-1.0 --libs` -lrt -lpthread -o hid-flash
  Flashing out/klipper.bin to 0483:df11
sudo dfu-util -d ,0483:df11 -R -a 0 -s 0x8008000:leave -D out/klipper.bin

dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Warning: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release
Opening DFU capable USB device...
Device ID 0483:df11
Device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(10) = dfuERROR, status(10) = Device's firmware is corrupt. It cannot return to run-time (non-DFU) operations
Clearing status
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash  "
Downloading element to address = 0x08008000, size = 33996
Erase           [=========================] 100%        33996 bytes
Erase    done.
Download        [=========================] 100%        33996 bytes
Download done.
File downloaded successfully
Submitting leave request...
Transitioning to dfuMANIFEST state
dfu-util: can't detach
Resetting USB to switch back to Run-Time mode

Failed to flash to 0483:df11: Error running dfu-util

If the device is already in bootloader mode it can be flashed with the
following command:
  make flash FLASH_DEVICE=0483:df11
  OR
  make flash FLASH_DEVICE=1209:beba

If attempting to flash via 3.3V serial, then use:
  make serialflash FLASH_DEVICE=0483:df11

make: *** [src/stm32/Makefile:111: flash] Error 255

So it's failing to actually flash the darn MCU. Of course Klipper can't connect. Now the question is why the heck won't the Octopus flash? Is it because I'm powering via 24V and not 3.3V from the USB? So then should I be able to SD card flash from here?

 

make menuconfig settings:

                                               Klipper Firmware Configuration
[*] Enable extra low-level configuration options
    Micro-controller Architecture (STMicroelectronics STM32)  --->
    Processor model (STM32F446)  --->
    Bootloader offset (32KiB bootloader)  --->
    Clock Reference (12 MHz crystal)  --->
    Communication interface (USB (on PA11/PA12))  --->
    USB ids  --->
()  GPIO pins to set at micro-controller startup

 

 

  • Haha 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...