TheSpaghettiDetective / moonraker-obico

GNU Affero General Public License v3.0
153 stars 41 forks source link

Explicitly set webcam stream/snapshot urls are ignored if retrieved from moonraker #37

Closed BradenM closed 2 years ago

BradenM commented 2 years ago

Hi,

Currently, moonraker-obico appears to ignore explicitly set webcam snapshot/stream URLs if it succeeds in retrieving the values from moonraker.

Given the following config (in my environment):

[moonraker]
host = moonraker
port = 7125

[webcam]
disable_video_streaming = False
snapshot_url = http://webcam:8080/snapshot
stream_url = http://webcam:8080/stream

This plugin succeeds in retrieving a different URL from moonraker and proceeds to override my values.

Moonraker responds with a relative paths such as: /webcam/?action=stream, and moonraker-obico ignores my values and tries to connect to localhost/webcam/?action=stream

For context, I am working on running this plugin in a docker container in my local setup based on https://github.com/mkuf/prind

Workaround

Commenting out / removing the following lines: https://github.com/TheSpaghettiDetective/moonraker-obico/blob/03ab792d7d4d24980786044171b3e8c30bf1ecbc/moonraker_obico/config.py#L72-L77 resolves the issue as it removes any consideration of values retrieved from moonraker.

Of course, this works as a temporary fix for my personal docker image :smile:, but I think a proper solution would be always to use any webcam URLs that are explicitly set in the config (and if not set, continue with the current logic).

Thanks!

kennethjiang commented 2 years ago

Thank you for reporting this issue! It does look like a bug in the code. Will think about how to fix it.

aguinaldoabbj commented 1 year ago

@BradenM Sorry to necrobump this issue. I'm also running Klipper within prind stack and I can't get Obico to work. Could you please share any guidance on this?

MallocArray commented 1 year ago

@aguinaldoabbj Better to open a new issue, or check out the Discord channel to discuss your issue. https://www.obico.io/docs/user-guides/contact-us-for-support/