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

[website-camera] TimeoutError: Navigation timeout of 20000 ms exceeded #22

Closed marcoschmidt79 closed 4 years ago

marcoschmidt79 commented 4 years ago

Hello and thank you so much for your wonderful plugin. :-)

I have ioBroker and i have create a website with vis and vis-map with coordinates from my car (vw-connect-adapter). then i use your plugin and take the picture from map with car in my homekit. It works. But i have problems:

This is normal:

[14.5.2020, 09:36:06] [website-camera] Opening new page [14.5.2020, 09:36:06] [website-camera] Setting Viewport to 960x540 [14.5.2020, 09:36:06] [website-camera] Going to page: http://192.168.5.220:8082/vis/index.html#DemoView [14.5.2020, 09:36:10] [website-camera] Loading finished, waiting 100ms before taking screenshot [14.5.2020, 09:36:10] [website-camera] Created screenshot [14.5.2020, 09:36:10] [website-camera] Got screenshot [14.5.2020, 09:37:21] [website-camera] Opening new page [14.5.2020, 09:37:21] [website-camera] Setting Viewport to 960x540 [14.5.2020, 09:37:21] [website-camera] Going to page: http://192.168.5.220:8082/vis/index.html#DemoView [14.5.2020, 09:37:23] [website-camera] Loading finished, waiting 100ms before taking screenshot [14.5.2020, 09:37:23] [website-camera] Created screenshot [14.5.2020, 09:37:23] [website-camera] Got screenshot

This is not normal and a mistake:

14.5.2020, 09:27:15] [website-camera] TimeoutError: Navigation timeout of 20000 ms exceeded at /usr/local/lib/node_modules/homebridge-website-to-camera/node_modules/puppeteer-core/lib/LifecycleWatcher.js:126:25 -- ASYNC -- at Frame. (/usr/local/lib/node_modules/homebridge-website-to-camera/node_modules/puppeteer-core/lib/helper.js:83:19) at Page.goto (/usr/local/lib/node_modules/homebridge-website-to-camera/node_modules/puppeteer-core/lib/Page.js:623:53) at Page. (/usr/local/lib/node_modules/homebridge-website-to-camera/node_modules/puppeteer-core/lib/helper.js:84:27) at ScreenshotHelper.getScreenshot (/usr/local/lib/node_modules/homebridge-website-to-camera/ScreenshotHelper.js:33:16) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5)

Can you help me please?

Sorry for my bad english. :-)

werthdavid commented 4 years ago

Hey, can you give me more information? So the problems occurs sometimes but not always? What kind of website is it? Have you tried the option ‘renderTimeout’ in the config?

marcoschmidt79 commented 4 years ago

Ah du bist aus Stuttgart, dann kann ich ja Deutsch schreiben. :-)

Ja, manchmal macht der die Bilder problemlos, manchmal kommt eben der Fehler. Die Config:

        "platform": "website-camera",
        "cameras": [
            {
                "name": "Superb",
                "url": "http://192.168.5.220:8082/vis/index.html#DemoView",
                "chromiumPath": "/usr/bin/chromium-browser",
                "timeout": 20000,
                "renderTimeout": 100

Das ist nur eine einfache Website, die eine Karte anzeigt, die ioBroker erstellt hat. Die zeigt dann im prinzip an, wo mein Auto steht. Auflösung 1024x768, aber es ist ok, dass dein Plugin das etwas verkleinert.

Edit: Hab das Gefühl, der Fehler tritt nur auf, wenn man die Homeapp offen hat und es zügig hintereinander abfragt. Lässt man es ohne offene Homekit-App laufen, kommt der Fehler nicht. Vielleicht sollte das Plugin statt einen Fehler bei Timeout zu bringen, erneut die Website abfragen. Manche Websites sind halt etwas langsamer.

werthdavid commented 4 years ago

Ja, deutsch passt auch ;-) Also technisch ist es so, dass der Timeout passiert, wenn nach 20s noch mehr als 2 Verbindungen auf der Seite nicht fertig geladen haben. Du kannst mal schauen was passiert, wenn du die config so anpasst:

"timeout": undefined,

Ist nur etwas schwierig für mich das nachzuvollziehen, wenn ich die Seite nicht kenne. Stürzt die homebridge dadurch komplett ab? Du kannst auch mal schauen wenn du die Website mit Chrome aufrufst und per F12 in den Network-Tab schaust, ob da noch Anfragen laufen die länger als 20s brauchen.

werthdavid commented 4 years ago

Close due to inactivity