Skip to content

Commit 0ebc472

Browse files
committed
Improve placeholder files for {klipper,moonraker}-includes
Add USB drive `moonraker-recover.txt` method.
1 parent d0e2a7b commit 0ebc472

File tree

6 files changed

+49
-7
lines changed

6 files changed

+49
-7
lines changed

docs/klipper_includes.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,20 @@ aspect_ratio: 16:9
5454
- All `.cfg` files in the `klipper/` folder are automatically included.
5555
- All `.cfg` files in the `moonraker/` folder are automatically included.
5656
- Configuration files persist across reboots.
57+
- Placeholder files (`00_keep.cfg`) are automatically created in both folders with helpful comments.
58+
- Do not modify or remove the `00_keep.cfg` placeholder files.
5759
- Test changes carefully to avoid breaking the printer configuration.
5860
- Invalid configuration will prevent Klipper/Moonraker from starting.
59-
- If you break Moonraker, the printer will not connect to WiFi next time.
60-
To recover, connected Ethernet adapter or rollback to Basic firmware
61-
and remove the added Moonraker configs.
61+
62+
## Recovery from Moonraker Issues
63+
64+
If you break Moonraker with an invalid configuration, the printer will not connect to WiFi on next boot.
65+
66+
To recover:
67+
68+
1. Create an empty file named `moonraker-recover.txt` on a USB stick
69+
2. Insert the USB stick into the printer
70+
3. Restart the printer
71+
4. The Moonraker configuration folder will be backed up to `moonraker.bak`
72+
5. Moonraker will start with a fresh configuration
73+
6. Remove the USB stick and the `moonraker-recover.txt` file will be automatically deleted

overlays/enable-klipper-includes/root/etc/init.d/S55include_keeps

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,35 @@
22

33
start() {
44
mkdir -p /home/lava/printer_data/config/klipper
5+
cat <<EOF > /home/lava/printer_data/config/klipper/00_keep.cfg
6+
# Create file similar to this to enable Klipper includes
7+
# Do not modify nor remove this file.
8+
#
9+
# Adding config files here will be loaded on next system restart
10+
# and when saving via Fluidd/Mainsail.
11+
# You can force restart from SSH: /etc/init.d/S60klipper restart
12+
EOF
13+
14+
if [ -f /mnt/udisk/moonraker-recover.txt ]; then
15+
if [ -d /home/lava/printer_data/config/moonraker ]; then
16+
mkdir -p /home/lava/printer_data/config/moonraker.bak
17+
mv /home/lava/printer_data/config/moonraker/* /home/lava/printer_data/config/moonraker.bak
18+
fi
19+
rm -f /mnt/udisk/moonraker-recover.txt
20+
fi
21+
522
mkdir -p /home/lava/printer_data/config/moonraker
6-
touch /home/lava/printer_data/config/klipper/00_keep.cfg
7-
touch /home/lava/printer_data/config/moonraker/00_keep.cfg
23+
cat <<EOF > /home/lava/printer_data/config/moonraker/00_keep.cfg
24+
# Create file similar to this to enable Moonraker includes
25+
# Do not modify nor remove this file.
26+
#
27+
# The config files added will be loaded on next system restart.
28+
# You can force restart from SSH: /etc/init.d/S61moonraker restart
29+
#
30+
# If the include casues Moonraker issues, the WiFi will not connect.
31+
# Create the file named "moonraker-recover.txt" on USB stick and restart printer.
32+
EOF
33+
834
chown -R lava:lava /home/lava/printer_data/config
935
}
1036

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# Create file similar to this to enable Klipper includes
1+
# Placeholder file to ensure the directory exists for Klipper includes.
22
# Do not modify nor remove this file.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# Create file similar to this to enable Moonraker includes
1+
# Placeholder file to ensure the directory exists for Moonraker includes.
22
# Do not modify nor remove this file.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Create file similar to this to enable Klipper includes
2+
# Do not modify nor remove this file.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Create file similar to this to enable Moonraker includes
2+
# Do not modify nor remove this file.

0 commit comments

Comments
 (0)