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

Infinite boot loop #40

Closed esp32x closed 2 years ago

esp32x commented 2 years ago

When I set "live" to "true", I get an infinite boot loop.

[06/12/2021, 12:38:08] TimeoutError: Navigation timeout of 10000 ms exceeded
    at /usr/local/lib/node_modules/homebridge-website-to-camera/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111
[06/12/2021, 12:38:08] Got SIGTERM, shutting down Homebridge...
...
[06/12/2021, 12:38:13] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[06/12/2021, 12:38:18] [HB Supervisor] Restarting Homebridge...

config

{
    "name": "Time",
    "url": "https://time.is/",
    "timeout": 10000,
    "renderTimeout": 100,
    "cacheTime": 5000,
    "chromiumPath": "/usr/bin/chromium-browser",
    "jsFile": "/home/pi/js/cookie_consent.js",
    "live": "true",
    "liveSnapshotInterval": 1000,
    "livePort": 8554
}
werthdavid commented 2 years ago

It works on my machine 😂 That's weird.. Have you tried any other website? Does the cookie_consent.js file change anything?

esp32x commented 2 years ago

Unfortunately, I can't get it to run with any website/configuration.

config

{
    "platform": "website-camera",
    "cameras": [
        {
            "name": "Wikipedia",
            "url": "https://de.wikipedia.org/wiki/Wikipedia:Hauptseite",
            "timeout": 3000,
            "renderTimeout": 100,
            "cacheTime": 9000,
            "chromiumPath": "/usr/bin/chromium-browser",
            "live": "true",
            "liveSnapshotInterval": 1000,
            "liveRefreshInterval": 30000,
            "livePort": 8554
        }
    ]
},
[06/12/2021, 14:06:29] [website-camera] Chromium started
[06/12/2021, 14:06:29] [website-camera] Opening new page
[06/12/2021, 14:06:31] [website-camera] Setting Viewport to 1920x1080
[06/12/2021, 14:06:31] [website-camera] Going to page: https://de.wikipedia.org/wiki/Wikipedia:Hauptseite
[06/12/2021, 14:06:34] TimeoutError: Navigation timeout of 3000 ms exceeded
    at /usr/local/lib/node_modules/homebridge-website-to-camera/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111
[06/12/2021, 14:06:34] Got SIGTERM, shutting down Homebridge...
[06/12/2021, 14:06:39] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[06/12/2021, 14:06:44] [HB Supervisor] Restarting Homebridge...
[06/12/2021, 14:06:44] [HB Supervisor] Starting Homebridge with extra flags: -I -D
[06/12/2021, 14:06:44] [HB Supervisor] Started Homebridge v1.3.8 with PID: 1074
[06/12/2021, 14:06:48] Loaded config.json with 1 accessories and 5 platforms.
[06/12/2021, 14:06:48] Loaded 11 cached accessories from cachedAccessories.
[06/12/2021, 14:06:48] ---
[06/12/2021, 14:06:52] Loaded plugin: homebridge-config-ui-x@4.41.3
[06/12/2021, 14:06:52] Registering platform 'homebridge-config-ui-x.config'

Can you post a configuration with reasonable and tested values where it works on your machine?

werthdavid commented 2 years ago

I did test with the configuration you provided. Did it work with version 1 of the plugin? Are you running homebridge inside docker? also HTTPS could be a problem, have you tested a HTTP-only website? What version of chromium do you have?

esp32x commented 2 years ago
werthdavid commented 2 years ago

What happens if you set "timeout" to 0 (disabled, might be good for heavy websites)?

esp32x commented 2 years ago

Setting "timeout" to 0 does not seem to disable it. The default value is 10000.

[07/12/2021, 11:53:44] [website-camera] Starting new instance of Chromium: /usr/bin/chromium-browser
[07/12/2021, 11:53:46] [website-camera] Chromium started
[07/12/2021, 11:53:46] [website-camera] Opening new page
[07/12/2021, 11:53:47] [website-camera] Setting Viewport to 1920x1080
[07/12/2021, 11:53:47] [website-camera] Going to page: https://de.wikipedia.org/wiki/Wikipedia:Hauptseite
[Wikipedia A616] The image snapshot handler for the given accessory is slow to respond! See https://git.io/JtMGR for more info.
[07/12/2021, 11:53:57] [website-camera] TimeoutError: Navigation timeout of 10000 ms exceeded
    at /usr/local/lib/node_modules/homebridge-website-to-camera/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111
[07/12/2021, 11:54:07] [website-camera] Opening new page
[07/12/2021, 11:54:07] [website-camera] Setting Viewport to 1920x1080
[07/12/2021, 11:54:07] [website-camera] Going to page: https://de.wikipedia.org/wiki/Wikipedia:Hauptseite
[Wikipedia A616] The image snapshot handler for the given accessory is slow to respond! See https://git.io/JtMGR for more info.
[07/12/2021, 11:54:17] [website-camera] Loading finished, waiting 100ms before taking screenshot
[07/12/2021, 11:54:18] [website-camera] Created screenshot
[07/12/2021, 11:54:18] [website-camera] Got screenshot
werthdavid commented 2 years ago

Dang it, that's right of course... Can you try the Website "http://neverssl.com"

esp32x commented 2 years ago

Neverssl works, but when I set "live" to "true", "homebridge" or "website-camera" hangs and I can't see any messages in the status log anymore.

werthdavid commented 2 years ago

So as a recap:

werthdavid commented 2 years ago

Please reopen if necessary