sibbl / hass-lovelace-kindle-screensaver

This tool generates a png from a Home Assistant Lovelace view, which can be displayed on a Kindle device which has the Online Screensaver plugin installed.
MIT License
311 stars 71 forks source link

Extension extremely unstable #117

Closed A731 closed 1 month ago

A731 commented 3 months ago

The add-on keeps crashing on me, both periodically after running for some hours and when trying to start it again after crashing. Pasting an excerpt from the logs after a crash below

`Starting browser... Visiting 'http://homeassistant.local:8123' to login... Adding authentication entry to browser's local storage... /app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:265 throw new Error('Execution context was destroyed, most likely because of a navigation.'); ^

Error: Execution context was destroyed, most likely because of a navigation. at rewriteError (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:265:23) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ExecutionContext._evaluateInternal (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:219:60) at async ExecutionContext.evaluate (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16) at async /app/index.js:52:3`

sibbl commented 3 months ago

Hi, seems like it has some troubles reaching your HA instance. I'd suggest to try an IP instead of the host name homeassistant.local first and ensure that both are accessible within the same network. Maybe the token is also invalid, but if I remember correctly, the error would be a bit different then.

A731 commented 3 months ago

Unfortunately that did not seem to fix the issue. I first got a timeout error which stopped the server, and rebooting it causes the same error as described above. Seems like it is struggling with a stable connection to HA, but it is installed as a HACS extension and running locally on the same RPI3 running HA, so i am not sure why there would be a connection issue

A731 commented 3 months ago

Unfortunately that did not seem to fix the issue. I first got a timeout error which stopped the server, and rebooting it causes the same error as described above. Seems like it is struggling with a stable connection to HA, but it is installed as a HACS extension and running locally on the same RPI3 running HA, so i am not sure why there would be a connection issue

I will also mention that it worked for a couple hours again before it stopped working, like earlier

beeh5 commented 3 months ago

@A731 - what does your CRON_JOB setting look like? I think by default it would try to create the image every minute (* * * * *), maybe that is too much of a burden for a RPI3... And probably you do not need that many refreshes either...

I run it every 15 minutes (*/15 * * * *) on my RPI3 and the extension is stable once it runs.

A731 commented 1 month ago

Upgraded from my RPI3 to RPI5, which seemingly has fixed the issue. Seems like it was simply struggling with performance, thanks for all the aid!