Ender 3 - Klipper firmware documentation & config (#21)

Reviewed-on: #21
This commit was merged in pull request #21.
This commit is contained in:
2025-03-05 15:51:57 +01:00
parent d447266bc8
commit 06a3605dbf
9 changed files with 162 additions and 2 deletions

View File

@@ -8,10 +8,12 @@
6. [Printer calibration](#printer-calibration)
7. [3D printed custom parts & mods](#3d-printed-custom-parts--mods)
8. [BBT SKR mini E3 v2 pinout](#btt-skr-mini-e3-v2-pinout)
9. [Klipper custom firmware](#klipper-custom-firmware)
# Octoprint backup archive
[2025-01-01] [Ender3-backup-20250211-234353.zip](octoprint-cfg-bkp/Ender3-backup-20250211-234353.zip)
[2025-02-11] [Ender3-backup-20250211-234353.zip](octoprint-cfg-bkp/Ender3-backup-20250211-234353.zip)
# Slicers
@@ -236,6 +238,9 @@ After firware update, proceed with the different calibrations in the above order
| Filament runout sensor | n/a | ![show off](images/mods/filament-runout.jpg) |
| Filament Guide | [Thingiverse](https://www.thingiverse.com/thing:6930315) | ![show off](images/mods/filament-guide.jpg) |
| Gantry led holder | n/a | ![show off](images/mods/gantry-led-holder.jpg) |
| Filament runout sensor | n/a | ![show off](images/mods/filament-runout.jpg) |
| Filament Guide | [Thingiverse](https://www.thingiverse.com/thing:6930315) | ![show off](images/mods/filament-guide.jpg) |
| Gantry led holder | n/a | ![show off](images/mods/gantry-led-holder.jpg) |
| Aukey LM1 WebCam holder | [Thingiverse](https://www.thingiverse.com/thing:4683831) | ![show off](images/mods/aukey-LM1-webcam-holder.jpg) |
| PSU exhaust fan silencer | [Printable](https://www.printables.com/model/84197-60mm-exhaust-fan-silencer-flowmaster-psu-ender3nep/comments#preview.file.GpvjC) | ![show off](images/mods/psu-exhaust-fan-silencer.jpg) |
| Tool holder | [Local](local-stl/Tools_Holder_v3.stl) | ![show off](images/mods/tool-holder.jpg) |
@@ -243,4 +248,159 @@ After firware update, proceed with the different calibrations in the above order
# BTT SKR mini E3 v2 pinout
![BBT SKR mini E3 v2 pinout](images/BTT-SKR-mini-E3-v20-pinout.png)
![BTT SKR mini E3 v2 pinout](images/BTT-SKR-mini-E3-v20-pinout.png)
# Klipper custom firmware
## Klipper configuration backup
2025-03-05 : [klipper-config-files-20250305-150641.zip](klipper/config/klipper-config-files-20250305-150641.zip)
- Initial config save
## Printer firmware build and update
1. Access klipper host using ssh
```
ssh ender3k
```
2. Stop Klipper service
```
sudo service klipper stop
```
3. Browse to Klipper directory:
```
cd ~/klipper
```
4. Pull the last version of the Klipper firmware from Github:
```
git pull
```
5. Clean up working directory before building firmware
```
make clean
```
6. Check the firmware build configuration
```
make menuconfig
```
![Klipper firmaware build configuration](klipper/img/klipper-skr-mini-e3-v2-fw-config.png)
7. Build the firmaware:
```
make
```
8. Transfer the built firmware on an micro SD card
The built firmware `klipper.bin` is in the `~/klipper/out/` directory
Use a SCP client to retreive it, and rename it **`firmware.bin`**.
9. Flash the new firmware to the printer's SKR mini E3 v2 board
1. Turn off the printer power.
2. Introduce the SD card into the SKR board reader
3. Turn back on the printer power.
11. Restart Klipper service
```
sudo service klipper start
```
12. Check Klipper service is properly restarted
```
sudo service klipper status
```
![Klipper service status check](klipper/img/ender3-klipper-service-started.png)
## ADXL345 accelorometer
Model used: [Aliexpress](https://www.aliexpress.com/item/1005006515088013.html) \
![Klipper ADXL345 config](klipper/img/klipper-adxl345-printer-config.png)
### Software prereqiusites
Note that resonance measurements and shaper auto-calibration require additional software dependencies not installed by default. First, run on your Raspberry Pi the following commands:
```
sudo apt update
sudo apt install python3-numpy python3-matplotlib libatlas-base-dev libopenblas-base
```
Details on Klipper [documentation](https://www.klipper3d.org/Measuring_Resonances.html#software-installation)
### Firmware configuration and build
1. Configure the firmaware:
```
cd ~/klipper
make clean
make menuconfig
```
![ADXL345 Firmare config](klipper/img/klipper-adxl345-fw-config.png)
2. Build the firmware:
```
make
```
### Firmware flash
1. Set the ADXL345 board in DFU mode by plugin it to the USB cable while maintaining the RST switch down.
2. Check that the board is actually in DFU mode
```
lsusb
```
![ADXL345 board in DFU mode](klipper/img/ender3-adxl345-dfu-mode.png)
4. Note the device `ID` (in our example: `2e8a:0003`)
5. Flash the firmware
```
make flash FLASH_DEVICE=2e8a:0003
```
Once flashed, the board will automatically reboot and goes back in operation mode.
# Auto-reconnect printer after power-on
[Source](https://arnav.jain.se/2020/auto-restart-klipper-when-ender3-connected-to-pi/) by Arnav Jain. \
[Wallabag backup](https://wallabag.igox.org/view/211)
---
Start off by accessing klipper host using ssh.
```
ssh ender3k
````
Then create the `98-klipper.rules` file in the `/etc/udev/rules.d/` folder:
```
sudo touch /etc/udev/rules.d/98-klipper.rules
```
Retreive `idVendor` and `idProduct` for the Klipper MCU:
1. Retrieve Klipper MCU ID
```
lsusb
```
![Find Klipper MCU ID](klipper/img/ender3-find-mcu-id.png)
2. Retrieve `idVendor` and `idProduct` using the Klipper MCU ID
```
lsusb -v -d 1d50:614e | grep id
```
![idVendor and idProduct](klipper/img/ender3-klipper-mcu-idvendor-idproduct.png)
Then add the following text into the `98-klipper.rules` file just created:
1. Edit the `98-klipper.rules` file
```
sudo nano /etc/udev/rules.d/98-klipper.rules
```
2. Add text (remove the `0x` at the begining of the IDs)
```
## rule to restart klipper when the printer is connected via usb
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="614e", ACTION=="add", RUN+="/usr/bin/sudo -u pi /bin/sh -c '/bin/echo RESTART > /home/pi/printer_data/comms/klippy.serial'"
```
Finally, re-load the udev rules:
```
sudo udevadm control --reload-rules
```