Jump to content

Klipper in a duet2 wifi


Maurici

Recommended Posts

So, yes. I´ve scouted the web and I´m struggling to find actual documentation about how to flash klipper onto the duet.

Has someone identified a decent source of information? 

It took me forever to configure my duet with RRF to work with RRf2.x

2.x is not longer evolved nor supported. So I don´t have pressure advance (not a decent one anyway) without input shaper, without my recently discovered KAMP (that BTW I think it would be a game changer for my 400x400 bed). Even if I move to RRf3.x I would still miss some of the above features.

I have plenty of Raspberry´s and two screens left, even if I didn´t, I could control 2 of them with 1 raspi... 

I do also have a brand new SKR mini E3V3 resulting from a mixtup with amazon. The easy option would be to use that board (that I keep as direct spare replacement for my V0, Switchwire), however then I would be left with a very very decent board-screen setup with plenty of in and outs and good TMCs useless in my parts bin, so my primary option is to use the DUET2Wifi with Klipper.

I know it can be done as there is a generic config file for duet 2 wifi/Maestro.

Nero´s video, doesn´t really helps, Is a duet 1 and not really applicable here.

Any help? I don´t want to pull the trigger If I´m going to be flying blind.

Thanks

Maurici.

 

****Solution in post number 13****

Warning. is a pretty involved procedure, and to understand what I´m saying (pretty basically explained) this should not be your first klipper install and you should be familiar with raspberrypiimager and kiahu.

If you are not... not a big deal, plenty of youtube videos (i wasn´t before I started).

 

Edited by Maurici
Link to comment
Share on other sites

Also found this that may be helpful:

Please Note: Flashing the Duet board (V1.04 and up) you will need to prepare the board to be flashed. Follow this section of the firmware flashing from Duet instruction:

Erase the firmware on the Duet
a) - Pressing the Erase button (for older Duets)
https://d17kynu4zpq5hy.cloudfront.net/igi/duet3d/oPagnLUVtoBAASNa.full

b) - Jumpering the erase jumper
https://d17kynu4zpq5hy.cloudfront.net/igi/duet3d/LIgSyaIiaTuJMrs4.full

c) - Remove the erase jumper as soon as the Diag LED lights up. This means you are successfully in programming mode.

d) - then the Reset button (if one is present).
 

As I am not familiar with the duet and reprap, I hope I am notstating the obvious here.

Link to comment
Share on other sites

I also understand that it needs a specific flashing method - found here:

 

SAM4 micro-controllers (Duet Wifi)

It is not common to use a bootloader with the SAM4 mcu. The chip itself has a ROM that allows the flash to be programmed from 3.3V serial port or from USB.

To enable the ROM, the "erase" pin is held high during a reset, which erases the flash contents, and causes the ROM to run.

The code at https://github.com/shumatech/BOSSA can be used to program the SAM4. It is necessary to use version 1.8.0 or higher.

To flash an application use something like:

bossac --port=/dev/ttyACM0 -b -U -e -w -v -R out/klipper.bin

 

 

 

 

Link to comment
Share on other sites

what you found, is pretty much the same I have found. Many serveral different resources of a guy that dit this or the other...

The good thing tho, is that at least the generic config file is set up for a cartesian so it would be pretty much drag and drop.

It seems to be a consensus that the only "triky" point is to put the board onto "flash" mode. after this, there is documentation enoug.

Really, I don´t know why I´m friking out that much... I actually have a backup board, and a config file for the exact same printer where I only have to modify the bed size, so... may the worst happen, I could get the printer back up and running in 1 h tops, and I´m sure eventually I would be able to get the duet board working again...

I may just have to man up and go for it...

 

If I do so, I promise to put an step by step here. Meanwhile, if someone has done it before, please comment!!

  • Like 1
Link to comment
Share on other sites

Good luck! At the risk of cursing things, I'm sure you'll not brick the thing if the MCU itself has a ROM (that can handle flashing) then it'll be fine (I think most/a lot of boards these days have some means of saving them (ICSP header, in-built ROM, etc) if you happen to blitz the boot-loader/bork the firmware.

  • Thanks 1
Link to comment
Share on other sites

So... I tried. As often happens when error codes and specific situations started to come up, I´ve researched deeply.

there is currently a bug with mainsail and klipper that erases the usb serial dev from the flash, making the instalation useless.

Current status... bricked board as won´t connect at all.

 

https://klipper.discourse.group/t/duet-2-firmware-compilation-broken-on-debian-11/4762/9

 

Link to comment
Share on other sites

well. It works, bl touch included.

Now, a lot has to be set up and configured, but all the pins, sensors probes heaters and fans work just fine.

 

https://imgur.com/a/6awRcf4

 

Now, I have to make work the panneldue with klipper (apparently this is the easy bit), re-tidy up the wiring, bring the printer in her cage again... but I´m not scared of that. The flashing and pins identifying was a bit more terrifying.

 

I´ve documented every step. Its really involved and is not documented anywhere... not as a full tutorial anyway... so I promise to do a write up here on how to do it.

I have to I feel extremely realised and satisfied having been able to do so pretty much flying solo blind!!

 

Edited by Maurici
  • Like 1
Link to comment
Share on other sites

Printer back to its cage, wiring redone, and all set up. Bed limits, homing, bed mesh, all my start and stop macros... (including KAMP)

 

Only left is Pressure advance and input shaper, that will happen tomorrow during the day.

Even the pannel due works!! so I managed my initial target of re-using all of my existing hardware from RRF to Klipper!

This printer has now a new lease of life. Sharing firmware between all the printers is so convenient... so any firmware mod you do in one, is often cross compatible with the others...

Commands... same slicer firmware and start/stop routines.

I´m so happy!! 🙂

  • Like 3
Link to comment
Share on other sites

3 hours ago, Maurici said:

´m so happy!! 🙂

And so you should be. Great effort and persistance. Thanks for sharing. I am sure all your hard work will pay off. And if you publish that how-to, it may prevent @smirk from casting another curse😂

 

7 hours ago, smirk said:

Phew! I was about to apologise for cursing things.

 

  • Haha 1
Link to comment
Share on other sites

so. If you are like me, back in 2020 you were hearing stuff about klipper, and something called speedboat race... however was buggy and lacking features. So, you wanted to walk away from marlin, and the option was a duet with RRF.

You went all the lenghts to learn RRF, and you installed a brand new duet2 wifi with a 7 inch panel due, put your printer running and you have lived happily ever since.... Since you ran klipper in a dodgy 30 quid board with an obsolete raspberry just to try.

Then you discovered imput shaper with accelerometres, you discovered KAMP, you discovered an actual usefull pressure advance, intuitive macros, klipperscreen... the whole 7 yards.

But... you had like 200 quid in a posh board with multiple TMCs controllers, all the bells and 2660 drivers and so... therefore you stay commited to RRF. 

till you deciede that your main printer HAS to move to klipper.

And you find out that mainsail, and the latest raspian OS have a bug that won´t allow you to flash your board. After doing all ok in the right way and flashing it, the USB serial comms port will dissapear and will semibrick your board.

Well. Not anymore.

 

Step 1.

Take a fresh SD. Don´t use a previous raspian distro or whatever... format it.

Install Raspian LITE 10 BUSTER (legacy).

This is a very basic raspian install. Remember to habitlitate ssh in raspiimager.

 

Step 2.

Open putty (or whatever command line you use for linux).

Instal git.

for that you will need to update the system.

"""sudo apt update"""

Let run the updates.

"""sudo apt -get install git -y"""

Step3.

Then instal KIauh.

"""

cd ~

git clone https://github.com/th33xitus/kiauh.git

./kiauh/kiauh.sh

"""

Instal only 1 instance of Klipper with kiauh.

Install only 1 instance of moonraker with kiauh.

Save and exit.

This will leave you with a very basic and old version of raspian running klipper and moonraker.

Time to flash.

Step 4

Jump reset pins for 3 seconds. Press reset button (if available)

check connection with the board

ls /dev/serial/by-id/*

copy your serial.

"""cd klipper"""

"""Make menuconfig"""

Setup mainmenuconfig as follows.

https://miro.medium.com/max/700/1*B0B_bbL9J5m7Pd4AaEb3Rg.png

Exit and save.

""" make"""

"""sudo service klipper stop"""

"""make flash FLASH_DEVICE=/dev/serial/by-id/usb-03eb_6124-if0""" (replace here for your serial ID)

After this you should see the following.

#

******Erase flash

Done in 4.376 seconds
Write 25340 bytes to flash (50 pages)
[==============================] 100% (50/50 pages)
Done in 0.382 seconds
Verify 25340 bytes of flash
[==============================] 100% (50/50 pages)
Verify successful
Done in 0.382 seconds
Device reconnect on /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0y
*****
#

"""Sudo service klipper start."""

Your Serial will have change so check it again and copy it.

 

step 5

go back to kiauh
"""./kiauh/kiauh.sh"""

Install mainsail.

Step 6.

Go to mainsail trough your webrowser and copy your serial in the printer.cfg file.

don´t modify printer CFfile yet other than including new MCU dev serial.

Check connection. Ideally all should work no... so, go to your machine settings and update/upgrade all your packages.

 

Start setting up your printer.cfg, the github page works well as starting point.

 

RESOURCES:

Flash step:  (after instaling the lite version of raspian and klipper and moonraker trough kiahu)

Kiahu tutorial. 

 

To reuse your panneldue, follow Nero´s tutorial.

 

 

 

 

 

 

 

 

 

Edited by Maurici
  • Like 3
  • Voron FTW! 1
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

I tried this and I get the disappearing serial port bug.  I can't believe you pushed through and had the patience to make it work.  On the plus side... I didn't brick my Duet board.  I can still put it in  program mode and can go back to RRF if I can't get it working.  I appreciate the effort you put in to document everything.

Link to comment
Share on other sites

2 hours ago, Duane H said:

I can't believe you pushed through and had the patience to make it work

I did. 

When you follow the steps is even quicker than a normal build.

Do you need a more detailed step by step? IMHO nowadays is well worth it.

 

Link to comment
Share on other sites

I'm pretty sure I followed your instructions to the letter.  I was going to try again without doing the updates at the beginning and see if makes any difference.  I really appreciate the offer.  If I can't get it, I may ask for your help.

Edited by Duane H
Link to comment
Share on other sites

On 2/15/2023 at 10:55 PM, Maurici said:

Verify successful
Done in 0.382 seconds
Device reconnect on /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0y

I´assuming you get ok till the point above, and then it doesn´t show "device reconect with the new serial?"

If you don´t do the updates at the begining you won´t be able to get "git" and therefore you won´t be able to clone kiahu? (I´m talking from memory, I´m far from an expert. I just picked things from here and there seeing other users trials, till I got it running.

Are you sure you are installing the legacy version of  raspian (raspian 10) if you install the lite buster 11 won´t work.

 

 

  • Thanks 1
Link to comment
Share on other sites

Thanks for the quick response.  Here is my OS info:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
Here is my terminal output:

pi@kelf:~/klipper $ ls /dev/serial/by-id/*                                      
/dev/serial/by-id/usb-03eb_6124-if00
pi@kelf:~/klipper $ make flash FLASH_DEVICE=/dev/serial/by-id/usb-03eb_6124-if00
  Flashing out/klipper.bin to /dev/serial/by-id/usb-03eb_6124-if00
Entering bootloader on /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0
Device reconnect on /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0
lib/bossac/bin/bossac -U -p /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0 -e -b -w out/klipper.bin -v

Erase flash

Done in 4.511 seconds
Write 25692 bytes to flash (51 pages)
[==============================] 100% (51/51 pages)
Done in 0.393 seconds
Verify 25692 bytes of flash
[==============================] 100% (51/51 pages)
Verify successful
Done in 0.445 seconds
Set boot flash true

As you can see, I do not get the device reconnect message at all.
 

 

Link to comment
Share on other sites

18 minutes ago, Duane H said:

Thanks for the quick response.  Here is my OS info:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
Here is my terminal output:

pi@kelf:~/klipper $ ls /dev/serial/by-id/*                                      
/dev/serial/by-id/usb-03eb_6124-if00
pi@kelf:~/klipper $ make flash FLASH_DEVICE=/dev/serial/by-id/usb-03eb_6124-if00
  Flashing out/klipper.bin to /dev/serial/by-id/usb-03eb_6124-if00
Entering bootloader on /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0
Device reconnect on /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0
lib/bossac/bin/bossac -U -p /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0 -e -b -w out/klipper.bin -v

Erase flash

Done in 4.511 seconds
Write 25692 bytes to flash (51 pages)
[==============================] 100% (51/51 pages)
Done in 0.393 seconds
Verify 25692 bytes of flash
[==============================] 100% (51/51 pages)
Verify successful
Done in 0.445 seconds
Set boot flash true

As you can see, I do not get the device reconnect message at all.
 

and even so... (as before the flash it reconects to the correct flashed port...) you can´t call the printer with this ID?

" /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0y"

 

Very weird. I didn´t invent anything. A guy was saying he had been successful with a basic install of raspian lite and klipper by kiahu. Is known to be the raspian 11 that has the bug, the 10 apparently used to work well... so I investigated on my own what was a lite image, and how to handle kiahu...

I´m surprised and very sorry I can´t help any further.

I hope you get to the bottom of it and you manage to make it work. (and if you do so, please, coment the solution here)

 

 

 

Edited by Maurici
Link to comment
Share on other sites

 

Again, Thanks for the quick response. 

I started over and I don't know what I did differently, but it worked this time.  Thanks for all of your help!!

Now I just need to create a printer.cfg, and hookup the PanelDue.  Very excited!

 

Link to comment
Share on other sites

1 minute ago, Duane H said:

Again, Thanks for the quick response. 

I started over and I don't know what I did differently, but it worked this time.  Thanks for all of your help!!

Now I just need to create a printer.cfg, and hookup the PanelDue.  Very excited!

Yeeeeeyyyy!!!!

I´m so glad my experience helped someone!! 🙂

what printer are you using? will my printer config be of any use?

Mines is a traditional cartesian (ender 3 based) with BLtouch hooked up in the spooky way as duet recomended... let me know as I´m happy to past it here.

 

The resources I used to come up with the pins were:

 

https://duet3d.dozuki.com/Wiki/Duet_2_Pinout_table

and this

https://d3t0tbmlie281e.cloudfront.net/igi/duet3d/H4C2eubRi6nHlvrP.huge

Link to comment
Share on other sites

Thanks for the links.  They will be very useful.

I'm using a Creativity3D Elf that I replaced the Robin Nano with a Duet Wifi a long time ago.   It's a corexy 300x300 dual Z printer.  I started with this printer since it is the one that I use the least.  Assuming I get this going, I'm probably going to update my Seckit SK-Go (running Big Dipper MB), my Troodon 2.0. and my Prusa Bear that I updated to a Big Dipper board as well.  I'm not sure if I'll convert my custom delta to Klipper or not.

One step at a time, however.  😉

  • Haha 1
Link to comment
Share on other sites

  • 2 weeks later...
16 hours ago, Duane H said:

Looks like they removed the pinout table.  I used the history to recreate the table.  I hope it helps someone.  There's probably a better way to attach the file, but I don't know what it is.

Duet 2 Pinout.html 69.67 kB · 0 downloads

Amazing resource and what a pitty missing the pinout table!!

Hopefully will live forever after right here.

Link to comment
Share on other sites

  • 4 weeks later...

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...