I think octoprint explicitly does not support power recovery since there is no obvious way to implement it and it might require some form of hardware support.
I actually made a piece of software that helps you resume prints, and I might make it into an octoprint plugin. It should work for power outage type failures.
The topic above:
The M600 means that you could break your gcode with a manually inserted (maybe in cura) M600 command at a position of your choie, which means it works like a filament runout so the machine goes to parking position and let you (re)-fill material.
After some amount of moves (maybe every move?) check the filament status (M412?)
If empty, send M600, otherwise go to top of loop
?
Will that introduce a significant slowdown (waiting for each 412 to come back) to the print? I could see this really messing with print speed/times, with frustrating results for people who already have cooling / temps dialed in.
Send M412 every 10 seconds using repeating command: OctoPrint_RepeatingCommand
Regex parse the response and if it matches the out of filament response (filament\: open or filament\: TRIGGERED, can’t remember what’s normal) send M600 to pause for filament change: Terminal Response
this is what i plan to try first when my senor arrives on tuesday… Filament Sensor Simplified (octoprint.org) i couldn’t find a plugin designed to issue a time based gcode command… one could use this to process the response once you figure out how to issue M412 every 10 seconds… Terminal Response (octoprint.org)
–update3-- quoting fixed so it runs on pi console, still cant get the plugin to execute it
this seems to be the curl curl -s http://octopi.local/api/printer/command -d "{\"command\":\"M412\"}" -H "Content-Type: application/json" -H "X-Api-Key: <yourkeyhere>"
it works fine remotely from my windows machine and locally on the octopi, i can find no evidence the repeating command plugin actually works or does anything…
I wonder how it works. I know that all my new commands are ignored until the current batch has finished, could that be an issue? Maybe try another command that just returns something simple like current position or a settings current value, any simple gcode command, and then watch the terminal tab in octoprint like a hawk for the expected response (you may not see it send the command)…
When I’m not printing, this works and outputs my config on the terminal tab and shows the command being sent (add space separated API key and closing speech marks) curl -s http://octopi.local/api/printer/command -d "{\"command\":\"M503\"}" -H "Content-Type: application/json" -H "X-Api-Key:
There is another thread where I commented about this, but Octoprint now has this ability built-in, as long as the printer firmware also supports it. However, the functionality in Octoprint is disabled by default. I think it was released in October 2021. Check out the documentation for more information.
Struggling to find it on octoprint and your activity is huge
The firmware config Configuration.h Line1111 suggests it calls m600 itself if nothing else configured, but if the host sends M412 H it overrides that and passes control over to the host on runout.
Host Action Commands is the feature that must be enabled in both the printer firmware (Marlin), and in Octoprint. Here are some related links and videos: