Klipper+Mainsail Install

ID: 146933

Description: This guide is still a WIP. The Arduino +...

Steps:

  1. Download and extract the latest version of Mainsail from their Github
  2. Open the Raspberry Pi Imager
  3. Select Operating System > Use custom > Select the Mainsail OS you downloaded.
  4. Select Storage > Select your SD.
  5. Bring up the Advanced Settings menu by pressing "Ctrl + Shift + X".
  6. Here you can setup your WiFi, locale, enable SSH and numerous other options.
  7. Write > Yes to confirm
  8. After imaging is complete the SD is automatically ejected. Insert it into the RPI and power it on.
  9. Step image Step image
  10. With the Raspberry Pi connected to the Duet 2 WiFi via USB, power on the RPI and SSH into the Pi.
  11. You can find the IP address of the Pi by looking at the connected client list in your router or by opening cmd.exe on your PC and running
  12. ping mainsailos.local -4
  13. In a webpage enter http://mainsailos.local or your printers IP address
  14. Navigate to the Machine tab on the left.
  15. Select Upgrade to update the RPI image and Update to install updates for Klipper, Mainsail and Moonraker. Once the updates are complete reboot the RPI
  16. Step image Step image
  17. Originally when I wrote this guide I saw many sources say you do not need to manually erase the firmware when you configure the Duet 2 WiFi for Klipper for the first time. However there's been many cases that has proven false.
  18. With the board powered off place a jumper on the erase pins.
  19. Connect the USB cable from the Duet 2 WiFi to a 5v power source(your PCs USB Port).
  20. Once the diag light comes on remove the jumper
  21. Any firmware saved to the Duet has been erased.
  22. Step image
  23. Connect the Duet 2 WiFi to the Pi with a USB cable. Power on the Pi and SSH into it.
  24. cd klipper
  25. make clean
  26. make menuconfig
  27. Micro-Controller > SAM3/SAM4 (Due and Duet)
  28. Processor > SAM4e8e (Duet WiFi/Eth)
  29. Communication Interface > USB
  30. Press the escape key on your keyboard and enter Y to save the config
  31. Step image
  32. Enter make
  33. Stop the Klipper service.
  34. sudo service klipper stop
  35. Get the Duet's serial ID # and copy it down.
  36. ls /dev/serial/by-id/*
  37. Enter "make flash FLASH_DEVICE=" and paste your serial after the =
  38. If the flash fails usually this will place the board into a bootloader mode like original install does when you hit the erase pins. If this occurs please rerun ls /dev/serial/by-id/* so that you can get the correct serial
  39. Enter make "flash FLASH_DEVICE=" and paste your serial your new serial after the =
  40. Step image Step image
  41. Make sure you're in the klipper directory:
  42. cd ~/klipper/
  43. Enter the following commands:
  44. sudo cp ./scripts/klipper-mcu.service /etc/systemd/system/
  45. sudo systemctl enable klipper-mcu.service
  46. make clean
  47. make menuconfig
  48. Step image
  49. Micro-Controller Architecture > Linux Process. Press esc than Y
  50. make
  51. make flash
  52. sudo service klipper start
  53. Verify klipper_host_mcu is in the tmp directory with ls /tmp/*
  54. Add the pi to the TTY group
  55. sudo usermod -a -G tty pi
  56. sudo reboot -h now
  57. Step image Step image Step image
  58. Next we will go to a Web browser to the Pi's IP address. You will see an error for "Unable to open config file /home/pi/klipper_config/printer.cfg"
  59. Download the printer.cfg file from github and upload it to the config directory
  60. Open your newly created "printer.cfg". Scroll down to line 169. Make sure you update the config with your serial ID you got from "ls /dev/serial/by-id/*"
  61. Double check the mcu rpi serial ID in line 181 maches "ls /tmp/*"
  62. Click SAVE and restart the printer
  63. Step image
  64. If you use a separate 5v PSU for PS_ON You'll need to add the following lines
  65. [output_pin psupower] pin: PD15
  66. [gcode_macro M80] gcode: SET_PIN PIN=psupower VALUE=1
  67. [gcode_macro M81] gcode: SET_PIN PIN=psupower VALUE=0
  68. Step image
  69. PanelDue is compatible with Klipper but only with v1.24. Instructions can be found here
  70. Connect the PanelDue to the RPI.
  71. 5v > 5v
  72. GND > GND
  73. UART0 TX > DIN
  74. UART0 RX > DOut
  75. Step image
  76. SSH into the RPI.
  77. sudo nano /boot/config.txt
  78. At the bottom of the config file enter:
  79. dtoverlay=pi3-miniuart-bt
  80. Press Ctrl+X > Y to save > Enter to accept
  81. Step image
  82. We need to disable the serial console
  83. sudo nano /boot/cmdline.txt
  84. Remove the following string
  85. console=serial0,115200
  86. Press Ctrl+X > Y to save > Enter to accept
  87. Step image
  88. Disable serial console
  89. Sudo raspi-config
  90. 3 Interface Options > P6 Serial Port > No > Yes
  91. Yes to reboot the RPI
  92. Make sure you change the baud rate on the paneldue to 115200
  93. There's also a number of configs that need to be added to your moonraker.cfg. Those details can be found here.
  94. Step image
  95. Download the file and extract.
  96. Under "machine" menu, click on the Gear icon and select the checkbox for "show hidden files".
  97. Select "Create Directory".
  98. In the name field enter “.theme” and select CREATE.
  99. it has to be named as seen in the screenshot.
  100. Select the newly created ".theme" folder. Upload all the files from the zip archive into .theme folder.
  101. hit Ctrl+F5 and Enjoy.
  102. Step image Step image Step image
Back