werthdavid / homebridge-website-to-camera

Homebridge plugin that displays a Website as virtual camera (intended for Google Maps Traffic)
MIT License
54 stars 7 forks source link

Installing Chromium leads to problems with Fritzbox #49

Open guitardoc opened 1 year ago

guitardoc commented 1 year ago

First of all, thank you for providing this plugin.

However, there are a few issues with it. The installation of chromium-browser is no longer possible, it probably needs to be chromium (without "-browser"). But when you install this browser (I did so on a headless Debian Bullseye), you only have awfully slow access to the fritzbox admin user interface. Connecting to the fritzbox is only possible when stopping homebridge. Deinstalling chromium or the plugin does not remedy the problem - the only way to get back to normal fritzbox access is by erasing and new installation of Debian Bullseye.

Is there a possibility for you to have a look into it? Until this is fixed, I have to strongly discourage users to install the plugin. I had to reinstall Debian Bullseye three times while trying to figure out the problem and every time it came back to the installation of chromium.

Thank you!

werthdavid commented 1 year ago

Hey, that sounds very strange.. what hardware are you running chromium on? Which version of chromium is being installed?

guitardoc commented 1 year ago

Yes, I admit it sounds strange. However, I have been trying to find the problem for nearly a year and I could narrow it down to the website-to-camera plugin. The plugin itself does not introduce the strange behaviour (I restored a backup with the plugin included without prior chromium installation) but once I installed chromium the strange behaviour started. If it is due to chromium itself or one of its numerous dependencies I could not find out.

The machine I am running the system on is a Raspberry Pi 4B with 8GB RAM, the OS is headless Debian Bullseye. The version of chromium was the one that gets installed using the installation command sudo apt-get install chromium --yes

The Fritzbox is an FB 7590 AX.

werthdavid commented 1 year ago

I have a RPi 4 but I'm using Raspbian non-headless. Can u run chromium-browser --version or chromium --version please. And also please share your homebridge config. Does the problem occur with other websites or only Fritzbox? I have a Fritzbox as well but not using it with the plugin..

guitardoc commented 1 year ago

Here is my Homebridge website to camera config: { "platform": "website-camera", "cameras": [ { "name": "Auto", "url": "http://192.168.188.92:8082/vis/index.html?StandortFahrzeug#StandortFahrzeug", "height": 540, "width": 960, "timeout": 10000, "renderTimeout": 1, "chromiumPath": "/usr/bin/chromium", "live": "false", "liveSnapshotInterval": 1000, "livePort": 8554 } ], I do not have chromium any longer installed due to this very issue. I had to erase the whole Pi OS and start from scratch to remedy it. However, I think I do have an old copy of the system somewhere with chromium on it. I will have a look at it later. It may have to do with my system being headless. I think there is a new chromium version for headless systems but I am very reluctant to install it in fear of having the same issue again
 Strangely, only the Fritzbox website is affected so far.

werthdavid commented 1 year ago

So it should work with Chrome and/or Chromium, the plugin basically does control a Chrome browser via the API. Headless should not be an issue. I'm not sure what the /vis/ part of the FritzBox does as mine doesn't have that. Is the website you're trying to screenshot quite heavy? Like what does it contain? (Ich spreche btw. auch deutsch 😉 )

guitardoc commented 1 year ago

Ahhh, Deutsch ist wesentlich einfacher
 :-) Es geht um die Seite fritz.box. Normalerweise geht das Anmeldefenster ruckzuck auf wenn man fritz.box eingibt (bei mir auf einem MacBook Pro im gleichen Netzwerk). Wenn chromium installiert ist, dann dauert das manchmal schon eine Minute. Noch schlimmer dann nach der Anmeldung an der Fritzbox - einmal auf Heimnetz-Mesh gedrĂŒckt und vielleicht zeigt er nach 10 min was an. Kann auch passieren, dass ein Timeout kommt und man sich neu anmelden muss.

werthdavid commented 1 year ago

Hmm ich verstehe es noch nicht ganz. Wie machst du denn die Anmeldung an der Fritzbox wenn du headless unterwegs bist? Du kannst mir vielleicht auch mal ein Video oder so auf Telegram schicken @werthd

guitardoc commented 1 year ago

Auf dem Raspi laufen nur zwei Systeme, nĂ€mlich die Homebridge fĂŒr HomeKit und der ioBroker. Der Raspi ist nur fĂŒr die Verwaltung der Hausautomation und deren Komponenten zustĂ€ndig. Auf dem Raspi wird nichts weiter gemacht. Aber alle anderen GerĂ€te (z.B. mein MacBook - aber auch z.B. ein iPad oder das iPhone), haben dann das Problem mit dem Aufruf der Fritzbox, sobald Chromium auf dem Raspi lĂ€uft - obwohl das eine mit dem anderen ja scheinbar erst mal gar nichts zu tun hat. Ich hoffe, ich konnte es einigermaßen verstĂ€ndlich erklĂ€ren? Da fĂ€llt mir ein - ich bin auch nicht der einzige der das Problem hatte. In einem Forum hat jemand ĂŒber exakt das gleiche Problem berichtet und er konnte es auch nur durch Neuaufsetzen des Raspi ohne Chromium beheben. Wenn ich mich recht entsinne dann war das im SmartApfel Forum.

werthdavid commented 1 year ago

Aber natĂŒrlich fĂ€ngt das Problem erst an, wenn das Plugin fĂŒr Homebridge Chromium nutzt um auf die Fritzbox zuzugreifen..?

guitardoc commented 1 year ago

Nein, sofort nach der Installation.

werthdavid commented 1 year ago

Du installierst ein Programm auf einem Raspberry, der ansonsten nichts mit der Fritzbox zu tun hat, außer dass er im selben LAN ist und sofort nach Installation ist die Fritzbox langsam?? Das widerspricht allem was ich ĂŒber IT zu wissen glaubte.. 😝 Ist der ioBroker irgendwie an die Fritzbox gekoppelt mit einer Anbindung?

guitardoc commented 1 year ago

Ja, das ist ja das Skurrile an der ganzen Geschichte. Ich denke auch nicht, dass es am Plugin liegt. Ich vermute, dass Chromium irgendwas mitbringt, was dann (durch einen Bug) die Fritz!Box mit Traffic bombardiert, so dass diese nicht mehr dazu kommt, die Anfragen zum User Interface zu beantworten (das User Interface sollte ja bei der FB ganz unten in der PrioritÀt stehen). Anders kann ich es mir auch nicht erklÀren...

werthdavid commented 1 year ago

Also hat der ioBroker eine Anbindung an die Fritzbox? Vielleicht reagiert der ioBroker auf Chromium. Wie sieht die CPU Auslastung auf RPi und Fritzbox (sieht man ja in der OberflÀche) aus, wenn Chromium installiert ist?

guitardoc commented 1 year ago

Nein, ioBroker hat keine Anbindung an die Fritz!Box. Ich hab Chromium ja nicht mehr drauf, daher kann ich das nicht mit der Auslastung nicht testen... Ich schaue dann mal nach der alten Platte wo es noch drauf ist.

guitardoc commented 1 year ago

Hab die alte Platte mal fix angeschlossen. Chromium lĂ€uft, Plugin auch - sehe auf der Karte, dass mein Auto tatsĂ€chlich dort steht wo es auch steht... :-) Fritz!Box Zugang ist jetzt extrem langsam, aber ich komme wenigstens noch drauf: Auslastung Raspi liegt bei ca. 25%, Fritz!Box bei ca. 85%. Hmm... Damit dĂŒrfte sich meine Theorie pulverisiert haben... :-) Ich habe keine Idee, woran es liegt. Wenn ich den ioBroker stoppe, dann Ă€ndert sich nichts. Wenn ich den hb-service stoppe, dann geht es wieder flott auf der Fritz!Box.

werthdavid commented 1 year ago

Was passiert wenn du auf deinem Laptop die URL aufrufst die sonst das Plugin aufruft? FĂŒhrt das auch zu hoher Last bei der Fritzbox?

guitardoc commented 1 year ago

Nein, da Àndert sich nichts. Zum Vergleich - wenn ich den Raspi ausschalte, dann ist die Auslastung der FB immer noch bei ca. 80%. Ich habe aber auch jede Menge Repeater und HausautomationsgerÀte dranhÀngen (ca. 100). Von daher kann das schon stimmen.

werthdavid commented 1 year ago

Das sieht man ja auf System-->Energiemonitor wo die Last herkommt, kannst da mal schauen? Was ist denn das fĂŒr eine Seite die da aufgerufen wird mit dem Fahrzeugstatus?

guitardoc commented 1 year ago
image
werthdavid commented 1 year ago

Ist das jetzt mit oder ohne Chromium? Sieht ja unauffÀllig aus

guitardoc commented 1 year ago

Das ist mit Chromium. Hab es noch von der „alten“ Platte laufen, da ich den Zugang zur FB im Moment nicht so oft brauche


werthdavid commented 1 year ago

Wie sieht es aus, wenn du dir die Auslastung anschaust, kurz nachdem du auf dem iPhone die Home App geöffnet hast? (Hintergrund: Dann triggert das Plugin, dass Chromium ja die Seite besucht und einen Screenshot erstellt).

guitardoc commented 1 year ago

Die Auslastung oben war schon mit offenem Plugin. Aber ich denke, dass das Plugin mit dem Problem gar nichts zu tun hat. Erst wenn man Chromium installiert geht es los. Ich mĂŒsste mal testen, ob das Problem auch auftritt, wenn man auf einem frischen Bullseye headless chromium installiert. Werde ich demnĂ€chst mal machen. Wenn bisher nur zwei Anwender das Problem hatten - wer weiß an welcher Konstellation der Installationen das tatsĂ€chlich liegt? Wenn es denn bei allen anderen funktioniert
 Oder die haben keine Fritzbox - oder eine andere Fritzbox? Oder es ist nicht aufgefallen, weil wann greift man schon mal auf die Fritzbox zu wenn alles lĂ€uft? Ich werde es mal weiter beobachten und berichten wenn mir noch was auffĂ€llt. PS. Du solltest bei Gelegenheit mal Ă€ndern, dass die Installation mit chromium und nicht mit chromium-browser erfolgen muss. Bei dem Versuch der Installation von chromium-browser kommen Fehler, weil es diese Installation nicht mehr gibt.

werthdavid commented 1 year ago

Guter Hinweis, mache ich.