After starting printing, no commands are accepted, such as changing the bed temperature, even canceling printing does not work, the printer only starts responding after the hotend and bed are heated. What can be done?
Hi MistKear,
(no personal affront, we need facts, especially “klippy.log”!!!)
Please fill it out!!!
Helping people here are getting bored and a little angry, if you don’t!
Basic Information:
Printer Model:
MCU / Printerboard:
klippy.log
Fill out above information and in all cases attach your klippy.log file. Pasting your printer.cfg is not needed
Be sure to check our Knowledge Base and in particular this and this post
Describe your issue:
…
There are some commands that can not be interrupted.
For example M109 and M190.
BTW:: Same is for Marlin.
@hcet14 :
This is not the General Discussion sub forum.
There is no template in Features.
Please be careful with what you are proclaiming and also the attitude.
Even if the OP has chosen the wrong sub forum, there are nicer ways to communicate.
Sorry, I missed that.
Didn’t know that.
? attitude? Was I unfriendly? If yes, I apologise, sorry.
Sorry, it was never my intention to be unfriendly. I don’t like unfriendly! I appreciate the way people are talking here.
Did you get the problem, MistKear asked for?
Kind regards, hcet14
On my other printer (FB Ghost 4s) which had “marlin”, now “shui” firmware, in all firmwares you can safely cancel printing immediately, as well as change the heating temperature. The printer responds to all clicks, not counting movements.
I have this one built according to the Mercury Zero G project, it costs Pi3b +, mcu SKR v2.
Unfortunately, this is a problem for me due to the fact that I cannot cancel printing immediately, I have to press “Emergency Stop”
Sure the gcode used M109/M190 in the beginning and not M104/M140 ?
What is “shui” firmware"?
Good luck, hcet14
As I understand it, if you use M104 / M140, then the printer will start printing without waiting for heating, is that right?
I use M190/M109 in the start macro.
It’s not that easy.
M104/M140 start the heating and return back to the gcode scheduler.
But for printing you need certain temperatures that have to bee reached. For this are M109/M190.
More info here (seek for the commands)
- As indicated by @EddyMI3D, these command cannot be reliably interrupted (except by a
M112emergency stop) - The Klipper developer already attempted to implement this function, but this left the printer in an unreliable state. It is a core functionality that the firmware precisely executes a command that is scheduled in a so-called queue with a bunch of the following commands. Messing with this apparently is quite complex
- See New gcode to interrupt the pending command queue for more details
- Usually the non-blocking variants or Klipper’s special gcodes should be sufficient to achieve your goal
@hcet14
Before commenting on a particular topic, taking the time to gain a thorough understanding of the subject matter can greatly enhance the quality of the discourse. This allows for meaningful and informed contributions, fostering a more productive approach overall.
Therefore, I kindly request that you consider investing time in researching and familiarizing yourself with the topic at hand before sharing your thoughts. This practice will enable us to have more meaningful exchanges that are based on accurate information and thoughtful insights.
I don’t understand, this is implemented in Marlin and SHUI, here, in the most functional firmware, this is not.
In Marlin, I can immediately change the temperature to which the printer must warm up before starting to print, I can immediately cancel printing if I see any problem in the print settings.
How is it implemented?
I tried to use it, it didn’t work, the same thing, heating starts until it reaches the temperatures set by the slicer, the printer does not respond to any commands.
I cannot comment on this. It has been attempted by the lead developer and no solution was found.
The non-blocking version works as expected.
It actually won’t cancel until PRINT_START has finished in it entirety. I just emergency stop. It is pretty annoying to be honest. I have temperature wait, heaters heating, bead mesh, and line purge in there. Not waiting for all that.
Macros can not be interrupted.
One more reason to use as few macros as possible.
Most macros are overburdened anyhow.
The possibility that something can be done does not mean it has to be done.
A well made start script in the slicer runs as well and so after every command a cancel can be executed.
State Machine Using Delayed MACRO Works For Me.
The Below Is A Start Print Example.
Must Also ModIfy Pause_Resume.Py And Pause, resume, And Cancel Macros.
I Could Not Find Anything Like This. And I Have Searched Lots.
This Took Some Brainstorming To Figure Out.
…corexy Quick Home Needs Some Looking Into NExt! …Just Because
If The Other Firmware Can Do It Then Klipper Should Be Able!
[gcode_macro START_PRINT]
#START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0}
variable_stage : ‘’
variable_target_bed : 0
variable_target_extruder : 0
gcode:
{% set TARGET_BED = params.BED_TEMP | default(0) | float %}
{% set TARGET_EXTRUDER = params.EXTRUDER_TEMP | default(0) | float %}
{% set STAGE = ‘“PREHEAT”’ %}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=target_bed VALUE={TARGET_BED}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=target_extruder VALUE={TARGET_EXTRUDER}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=stage VALUE=‘“PREHEAT”’
CLEAR_PAUSE
PAUSE so that the print does not continue until the DELAYED_GCODE executes a RESUME
PAUSE MOVE=0
UPDATE_DELAYED_GCODE ID=_START_PRINT DURATION=0.01
[delayed_gcode _START_PRINT]
######################################################################################################
make certain this block is contained in your CANCEL_PRINT macro if using this delayed_gcode
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=stage VALUE=‘“CANCELED”’
######################################################################################################
gcode:
{% set ps = printer[“gcode_macro START_PRINT”] %}
{% set STAGE = ps.stage %}
{% if STAGE == ‘PREHEAT’ %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={ps.target_bed} ; Start heating, do not wait
M118 Bed heating to {ps.target_bed}C…
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=140 ; preheat extruder, do not wait
M118 Extruder heating to 140C…
{% set STAGE = ‘HEATING_BED’ %}
{% endif %}
{% if STAGE == ‘HEATING_BED’ %}
{% if printer.heater_bed.temperature >= ( ps.target_bed * 0.95 ) %} #if > 95% of target then continue
#M118 Bed heated to {ps.target_bed}C…
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={ps.target_extruder}
M118 Extruder heating to {ps.target_extruder}C…
{% set STAGE = ‘HEATING_EXTRUDER’ %}
{% endif %}
{% endif %}
{% if STAGE == ‘HEATING_EXTRUDER’ %}
{% if printer.extruder.temperature >= ( ps.target_extruder * 0.95 )%} #if > 95% of target then continue
#M118 Extruder heated to {ps.target_extruder}C…
M118 PREHEAT FINISHED
{% set STAGE = ‘FINISHED’ %}
{% endif %}
{% endif %}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=stage VALUE=‘“{STAGE}”’
{% if STAGE != ‘CANCELED’ %}
{% if STAGE != ‘FINISHED’ %}
UPDATE_DELAYED_GCODE ID=_START_PRINT DURATION=2
{% else %}
M190 S{ps.target_bed}
{% if printer.toolhead.homed_axes != 'xyz' %}
G28 #Home All Axes
{% endif %}
M109 S{ps.target_extruder}
G92 E0 ;Reset Extruder
; Extrude a single fat prime line
G1 X10 Y70 Z0.30 F5000
G1 X10 Y20 Z0.30 F1500 E10
G92 E0 ;Reset Extruder
G1 Z2.0 F3000 ;Move Bed up
RESUME MOVE=0
{% endif %}
{% endif %}
Hello @thecalman !
Thank you for your late input.
But please format all of the code as Preformatted text. Else due to reformatting, the code might become unusable.

While you can’t abort temperature_waits in mainline Klipper, if anyone’s interested, I was able to implement this in my fork of Klipper (also I merged PR #6662 into my fork).
- Instant cancellation via webhooks (cancel button in Mainsail/Fluidd) feat: Instant print cancellation by G-code API · Klipper3d/klipper@2260fe7 · GitHub
- Instant cancellation via G-code webhook (
CANCEL_PRINTcommand in Mainsail/Fluidd console) feat: Add instant print cancellation · Klipper3d/klipper@372bdf4 · GitHub
Essentially, when a cancel command is detected in the queue, it aborts all heating then runs the usual CANCEL_PRINT macro.
didn’t know how to format, thank you. Also I provided an old unused copy i had on my phone! …and phone editing is tough (for me!).
Please find below, my current START_PRINT macro(s).
Late?! …just trying to provide a solution to the problem as originally posted! A solution I have not been able to find online! …and is not provided here!
having no other way but to to use an emergency stop (M112) for this is shameful and a big waste of time!
This macro will allow for timely/instant cancellation and temperature changes immediately after starting a print.
[gcode_macro START_PRINT]
#START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0}
#;;; KEEP THE BELOW SO THAT KLIPPER CAN PROVIDE A 'Preheat' CONTEXT OPTION
#M190 S{material_bed_temperature_layer_0}
#M109 S{material_print_temperature_layer_0}
#;;;
### MUST HAVE MODIFIED pause_resume.py and pause, resume MACROS!
variable_target_bed : 0
variable_target_extruder : 0
variable_initial_extruder : 140
variable_stage : 'PREHEAT'
gcode:
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=target_bed VALUE={params.BED_TEMP | default(0) | float}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=target_extruder VALUE={params.EXTRUDER_TEMP | default(0) | float}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=stage VALUE='"PREHEAT"'
CLEAR_PAUSE
# pause without moving (do not retract and do not park toolhead). the print will continue when DELAYED_GCODE executes a non-moving RESUME
PAUSE MOVE=0
UPDATE_DELAYED_GCODE ID=_START_PRINT DURATION=0.01
[delayed_gcode _START_PRINT]
gcode:
{% set ps = printer["gcode_macro START_PRINT"] %}
{% set STAGE = ps.stage %}
{% set TARGET_BED = printer.heater_bed.target %}
{% set TARGET_EXTRUDER = printer.extruder.target %}
{% if printer.print_stats.state != 'cancelled' %}
{% if STAGE == 'PREHEAT' %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={ps.target_bed} ; Start heating, do not wait
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={ps.initial_extruder} ; preheat extruder, do not wait
RESPOND msg='Bed target set to: {ps.target_bed}C' color=accent
RESPOND msg='Extruder target set to: {ps.target_extruder}C ...preheating to {ps.initial_extruder}C' color=accent
{% set TARGET_BED = ps.target_bed %}
{% set TARGET_EXTRUDER = ps.target_extruder %}
{% set STAGE = 'HEATING_BED' %}
{% endif %}
{% if STAGE == 'HEATING_BED' %}
{% if TARGET_BED != ps.target_bed %}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=target_bed VALUE={TARGET_BED}
RESPOND msg='Bed target has changed from: {ps.target_bed} to: {TARGET_BED}C' color=accent
{% endif %}
{% if TARGET_EXTRUDER != ps.initial_extruder and TARGET_EXTRUDER != ps.target_extruder %}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={ps.initial_extruder}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=target_extruder VALUE={TARGET_EXTRUDER}
RESPOND msg='Extruder target has changed from {ps.target_extruder} to: {TARGET_EXTRUDER}C' color=accent
{% endif %}
{% if printer.heater_bed.temperature >= ( TARGET_BED * 0.95 ) %} #if > 95% of target then continue
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={ps.target_extruder}
RESPOND msg='Extruder heating to {ps.target_extruder}C' color=accent
{% set STAGE = 'HEATING_EXTRUDER' %}
{% endif %}
{% endif %}
{% if STAGE == 'HEATING_EXTRUDER' %}
{% if printer.extruder.temperature >= ( ps.target_extruder * 0.95 )%} #if > 95% of target then continue
RESPOND msg='PREHEAT FINISHED' color=accent
{% set STAGE = 'FINISHED' %}
{% endif %}
{% endif %}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=stage VALUE='"{STAGE}"'
{% if STAGE != 'FINISHED' %}
UPDATE_DELAYED_GCODE ID=_START_PRINT DURATION=2.0
{% else %}
M190 S{ps.target_bed}
{% if printer.toolhead.homed_axes != 'xyz' %}
G28 #Home All Axes
{% endif %}
M109 S{ps.target_extruder}
G92 E0 ;Reset Extruder
; Extrude a single fat prime line
G1 X10 Y70 Z0.30 F5000.0
G1 X10 Y20 Z0.30 F1500 E10
G92 E0 ;Reset Extruder
G1 Z2.0 F3000 ;Move Bed up
# resume without moving (do not return toolhead to paused position and do not extrude (prime))
RESUME MOVE=0
{% endif %}
{% else %}
RESPOND msg='PRINT WAS CANCELLED!!' color=error
{% endif %}

