What is the problem?
I am unable to keep OctoPrint paused (using the M0 command) when printing a complex part (approx 8MB Gcode file) to insert a component into the part. The amount of time the printer remains paused appears to be random. The last time that this happened, the printer remained paused for approximately 2 minutes before automatically resuming while I was half way inserting the components into the printed part.
What did you already try to solve it?
Added M0 as a "Long Running Command" in OctoPrint - Seems to have helped keep stepper motors on while paused.
Done a number to pause test prints, trialing if adding M85 S3600 (extending the inactive time of the printer) would make a difference - did not make a difference.
Numerous tests with gcode specifically to test pausing (a small square with a pause every 5 layers) - the printer behaves fine in this case, will pause up to 30 minutes consistently until timeout which is different behaviour to the part I am trying to print.
Logs (octoprint.log, serial.log or output on terminal tab at a minimum, browser error console if UI issue ... no logs, no support!) octoprint.log (108.0 KB)
Log attached, the failed pause is at 2020-01-03 05:41:54
Running successful pause test from 2020-01-03 10:33:03
Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)
OctoPrint 1.3.12
Enclosure Plugin
Telegram Plugin
Control via OctoRemote
Prusa i3 Mk3s 3.8.1 Firmware
Gcode extract which is failing:
;TYPE:CUSTOM
;added code by post processing
;script: PauseAtHeight.py
;current layer: 190
M83 ; switch to relative E values for any needed retraction
G1 F1500 E-1
G1 F300 Z58.3 ; move up a millimeter to get out of the way
G1 F9000 X245 Y205
M104 S0 ; standby temperature
M0 ; Do the actual pause
M109 S245 ; resume temperature
G1 F1500 E1
G1 F199.998 E1.5
G1 F1500 E-1
G1 F9000 X8 Y8
G1 F300 Z57.3 ; move back down to resume height
G1 F1500 E1
G1 F4800 ; restore extrusion feedrate
M82 ; switch back to absolute E values
G92 E166.98357
Gcode which works:
;TYPE:CUSTOM
;added code by post processing
;script: PauseAtHeight.py
;current layer: 5
M83 ; switch to relative E values for any needed retraction
G1 F300 Z2.8 ; move up a millimeter to get out of the way
G1 F9000 X190 Y190
G1 F300 Z15 ; too close to bed--move to at least 15mm
M104 S0 ; standby temperature
M117 Paused next 8
M0 ; Do the actual pause
M109 S245 ; resume temperature
G1 F300 Z2.8
G1 F9000 X8 Y8
G1 F300 Z1.8 ; move back down to resume height
G1 F1800 ; restore extrusion feedrate
M82 ; switch back to absolute E values
G92 E286.03857
;TYPE:CUSTOM
;added code by post processing
;script: PauseAtHeight.py
;current layer: 8
M83 ; switch to relative E values for any needed retraction
G1 F300 Z3.7 ; move up a millimeter to get out of the way
G1 F9000 X190 Y190
G1 F300 Z15 ; too close to bed--move to at least 15mm
M104 S0 ; standby temperature
M117 paused next 10
M0 ; Do the actual pause
M109 S245 ; resume temperature
G1 F300 Z3.7
G1 F9000 X8 Y8
G1 F300 Z2.7 ; move back down to resume height
G1 F1800 ; restore extrusion feedrate
M82 ; switch back to absolute E values
G92 E448.84635
;TYPE:CUSTOM
;added code by post processing
;script: PauseAtHeight.py
;current layer: 10
M83 ; switch to relative E values for any needed retraction
G1 F300 Z4.3 ; move up a millimeter to get out of the way
G1 F9000 X190 Y190
G1 F300 Z15 ; too close to bed--move to at least 15mm
M104 S0 ; standby temperature
M117 paused next 13
M0 ; Do the actual pause
M109 S245 ; resume temperature
G1 F300 Z4.3
G1 F9000 X8 Y8
G1 F300 Z3.3 ; move back down to resume height
G1 F1800 ; restore extrusion feedrate
M82 ; switch back to absolute E values
G92 E557.38565
Thanks for the info, but I'm trying to initiate the pause through Gcode, and I'm not looking for the printer to pause for hours. 30 minutes is enough time.
I might add that printing the file from an SD card, the behavior is fine. It only happens when using Octoprint.
Tried the print again and this time the printer again only paused for about 7 minutes or so. I recorded a serial log this time.
Any ideas what's going on here? I didn't see anything coming from the Prusa printer in the serial log below is the communication around the pause (the log file was too large to upload)
INFO - Pausing print job due to command M0
INFO - Not sending M0 to printer, it's configured as a blocked command
INFO - Print job paused - origin: local, path: 1_x_75mm_Filter_Module_Rev3_-_Gcode_Rev1.gcode, owner: pi, user: None
That appears to explain why M0 doesn't work in the log you sent.
There's no octoprint.log with this one, but I do see there's no M0 that occurs in this serial log. That would make sense if it isn't filtered out, and seems to be another indication that your first assertion was not done.
What does this mean? It works for some prints but not for others, or it works for prints with a fixed pause time and not for prints with an open-ended pause time?
Thanks for the input everyone. To make things easier I'll put the Octoprint.log and Serial.log in here so that they can be seen side by side:
Octoprint.log
2020-01-04 01:47:04,732 - octoprint.util.comm - INFO - Pausing print job due to command M0
2020-01-04 01:47:04,736 - octoprint.util.comm - INFO - Changing monitoring state from "Printing" to "Pausing"
2020-01-04 01:47:04,748 - octoprint.util.comm - INFO - Not sending M0 to printer, it's configured as a blocked command
2020-01-04 01:47:09,455 - octoprint.printer.standard.job - INFO - Print job paused - origin: local, path: 75-CARB_Body_Rev_3_x_1_Cover_Rev_2_x_1_-_Gcode_Rev_1.gcode, owner: pi, user: None
2020-01-04 01:47:09,484 - octoprint.plugins.telegram - INFO - Sending a message: Paused printing 75-CARB_Body_Rev_3_x_1_Cover_Rev_2_x_1_-_Gcode_Rev_1.gcode at 16%%. 11:11:14 remaining. with_image=False with_gif=False chatID= 669769055
2020-01-04 01:47:09,513 - octoprint.util.comm - INFO - Changing monitoring state from "Pausing" to "Paused"
2020-01-04 01:52:10,020 - octoprint.util.comm - INFO - Changing monitoring state from "Paused" to "Resuming"
2020-01-04 01:52:10,051 - octoprint.printer.standard.job - INFO - Print job resumed - origin: local, path: 75-CARB_Body_Rev_3_x_1_Cover_Rev_2_x_1_-_Gcode_Rev_1.gcode, owner: pi, user: None
2020-01-04 01:52:10,078 - octoprint.plugins.telegram - INFO - Sending a message: Resumed printing 75-CARB_Body_Rev_3_x_1_Cover_Rev_2_x_1_-_Gcode_Rev_1.gcode at 16%%. 11:11:14 remaining. with_image=False with_gif=False chatID= 669769055
2020-01-04 01:52:10,102 - octoprint.plugins.enclosure - INFO - Turning gpio to control temperature off.
2020-01-04 01:52:10,105 - octoprint.util.comm - INFO - Changing monitoring state from "Resuming" to "Printing"
2020-01-04 01:53:34,256 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:192.168.20.18
2020-01-04 01:53:34,666 - octoprint.server.util.sockjs - INFO - User pi logged in on the socket from client ::ffff:192.168.20.18
2020-01-04 01:53:39,940 - octoprint.util.comm - INFO - Changing monitoring state from "Printing" to "Cancelling"
2020-01-04 01:53:39,946 - octoprint.util.comm - INFO - Force-sending M108 to the printer
I have tried before removing M0 as a blocked command in OctoPrint thinking it would sort out the issue, but it didn't make any difference so I put M0 back as a blocked command.
My understanding is that the Prusa printer doesn't do the pause, OctoPrint does - OctoPrint should just stop sending commands to the printer whist in the paused state?
It works with the code I produced for testing, but not with the gcode of the part I actually want to print. This confuses me as well. If I run my test gcode - which is just a small square which has been sliced with exactly the same settings (just more pause points through the height), the printer does not auto resume. It will sit there paused until I resume the print, up to half an hour or more. I can't understand how that could be possible.
Actually, there is one difference come to think of it. In the test I put a LCD message (with M117 command), in the actual part gcode, there is no M117. Surely that couldn't be the source of this issue??
Gcode extracts of the test print and the part I am having problems with are below.
Pause Gcode at pause point
;TYPE:CUSTOM
;added code by post processing
;script: PauseAtHeight.py
;current layer: 5
M83 ; switch to relative E values for any needed retraction
G1 F300 Z2.8 ; move up a millimeter to get out of the way
G1 F9000 X190 Y190
G1 F300 Z15 ; too close to bed--move to at least 15mm
M104 S0 ; standby temperature
M117 Paused next 8
M0 ; Do the actual pause
M109 S245 ; resume temperature
G1 F300 Z2.8
G1 F9000 X8 Y8
G1 F300 Z1.8 ; move back down to resume height
G1 F1800 ; restore extrusion feedrate
M82 ; switch back to absolute E values
G92 E286.03857
Actual print Gcode at pause point
;TYPE:CUSTOM
;added code by post processing
;script: PauseAtHeight.py
;current layer: 8
M83 ; switch to relative E values for any needed retraction
G1 F1500 E-2
G1 F300 Z4 ; move up a millimeter to get out of the way
G1 F9000 X240 Y200
G1 F300 Z15 ; too close to bed--move to at least 15mm
M104 S0 ; standby temperature
M0 ; Do the actual pause
M109 S245 ; resume temperature
G1 F1500 E2
G1 F199.998 E2.2
G1 F1500 E-2
G1 F300 Z4
G1 F9000 X80.875 Y67.675
G1 F300 Z3 ; move back down to resume height
G1 F1500 E2
G1 F2100 ; restore extrusion feedrate
M82 ; switch back to absolute E values
G92 E130.20617
That's what I was suggesting, that someone who seems to be a moderator on the Prusa forum was hinting at (and in other threads describing) why Prusa doesn't want you to do pauses, presumably.