I’ve had to stop printing several times due to technical difficulties. Because I’m not near my computer to log in to Octo, I cancel it from the printer screen. The printer stops and clears the print job, but then it restarts printing until I unplug the USB wire.
Is this something you frequently encounter? I’ve got the solution for you!
Well, it might be as easy as the buffer being full and a large number of commands still in the printer’s buffer.
It happens to me occasionally as well when the printer is running some lengthy commands that are still in progress and are continuing to get into progress after the cancel (or pauze) command has been delivered.
For example, when printing the first layer all over the 300×300 buildplate at a speed of 5 or 15 mm/s and slowly moving inward, it can take up to 5 minutes until the printer’s buffer is emptied and the print is canceled or paused.
Of course, this can be exacerbated if the gcode instructs the printer to do a temperature change, such as from first-layer to next-layer with an increase or decrease in bed temperature. Before running the following line of gcode, the printer will ‘wait’ until the new temperature has stabilized.
Finally, after the printer has handled with the last line in the buffer, it returns to Octoprint as ‘cancelled’ or ‘paused’.
When the first layer does not stick properly, I simply push the reset button on the printer or on another printer simply pull the serial(USB) cable on the printer or turn the power of the printer (not the PI!) off.
Option One: The quickest solution is to reset the LCD, then wait and reconnect the printer in Octoprint. In the worst-case scenario, power cycle and reset the pi.
As long as EMERGENCY PARSER is enabled in your firmware, M108 will be able to cancel heat-ups, and this is what OctoPrint will transmit if EMERGENCY PARSER is identified as enabled in your firmware when you push cancel.
Solution 2: If you construct marlin from scratch, you can add a menu option to send a cancel command to Octoprint.
Option Three: If it’s a blocking temperature issue, you can enable the marlin option EMERGENCY PARSER, which will actually stop the temperature on cancel from octoprint even if it hasn’t been reached.
But, if your printer is awaiting a temperature change, it will be locked on a single line of gcode. When you press the “pause” or “stop” button in Octoprint, it just stops delivering gcode to the printer. If the printer is still processing the previous few lines sent, it may take some time if one of those processes involves waiting for anything that is taking longer than expected.
To be honest, if you have a power supply problem, it is most likely the source of a slew of other problems that you have been ignoring up to this point. You are slightly distinctive due to a power supply problem. Your situation is fairly unique. Taking away your distinctiveness in one area may not solve the problem in another, but we won’t know for sure unless you do it.
It is dependent on your firmware, its capabilities, and the buffer. For example, in Marlin, if the EMERGENCY PARSER is enabled (it is disabled by default), it can bypass waiting for temperatures, etc.
OctoPrint gets stuck in Cancelling state
So the issue is that your printer responds differently to the M114 that OctoPrint sends on cancel in order to record the position for prospective print recovery plugins to use. It is unable to identify this response, causing it to stall (what it looks for is rather X:-3.8 Y:-63.3 Z:0.2 E:0.2 as defined here – note the different order and lack of mm).
Disable “Log position on cancel” under Settings > Serial Connection > Behaviour > Event-based position reporting as a workaround. It will prevent it from attempting to log that location, and everything should be OK.
Long-term solutions include either a plugin that modifies this non-standard response to conform to the standard, or firmware that is modified to utilize the universally recognized format instead. Because you mention using a Replicape as a controller, he may be able to weigh in on if changing the response in the firmware is an option.