A crude timelapse hack tied to printhead temperature

I do remember that the built-in timelapse used to do recorded post-roll images, i.e. it would keep recording after the print has left the Raspberry Pi but the printer was still processing. Some time during the recent updates, this behavior changed and the post-roll was just the last image cloned for N seconds of timelapse. So my timelapses all did end like this:

After some digging through the configs and documentation, I couldn't find an answer (for a day or two I thought I had one, but actually I hadn’t ... the option capturePostRoll is in the docs, but not in the v 1.13.11 code ... yet or anymore? Not a clue ...)

So today I threw this incredibly hacky bash script together and tied it into the autostart (/etc/rc.local) to launch when the raspi comes on. (See: Built-in Timelapse ends before print ends )

  • It will in an endless loop, every few seconds call the REST api for the tool0 temperature.
  • If the temperature is above 170 degrees, it will do a curl call to the webcam, requesting a still image.
  • It will save this JPEG image with a timestamped filename into the folder /home/pi/autolapses
  • Sleep for a fixed number of seconds
  • Repeat.

Now I still do need to compress the collected JPEGs in a separate step (e.g. into MP4) but I once again get timelapses that do end like this:

As I said, it's incredibly hacky, but ... hey, it works! It starts before the print starts, and ends after the print ends. Maybe it's something somebody else has use for too.

Happy printing,

For the record, the "recent update" here was 1.3.7, released on April 9th 2018 :wink: The removal of post roll happened due to constant confusion associated with it (e.g. this ticket) that caused more harm than good, and was also mentioned in the changelog of 1.3.7.


This about coincides with my fragmented memory of things :wink: I'll remove the bug ticket I started ...

I've now begun to add ffmpeg to my script mix so I can one-step the whole process by taking the JPEGs and turning them into MP4 at two different speed settings, with auto-white/black, and an additional MP4 file with every 4 frames averaged into one output frame. I think I'll use "temp just fell below 150" as trigger. Also, need to use the filename info of the source to keep things a bit more organized. (late-night coding is always a surprise come next morning) I'll keep this thread updated :smiley: