[OctoPi] Resuming a print that ran out of filament?

I just spent 3+ hours printing something that just needs to be capped off to seal up the very top layer, but it ran out of filament while using OctoPrint. Has anyone attempted this before?

One idea to accomplish this would be to measure the height of the incomplete print on the bed, and figure out where in the GCODE to resume the print more or less. I have no idea how to interpret all of the GCODE yet though. Then edit the GCODE and remove all of the codes at the beginning, manually heat up the extruder and run the GCODE without any other homing or nozzle wipe scripts. The trouble though is if there are any mistakes, the extruder is going to collide with this big part on the bed and probably rip the bed off of it’s magnetic mounts or worse.

It sure would be nice in the future to have the print automatically pause after it detects the filament missing in the lower feeder (there is a microswitch there which I’m assuming is ignored now with octoprint). That way I could notice it, or possibly create a push notification plugin that alerts me that I’m out of filament. Maybe the Zimboard would need to detect this (I’m sure it does already) and send a special Pause command to OctoPrint?

Should be possible to salvage your print, but will need some custom gcode. I think the process you stated sounds like the best way. If your slicer has a preview option, you can use it to find the layer and continue from there. I’ve done this to switch colors mid-print before, and it works great. In my case I use the preview in simplify 3d to identify the exact layer. I then insert a pause at this layer in the gcode. I can then lower the bed, swap out the filament, whatever, and click continue in octoprint to continue where it left off. See this post for more info on how it’s done: http://forum.makergear.com/viewtopic.php?f=3&t=2132

To resume a print that totally failed and cannot be resumed with Jpod’s method, is possible, but you have to look for several things.

If you did not see at what layer or print height you print stopped, first measure your print at several points to make sure you get a correct value.
Next look for a setting in your slicer to start printing at height:

Next make sure that your start scripts don’t include commands that run the printhead in the already printed object, e.g. homing commands.
Think about reducing the first solid layers to 1 or 0.
Slice again and restart the print.