Power-Off Shutdown and Power-Loss Resume Printing
Important Notes
- Power-Off Shutdown and Power-Loss Resume Printing are mutually exclusive and cannot be enabled simultaneously.
- If only the Power-Off Shutdown function is enabled, the Power-Loss Resume Printing function cannot be used.
- Power-Loss Resume Printing requires Klipper to maintain a normal connection. After the function is triggered, the system will automatically enter the shutdown process.
Feature Configuration
- Power-Off Shutdown
- Power-Loss Resume Printing
Configure Power-Off Shutdown
Enter Device Configuration
- Enter the device IP address in the browser address bar, for example
http://<device_ip>/. - Show hidden files.
- Fluidd: Uncheck "Filter hidden files and folders".
- Mainsail: Check "Show hidden files".
Fluidd hidden file settings:
Loading...
Mainsail hidden file settings:
Loading...
Modify the Configuration File
- Find and enter the
.flyos-configfolder. - Open the
sys-config.conffile. This file is a symlink toconfig.txton theFlyOS-Confdisk.
Loading...
- Find the
shutdown_pin_stateandshutdown_pinconfiguration items, and modify them to:
shutdown_pin_state=1
shutdown_pin=<shutdown_gpio>
- Ensure
shutdown_pin=nonehas been deleted or commented out. - Save the modified configuration file and restart the system.
Loading...
Configure Power-Loss Resume Printing
Disable Power-Off Shutdown
Notes
- Power-Off Shutdown needs to be disabled, otherwise the Power-Loss Resume Printing function cannot be used.
- Power-Loss Resume Printing includes an automatic shutdown function after saving the progress.
- Please ensure that no other power supply is connected to the host machine, otherwise normal shutdown may not be possible.
- Enter the device IP address in the browser address bar, for example
http://<device_ip>/. - Show hidden files.
- Fluidd: Uncheck "Filter hidden files and folders".
- Mainsail: Check "Show hidden files".
- Enter the
.flyos-configfolder and open thesys-config.conffile. - Find the
shutdown_pin_stateandshutdown_pinconfiguration items, and add#before these two configurations to comment them out. - Save the modified configuration file and restart the system.
Loading...
Add Power-Loss Resume Printing Configuration
- On the printer configuration page, find or create a
plr.cfgfile. - Clear the file contents and paste the following configuration.
- Modify the
power_pinparameter according to your actual device. You must use a host GPIO or a pin recommended by the product, and cannot use a pin from the controller board (MCU/toolboard).
[mcu host]
serial: /tmp/klipper_host_mcu
[power_loss_resume]
power_pin: <power_loss_pin>
is_shutdown: True
paused_recover_z: -2.0
start_gcode:
# Gcode to execute before starting resume printing
# All parameters saved before power loss can be obtained via {PLR}
# Use M118 {PLR} to output all available parameters
# M118 {PLR}
M118 Start resume printing: {PLR.print_stats.filename}
M118 Interrupted position: X:[{PLR.POS_X}] Y:[{PLR.POS_Y}] Z:[{PLR.POS_Z}] E:[{PLR.POS_E}]
# Restore all heater temperatures
{% for name, heater in PLR.heaters.items() %}
{% if heater.target > 0 %}
M118 Set heater[{heater.name}] target temperature: {heater.target}
SET_HEATER_TEMPERATURE HEATER="{heater.name}" TARGET={heater.target}
{% endif %}
{% endfor %}
# Wait for extruder temperature
{% if PLR.toolhead.extruder in PLR.heaters and PLR.heaters[PLR.toolhead.extruder].target > 0 %}
{% set extruder = PLR.heaters[PLR.toolhead.extruder] %}
M118 Waiting for [{extruder.name}] to reach target temperature: {extruder.target}
TEMPERATURE_WAIT SENSOR="{extruder.name}" MINIMUM={extruder.target-5} MAXIMUM={extruder.target+5}
{% endif %}
M83 ; Relative extrusion
G1 E-2 F1000 ; Retract
G91 ; Relative coordinates
G1 Z2 F100 ; Raise Z, prepare for X,Y homing
G90 ; Absolute coordinates
G28 X Y ; Home XY
resume_gcode:
# Gcode to execute after moving to the target position, before starting the actual print
M83 ; Relative extrusion
G1 E4 F800 ; Extrude 4mm filament, compensate for oozing
layer_count: 2 # Execute layer_change_gcode after resuming printing for the specified number of layers
layer_change_gcode:
# Gcode to execute after resuming printing for {layer_count} layers
M118 Restoring print speed
M106 S{PLR.fan_speed} ; Turn on part cooling fan
M220 S{PLR.move_speed_percent} ; Set requested speed percentage
M221 S{PLR.extrude_speed_percent} ; Set requested extrusion speed percentage
shutdown_gcode:
# Gcode to execute before shutdown
M118 Low power supply voltage, shutting down
# M112 ; Emergency stop
Include the Configuration File
Open the printer.cfg file and add the following at the very beginning of the file:
[include plr.cfg]
Save and restart Klipper.
Configure Homing Override
Important Notes
- If using
[homing_override], do not arbitrarily set homing positions in the configuration. - Incorrect configuration may cause Power-Loss Resume Printing to fail.
[force_move]
enable_force_move: true
[homing_override]
axes: z
gcode:
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
{% if 'z' not in printer.toolhead.homed_axes %}
SET_KINEMATIC_POSITION Z=0
G90
G0 Z5 F600
{% endif %}
{% set home_all = 'X' not in params and 'Y' not in params and 'Z' not in params %}
{% if home_all or 'X' in params %}
G28 X
{% endif %}
{% if home_all or 'Y' in params %}
G28 Y
{% endif %}
{% if home_all or 'Z' in params %}
G0 X{max_x / 2} Y{max_y / 2} F3600
G28 Z
G1 Z10 F2000
{% endif %}
Functional Testing
Simulated Power-Loss Test
- Start printing any file.
- During printing, click the Emergency Stop button to simulate a power loss condition.
- Click Firmware Restart and wait for Klipper to reconnect.
- Observe whether a popup prompt appears on the web interface.
- Subsequently, a real power-loss test can be performed to verify the reliability of the function.
Real Power-Off Test
- Confirm the status of the indicator light next to the host computer; during normal operation, the LED should be blinking.
- Directly disconnect the power supply while the device is running normally.
- Observe whether the indicator light turns off completely within 5 seconds.
- Wait at least 5 seconds before reconnecting the power supply.
- If a resume-printing pop-up appears, it indicates that the power-off resume printing function is working properly.
Loading...