What is the problem?
am trying to use the M0 command to pause the printer at the required height to change the filament. However, when it is in G-code M0, the printer does not pause but displays:
when I press continue, the printer uses a pause script.
I want the printer to automatically use the pause script during the pause, and I don't have to manually press continue.
(Sorry for my English)
What did you already try to solve it?
I tried to change the pause command to M25. It didn't help.
Have you tried running in safe mode?
Did running in safe mode solve the problem?
I dont know.
octoprint-systeminfo-20210721225233.zip (89.8 KB)
You may use M600 instead of M0
@pause, which will go directly to OctoPrint and never to the printer. You can setup your pause scripts in OctoPrint, and they will be immediately executed as the printer has no knowledge of the pause, only OctoPrint.
Does that have any mechanism for buffered data already in the printer?
What do you mean by that? The
@pause command here is basically the same as hitting 'pause' in OctoPrint's UI, but triggered using gcode. As soon as OctoPrint encounters this command in the file, it will stop sending any commands to the printer and will enter the 'paused' state.
OctoPrint does, when you pause (any method of pausing) send an
M400 which instructs the printer to clear the buffer then returns control when it has done so.
Hopefully that helps?
Correction, it instructs the printer to wait for all moves in the planning buffer to finish before returning control. Depending on the size of the buffer there can thus indeed be a delay when pausing via OctoPrint vs firmware. However, there is no actual standardized firmware side pause command. M0 and M1 will often also put the printer into something similar to kill mode. Or - apparently - do something completely arbitrary as witnessed here. M25 technically only applies to SD prints controlled by the printer (yet some firmware also interprets it as the initiation of some pause routine while streaming a print). M600 also unloads and reloads filament. In short: it's yet again an absolute mess.
Is there a solution to my problem?
In short: I want the printer to pause as soon as it is in g-code M0 - it used the script in octoprint ... Is it possible?
Would it help to enable EMERGENCY_PARSER and perhaps HOST_ACTION_COMMANDS in Marlin. I'm pretty fuzzy about exactly what they do, perhaps one of the guru's could weight in?
As someone else has already stated, try M600 instead of M0. M600 is specifically for a filament change.
There will always be some gcode lines in the input buffer of the printer.
G1 X192.836 Y148.722 E0.01784 ; already printed
G1 X194.277 Y150.163 E0.06600 ; already printed
G1 X193.727 Y150.163 E0.01784 ; just sent, but in the input buffer
G1 X192.737 Y149.173 E0.04533 ; just sent, but in the input buffer
G1 X192.737 Y149.724 E0.01784 ; just sent, but in the input buffer
G1 X193.350 Y150.338 E0.02809 ; just sent, but in the input buffer
M204 S1000 ; just sent, but in the input buffer
@pause ; will not be sent but initiates the pause mode in OctoPrint until you resume the print
; stop printing object test.stl id:0 copy 0
G1 E-0.05000 F2400.000
G1 Z4.800 F10800.000
; printing object test.stl id:0 copy 0
G1 X192.446 Y148.432
G1 E1.00000 F2400.000
If you use
M600 at the place you want it, the printer will
print the stuff before that command and when OctoPrint and printer go to pause mode, you can do your filament change.
I assume you have some commands in the GCODE script section of OctoPrint so that you can safely do that filament change.