When making timelapses, I use a Canon DSLR that is triggered by an arduino and relay to take the pictures. Currently, I use the CameraStart event to send a serial command to the arduino. This works well with the built in timelapse function of Octoprint but not with Octolapse as it doesn't trigger this event. I have only tried to run a timelapse in test mode.
Would it be possible to make Octolapse call an event when a picture is taken so external cameras can be used?
Information on events: http://docs.octoprint.org/en/master/events/
Octolapse Version: Vv0.3.0rc1
OctoPrint Version: 1.3.7rc4 on Octopi 0.13.0
You are not the first person to mention adding camera hooks of some kind, but you are the first to request that I utilize the built in event. I will look into it for sure. Here are some initial thoughts:
I guess this boils down mostly to settings. How do I change the camera and rendering profiles without making it confusing for users. Some other people wanted GPIO functionality for things like triggering an external flash, and such, so maybe I need to think about these things together.
That being said, I'd LOVE to capture some ultra high res timelapses. Maybe there could be a way to use an IR emitter to trigger the camera? I believe my SLR can be triggered via IR.
Thanks for the suggestion!
It wouldn't really need to use the post-processing and rendering as I can do all of that. It also depends on the camera for getting the pictures from it to the plugin. Mine cannot interface through USB while being used as it is pretty old.
Camera check wise, maybe you could add an external camera option as a way to skip the camera check and disable post processing as well as rendering. While testing, It wasn't much of a problem for me as I still had a webcam plugged into the pi to get around that. I also set it to not render the pictures because I wasn't to worried about what the webcam was seeing.
I also tried controlling the camera with an IR emitter but I couldn't really get it to work properly. I don't think it was able to emulate the timings properly, but I was using an Arduino Uno to control the LED. A Raspberry Pi would probably be able to do it more accurately.
I would like to have this feature as well - although my use case is different.
My custom made led-lamp is controllable via mqqt. I don't want to have the lamp turned on all the the time, but only for the snapshot. It would be nice to have a event which fires (with a delay) before the snapshot is taken to switch the lamp on and after the snapshot to turn it off.
@rdu, that's interesting. I've been thinking a lot about this, and I'm leaning towards implementing two separate solutions:
@FormerLurker I don't know about the octoprint api's, but would'nt it be possible to send an event to the octoprints internal event system? I use the MQTT-Publish plugin which forwards at least a lot (if not any) events to the mqtt server for further processing. So I receive a messages like this:
"{"_event": "CaptureStart", "file": "/home/pi/.octoprint/timelapse/tmp/Light_20180430050834-560.jpg", "_timestamp": 1525070515}"
octoprint/event/CaptureDone : msg.payload : string[125]
"{"_event": "CaptureDone", "file": "/home/pi/.octoprint/timelapse/tmp/Light_20180430050834-560.jpg", "_timestamp": 1525070515}"
That works great for my processing. The only downside is: there is no pre delay, because my lamp takes about 300ms from event to full brightness.
There is a delay setting for snapshot acquisition that applies after the stabilization motion, but before the snapshot is taken, I think this will account for it.
There is already an event being generated at the start and end of the stabilization/snapshot procdess, so it shouldn't be difficult to add one before and after the snapshot is taken. I'll look into this a bit more in the next couple of weeks.
I know this thread is a bit old, but I did add the ability to execute a custom bat/bash after stabilization (with an optional delay). It's in the latest commit on the devel branch. I haven't yet integrated with OctoPrint's built in events, but I figured you still might be interested.
Thank you so much, I can't wait to test it!
So, this is a much belated update, but camera scripting is now fully supported since V0.3.4, and has been further enhanced in V0.4 alpha. I'm going to go ahead and close this down, but feel free to create a new issue if you feel there is any unfinished business here.
Thanks for participating everyone!
Most helpful comment
I know this thread is a bit old, but I did add the ability to execute a custom bat/bash after stabilization (with an optional delay). It's in the latest commit on the devel branch. I haven't yet integrated with OctoPrint's built in events, but I figured you still might be interested.