Arduino and GoPro timelapse

As usual, something I want to do, but not sure how to do it or if it can be done.

I want to record a timelapse of a 3D printer with a moving bed. FOr the timelpase to be effective, rather than just take a picture every x seconds, when the bed may be in a different physical position, i want to take a picture that includes a given time lapse but only triggers when the bed is in a particular place.

So, a timer using millis() which expires, then makes the camera "live" so that the next time after that time that the bed passes a certain takes a photo.

I'm thinking a physical switch for the position might be the best idea...a contact that the bed closes as it passes over it. But I'm not sure how to get an Arduino to "talk" to a GoPro...wifi, maybe?

If anyone can point me to any libraries or anything like that I'd be grateful...there are a few threads on here about GoPro control but they all seem to involve physically busting into the GoPro...I'd rather not do that if possible.

And yes, I realise there are some commercially available products that do this...but y'know. Tinkering.

Additional; other idea I had was if there's any image recognition software for the GoPro, that would take a picture when the GoPro "sees" and "X" (or whatever) in a particular position...but that's not really Arduino-related...

Sync time with gopro and arduino

Set the gopro recording.

Set up your arduino to take a time stamp when it receives an event (pulse from your position switch, presumably a hall sensor or microswitch?)

Write a little script (python maybe?) that will take the timestamp, find it in the video, and take that still

Make video from the stills

Would that work for you?

Alternatively (I know nothing about go pro) is there not a shutter button on it that can accept a pulse from a position switch?

I am guessing that you want to capture the object in the same place each time so it just appears to “rise” from the build plate, and you are using a cartesian rather than a delta printer? If that is the case, why can’t you just stick the gopro on the build plate, and define that area in your firmware as an area to avoid? Or make a bracket that attaches your gopro to the build plate and puts it well out of harms way?

I'm not familiar enough with the GoPro's capability to suggest an approach with that device, but I've done time lapse photography with a Linux single board computer (similar to Raspberry Pi) using a USB camera. The approach was a Python script to capture images at intervals, save the images with sequential file names, and combine to MPEG using "ffmpeg". Such boards have GPIO that would be able to read position sensors, if one wanted to add such dependencies to the capture program. Also they are capable of doing image recognition, though I haven't explored that myself.

I've also done time lapse photography over several weeks using a freely available Android app on an old phone. In this case I edited the resultant MPEG after the fact to remove the uninteresting parts.

... following on from that ^ what are you using as the mainboard of your 3D printer..?

I have a couple of printers, one uses an Anet board with Marlin on there, the other an Arduino Due with Repetier...

A crazy thought, but you could embed something into the mainboard of your 3D printer? Slip something into the firmware or something into the gcode which takes a picture when your bed axis is of a certain value, once per Z position (or even when X and Y are of a certain value, so you get your print head in the same position every time)? That way you would get exactly the same position every time, and just one picture per layer.

The gcode approach may be the easiest way to do this..? You could even inject something in there to set X and Y to 0,0 and take a pic once per layer?