LazeMSS / OctoPrint-UICustomizer

UI Customizer for octoprint
165 stars 18 forks source link

[BUG] Compatibility issue with OctoPrint 1.9 - webcam not working #281

Closed giuliolibrando closed 1 year ago

giuliolibrando commented 1 year ago

Describe the bug

OctoPrint 1.9rc2 has moved Webcam integration to a plugin interface. [https://octoprint.org/blog/2023/03/07/new-release-candidate-1.9.0rc1/](Release info)

Webcam View is not working, keep showing "Webcam stream loading..". image

It works without the UI Customizer plugin.

NewsGuyTor commented 1 year ago

Please don't remove the webcam functionality, it is vital for so many people! If the worst come to worst, and it is s too much work, please implement the simple workaround I detail here:

  1. Skjermbilde 2023-03-08 kl  22 45 44
  2. Skjermbilde 2023-03-08 kl  22 47 03
  3. Skjermbilde 2023-03-08 kl  22 49 23

Replacing the HTML with the image HTML is a great workaround at least, a way better option that removing the webcam functionality.

LazeMSS commented 1 year ago

@NewsGuyTor its not that easy but I have already fixed it in dev I hope

ghost commented 1 year ago

Even after updating to this fix, this issue persists

jneilliii commented 1 year ago

@CornFlakes1991 is it the same error relative to "subscribe" as in the original error post in your browser's developer tools console tab?

jneilliii commented 1 year ago

I suspect this may be a race condition or something. I just checked and this is the error I see in console tab with the latest version. However, if I run the command that is being assigned to OrgTabChange it is a function.

image

It seems to be random when and where the webcam loads, Initially after re-enabling the webcam widget I was able to load on control tab but not in widget, but after a refresh of the page control tab no longer works and widget does.

ghost commented 1 year ago

@CornFlakes1991 is it the same error relative to "subscribe" as in the original error post in your browser's developer tools console tab?

3x7nsB

LazeMSS commented 1 year ago

@CornFlakes1991 on RC2 or normal?

jneilliii commented 1 year ago

Looks like 1.9.0 based on friendship warning. Error is prettygcode, disable that plugin and check again.

ghost commented 1 year ago

@CornFlakes1991 on RC2 or normal?

RC2

Looks like 1.9.0 based on friendship warning. Error is prettygcode, disable that plugin and check again.

Disabled it and still not webcam image :/

NewsGuyTor commented 1 year ago

Yeah, same issue here, something is wrong with the patch.

For some reason the Control tab has a webcam box now (despite it being hidden in UI-Customizer settings), and when I switch to the Control tab the webcam image appears in the main Webcam box, and then disappears when I move away from the Control tab. Nothing particular appears in console.

Here's a video demo, perhaps easier to understand:

https://user-images.githubusercontent.com/19603024/224347673-8c87b025-deba-4b1b-bba8-49b56b0bc3d3.mp4

jneilliii commented 1 year ago

Yes, this was what I was seeing too with the patched files. There's still something missing relative to keeping the stream live when not on the control tab. I'll be looking at this over the weekend for all my impacted plugins and will have a better idea of how the new classic webcam plugin is controlling this.

jneilliii commented 1 year ago

maybe we could ask @crysxd what is needed to keep the stream active...

crysxd commented 1 year ago

The problem is that you can now have more than one webcam and OctoPrint has a drop down to select the shown webcam. The controls VM will stop the webcam stream of inactive webcams, similarly to when you move away from the OctoPrint tab in your browser. The corresponding code is here:

So basically when the webcam div #webcam-group isn't intersecting with the control pane (so it's not visible) the webcam is stopped.

fly74 commented 1 year ago

The other thing is that the option "Hide webcamera on Control tab" don't hide it in OP 1.9.0rc2.

LazeMSS commented 1 year ago

@fly74 did you turn on the webcam widget?

fly74 commented 1 year ago

@LazeMSS What do mean?

It is emty in the main view:

Screenshot 2023-03-17 193901

And shown in the control section, even if hide option is set:

Screenshot 2023-03-17 193919

Enabled here?:

Screenshot 2023-03-17 194021

LazeMSS commented 1 year ago

@fly74 on the RC2 or normal 1.8.2 octoprint?

fly74 commented 1 year ago

@fly74 on the RC2 or normal 1.8.2 octoprint?

In the rc2. When I rollback to 1.8.2 everything is fine.

LazeMSS commented 1 year ago

Ohh i might have that fixed in the upcoming release but that requires the rc3 to be released first

LazeMSS commented 1 year ago

This should now be fixed when 1.9.0 is released - closing for now - wait for 1.9.0 release or try the RC3 version. https://github.com/LazeMSS/OctoPrint-UICustomizer/releases/tag/0.1.9.4

fly74 commented 1 year ago

@LazeMSS I can confirm, it works now. thx.

abulka commented 1 year ago

This should now be fixed when 1.9.0 is released - closing for now - wait for 1.9.0 release or try the RC3 version. https://github.com/LazeMSS/OctoPrint-UICustomizer/releases/tag/0.1.9.4

Can this RC be installed via the plugin manager? My plugin manager is not listing plugins at the moment for some reason - so I can't see if RC are also listed in OctoPrint's plugin manager. Can I install the new RC version of UICustomizer via pip perhaps?

I am running OctoPrint: 1.8.7 and the layout is a bit messed up. Currently OctoPrint's pip lists

UI-Customizer             0.1.9.4
crysxd commented 1 year ago

@abulka If you are not using OctoPrint 1.9 then this is not your issue. If you want to use OctoPrint 1.9 RC, you can select it in the "Software Update" settings (select "Maintenance RC"), but this might bring you more issues than it solves

Screenshot 2023-04-06 at 07 32 54
abulka commented 1 year ago

I rebooted my pi and the plugin manager started working again. And the layout corrected itself. So all good. And I'll stay away from OctoPrint 1.9 RC till its stable etc - thanks.

WimVDK commented 1 year ago

Still broken on Octoprint 1.9.2 and UI Customizer 0.1.9.8

LazeMSS commented 1 year ago

@WimVDK could you explain a bit more?

WimVDK commented 1 year ago

Webcam preview breaks on any tab but control tab. Google Drive Link

LazeMSS commented 1 year ago

@WimVDK try disabling A dashboard for Octoprint or maybe just their webcam implantation

Looks like they have not moved to the new way of handling webcam - and their solution is conflicting with mine.

WimVDK commented 1 year ago

I explicitly installed that one just to get a working webcam feed again on the home page. If this bug gets fixed I'm uninstalling it again probably. It's UI-Customizers that's not working!

jneilliii commented 1 year ago

I still think it might be my plugin, consolidate temp control.

WimVDK commented 1 year ago

Going to bed now. I'll see if i can confirm ly earlier statement about CTC or UIC. To be continued , but if it were yours. Then why would the cam WORK on the control tab but NOT WORK on any of the others.

WimVDK commented 1 year ago

I still think it might be my plugin, consolidate temp control.

I have to correct my earlier statement CTC is indeed the culprit. The moment that one was disabled and octoprint was disabled preview worked fine on all tabs. So how do we go from here?

jneilliii commented 1 year ago

Try switching to consolidated tabs plugin instead of that one, combine temperature and control and see if it's still an issue.

WimVDK commented 1 year ago

That one works. I'll have to tinker around with it to see which method i like best. Certainly a neat concept though! How do you remove "enabled" tabs? couldn't find that in the configuration instructions on the github/plugin settings. Seems like the "spoolmanager plugin","State","Files", "connection" and "webcam" sections can't be moved either (yet)

jneilliii commented 1 year ago

That plugin only works on combining tabs, not sidebar items.