Feature request : Manual snapshot button under the Control tab

Hello all,

I am posting here because I didn't know where to post a request. Feel free to move it if needed :slight_smile:

I am currently using a setup of 2 Prusa printers at my workplace with a Raspberry Zero W each. I also have an ESP-CAM that I use as an IP camera to monitor both printers.

The whole octoprint setup works well on the local network. I also use Octoeverywhere to be able to reach my printers when away.
Unfortunately, I am therefore not able to reach my ESP-CAM when away because for the webcam stream to work on Octoprint, it must be reachable by the browser that is used to access Octoprint's UI. The snapshot however does work as it is the Raspberry which directly accesses the IP camera and outputs the image.

This is therefore an acceptable workaround solution. In particular, I want to be able to use the cam to see if the printer plate is clear and if a new print can be launched, which can be done using a single snapshot and does not require a video feed. The main reason behind this is because the printers are located at my workplace and shared with multiple colleagues and it can be a pain to ask around if the previous guy removed its print from the plate and a new print can be launched or if the printed objects are still on the plate.

My request is therefore as follows: would it be possible to add a small "take snapshot" button under the control tab in Octoprint that would have the same result as pushing the "Test" button under the webcam & timelapse settings ?
Also, Octoeverywhere, in an attempt to reach an IP camera, tries to replace the local IP address of the camera by another address but I get results indicating that the header field is too long for my ESP-CAM to handle and I don't think I can find a suitable workaround for this issue. This is more of an issue with Octoeverywhere to see with, anyway.

I don't think it is hard to implement and it could easily be done by a plugin but I am a complete newbie in this type of programming so I feel like I couldn't manage to do it myself.

Feel free to ask any questions or propose other solutions, I'm up for a discussion with you.

Thanks,
Maxime

It might be easier to reconfigure haproxy to redirect the webcam string to your espcam? That way the URL /webcam/...goes to your espcam device instead. I think in that scenario wouldn't octoeverywhere allow to see it? I'm pretty sure with the ngrok plugin that would work.

The other options would be to use the snap stream plugin, which replaces the mjpg stream with a client side snapshot for the webcam view on the control tab.

Edit: But that may have the same issue if it's an internal address.

Hey jneilliii, thanks for your reply !

I tried the Snapstream plugin but it has the same problem, like stated on the Git page of snapstream : "This plugin uses the url's for the webcam from OctoPrint's webcam settings panel so the snapshot url has to point to something your browser can reach.".

I will try to reconfigure Haproxy on Monday. Do you have any resources you could point me to in order to do what to suggest? I must admit I have very little experience in this field.

Thanks

This is the haproxy config from OctoPi (/etc/haproxy/haproxy.cfg):

It might be enough to change where it has the local IP, for that to be the local IP and port of your ESP camera. Then you can adjust the URL you are using to be /webcam/.

However (and this is quite a big however) on a Raspberry Pi Zero, this is making a lot of work for it. It must download the stream from the ESP and then re-transmit it to OctoEverywhere - and the Pi Zero can't really handle streaming this. If you replace the stream URL with a snapshot one, then it would not stream and the zero may be able to handle it. Possibly.

Great! I'll definitely give it a try on Monday and tell you how it goes!