bchanudet / OctoPrint-Octorant

Discord plugin for OctoPrint
MIT License
26 stars 14 forks source link

Octorant will not post any messages if webcam snapshot is enabled with new camera stack #79

Open ArcAIN6 opened 6 months ago

ArcAIN6 commented 6 months ago

I would like to preface this with a bit of information about the setup.

Unfortunately, there are no "ERROR", "WARNING"", or "INFO"'s in octoprint's log files. so trying to determine exactly what has gone wrong where is anyone's guess.

Directly access the cameras via URL functions, albeit a bit different for each camera.

Raspi-Cam: http://[LOCAL-IP]/webcam/?action=stream http://[LOCAL-IP]/webcam/?action=snapshot

USB-Cam: http://[LOCAL-IP]:8082/?action=stream http://[LOCAL-IP]:8082/?action=snapshot

As you'll notice, the USB Camera doesn't use the /webcam/ subfolder in the URL, that's because it hasn't been configured through HAProxy (Still haven't found a working tutorial on how to do that)

The cameras both function within octoprint as expected, and all four URL's produce media (1 stream, and 1 snapshot per camera)

Looking at the documentation, as well as the media.py here, it appears there are different methods being used for pulling the camera. In media.py,

from octoprint.webcams import get_snapshot_webcam

From https://docs.octoprint.org/en/master/plugins/mixins.html#webcamproviderplugin :

image

Maybe there has been a change in the way cameras are handled, for plugins as well, i'm unsure, as i haven't looked to build my own plugin yet XD

bchanudet commented 6 months ago

Hello,

Many thanks for all the details. At first glance it seems related to the other bug reported in #78.

By default OctoRant uses the camera set up as the snapshot camera in the "Webcam & Timelapse" section of the settings. Could you tell me which camera is selected as the "snapshot webcam", as well as the "fallback webcam"?

ArcAIN6 commented 6 months ago

Tried both USB camera,as well as the pi camera, didn't seem to make a difference, but currently have the USB camera as the default in that setting: image

bchanudet commented 6 months ago

Okay so first results of investigations point towards Multicam's fault.

In the WebcamProviderPlugin docs, take_webcam_snapshot() is supposed to be a string of the camera name given by the configuration, and that's what OctoRant is "sending". Whereas Multicam's implementation seems to expect a Webcam object, as the first operation is to extract the settings from the provided_webcam parameter.

I'll raise an issue on the Multicam repository to see with the plugin author if we can find something that works for both of us. Hopefully this will be resolved soon.

ArcAIN6 commented 6 months ago

cool :) Thanks for investigating <3