eshapiro42 / OctoPrint-Wyze

Control Wyze devices through OctoPrint
GNU General Public License v3.0
10 stars 1 forks source link

Take Picture / gcode triggers #4

Closed Energiz3r closed 2 years ago

Energiz3r commented 2 years ago

Forgive me if this is not possible, but is it feasible to add a 'take picture' option with Wyze cameras, and gcode triggers? Could be really handy if I could trigger a photo with gcode for something like octolapse

eshapiro42 commented 2 years ago

Hi @Energiz3r.

This is technically possible, but would take a lot of doing.

There is no simple way to define custom events based off of G-code as far as I'm aware (the exception being simple events like z-axis changes or the other events listed here). I'd have to make use of another plugin like OctoPrint-Custom_gcode_events or else somehow intercept and parse G-code sent through OctoPrint myself and then use a ProgressPlugin or something which only has 1% granularity. I'm not immediately sure how to handle this part since this is the first plugin I've written for OctoPrint and I'm still a newbie, although I'm certain it's possible.

The library this plugin currently uses to interface with Wyze devices (wyze_sdk) does not offer access to a camera's streams or any controls other than restart, turn_off and turn_on. There is a module (wyzecam) which seems like it could definitely take a picture or perhaps trigger an event, but it has a lot of dependencies including a library written in Java.

I will put this on the back-burner as a "wish list" type item but I wouldn't count on it happening any time soon. Sorry I couldn't give you better news!

Energiz3r commented 2 years ago

Greatly appreciate the detailed response, thanks!

I'll open a an issue on wyze_sdk to see if photo-taking might be possible in future but given the reverse-engineered nature of it I'd say that might be a long shot also.