FormerLurker / Octolapse

Stabilized timelapses for Octoprint
GNU Affero General Public License v3.0
639 stars 99 forks source link

[Request] Send custom system command before snapshot #607

Open Ruko2010 opened 4 years ago

Ruko2010 commented 4 years ago

If this is a feature request describe it here

It would be cool to execute a system command before the snapshot is triggered. It would be even more cool, if this command could be executed a a little time (say 1-2 seconds) before the snapshot. The Background is, that I'm mostly printing in dark areas, but I have a gcode controled light strip around my printer. it is controled via the gpio ports of my pi. Today i have to leave on the strip for the whole print to capture a timelapse, but it would be cool if the strip will be on, when photos are taken (and 2 seconds before that, because the camera has to adjust to the light when switching the strip on).

Version of Octolapse

Octolapse Version: v 0.4.0

Version of OctoPrint

OctoPrint Version: 1.4.2

When you ran into the problem, did you have diagnostic logging enabled?

Diagnostic Logging was Enabled: _REPLACE_THISYES_OR_NO

What were you doing when the problem occurred

  1. _REPLACE_THISSTEP_ONE_GOES_HERE
  2. _REPLACE_THISSTEP_TWO_GOES_HERE
  3. _REPLACE_THISSTEP_...

What should have happened?

_REPLACE_THISPUT_YOUR_DESCRIPTION_HERE

What happened instead?

_REPLACE_THISPUT_YOUR_DESCRIPTION_HERE

Operating System running OctoPrint and Octolapse

OS Name: _REPLACE_THISOS_NAME_GOES_HERE Os Version: _REPLACE_THISOS_VERSION_GOES_HERE

Printer model & used firmware incl. version

Printer Model: _REPLACE_THISPRINTER_MODEL_GOES_HERE Printer Firmware Version: _REPLACE_THISPRINTER_FIRMWARE_VERSION_GOES_HERE

Browser and version of browser, operating system running browser

Browser: _REPLACE_THISBROWSER_VERSION_GOES_HERE Browser OS: _REPLACE_THISBROWSER_OS_GOES_HERE

Link to the gcode file you were printing when the problem occurred

Link to Gcode File: _REPLACE_THISGCODE_FILE_LINK_GOES_HERE

Link to settings.json

Link to settings.json with all passwords removed: _REPLACE_THISSETTINGS_JSON_LINK_GOES_HERE

Link to plugin_octolapse.log

Link to plugin_octolapse.log: LINK_GOES_HERE

Link to octoprint.log

Link to octoprint.log: _REPLACE_THISLINK_GOES_HERE

Link to contents of Javascript console in the browser

Link to javascript console output: _REPLACE_THISLINK_GOES_HERE

Screenshots and/or videos of the problem:

Screenshot/Video Links: _REPLACE_THISLINKs_GO_HERE

Please consider becoming a patron

If you like this project, please support my work by becoming a patron, and consider adding a 'star' to the repository. It takes a lot of time and effort to maintain the project and respond to issues. The cost of test prints, software, cameras, printer parts, etc. can quickly add up, so every bit helps.

You can find various videos and tutorials by subscribing to my Youtube channel. You can also follow me on Twitter.

FormerLurker commented 4 years ago

so, adding a command X seconds before would be extremely difficult, since there is no good way to predict when that would be. The printer buffers commands, and it's impossible to tell exactly where it is without waiting for a move to complete. I have seen other people do exactly what you are wanting with the before snapshot script. You could add a delay if necessary (see the snapshot delay in the camera profile) to allow your camera time to adjust. I can see if I can find a similar script. How are you controlling the light? GPIO, http? Something else?

Ruko2010 commented 4 years ago

I‘m controlling the led-strip with GPIO, so a before and after script would be cool. A delay would be ok, but it will stop the printer for the delayed time, right? So there may be a risk of affecting the print.