Comments (21)
Hey @lanrat, thanks for your fork and the changes you made there.
Do you see any chance that we can get features into this repository via a PR? Ideally without dropping any features so e.g. users can decide whether to use MQTT or HTTP reporting to Home Assistant?
I can understand that it was easier for you to make a fork and adapt it to your needs. However, I don't think most people will want to build their own docker image and make it available to their devices, as most just run Portainer on Hass.io itself. I think everyone can benefit from this if we can merge the best solutions together.
I'd appreciate if you think this is possible and would love to invest some time in merging pieces of your code. I for myself don't have that much time to develop this project in the next month, but would love to look over code and help testing so I can support this process as good as I can.
Let me know what you think and feel free to create a PR whenever you think it makes sense 😊 thank you!
from hass-lovelace-kindle-screensaver.
I've fixed this in my fork (as well as lots of other changes) by having the code sleep for a bit and then retry when it can't reach Home Assistant. I've found it greatly helps performance to not have the docker container constantly being restarted just because Home Assistant is down.
https://github.com/lanrat/hass-screenshot
from hass-lovelace-kindle-screensaver.
Is this fork inline with recent changed in the main code? (battery reporting changes).
I changed all metadata being reported to the server to use HTTP headers instead of query parameters. And I use MQTT Discovery to automatically report the data to Home Assistant.
It also has a better index page with stats/info on the screenshots and devices connected.
from hass-lovelace-kindle-screensaver.
I have a modified version of that too: https://github.com/lanrat/hass-kindle-screensaver
The readme has not been fully updated yet.
from hass-lovelace-kindle-screensaver.
Correct. You need to build it yourself. Just run make
.
from hass-lovelace-kindle-screensaver.
@sibbl , @lanrat as a user, and someone who has now tried both versions of each project, it would be really great to see a combination of both feature sets in one release but also do understand the time constraints for both of you.
@lanrat would it be possible to enable issue tracking on your repositories as although I have it installed there are a number things that I don’t have working (MQTT discovery for one) and I don’t feel it’s right posting about them here 🤣.
from hass-lovelace-kindle-screensaver.
@aptonline I just enabled issues. Thanks for letting me know!
from hass-lovelace-kindle-screensaver.
If you can, submit the docker log. Also try seeing if your firewall (on the host) accepts both out and inbound traffic on udp and tcp w/ port 8123.
from hass-lovelace-kindle-screensaver.
That's what it was at the end (output from "docker logs"), or what kind of docker log do you mean?
The firewall etc has absolutely nothing to do with this - it's just that Home Assistant wasn't up and running when h-l-k-s started. When h-l-k-s is restarted everything works fine. What is needed is to catch the exception, sleep, and retry.
from hass-lovelace-kindle-screensaver.
@bictorv thanks for the report. Seems like I never had this issue as I have the nginx HASS addon running in front of Home Assistant. Perhaps this is a quick workaround as I currently don't have much time to fix this.
If the whole Docker container crashes (and not just some thread inside the Node.js app), then it would also be possible to run the docker container with --restart unless-stopped
or add restart: unless-stopped
to the docker-compose.yml
. But I haven't tried this myself.
from hass-lovelace-kindle-screensaver.
Hi there,
I'm having the same issue and tried out several things, I solved it temporarily by doing a scheduled docker restart every hour to prevent freezing if I restart home-assistant for some reason (scheduled or just playing around).
A permanent solution would be really appreciated, either by acutally fixing it the way bictorv suggested or maybe easier by just letting the container crash when that error is thrown so that the docker restart policy can actually detect it and do the reboot that solves the issue. Would you consider that?
from hass-lovelace-kindle-screensaver.
If you figure out a way to crash the container (in javascript), I could do the coding.
from hass-lovelace-kindle-screensaver.
Unfortunately I didn't have the time yet to look into the issue for this project.
I assume that we might get a disconnected browser at some point, or can catch timeout exceptions somewhere.
I've already had some experiences with this in another project. I assume the fix for this issue here is kind of similar: https://github.com/sibbl/blinkist-podcast-server/blob/master/src/utils/crawler.mjs#L25-L35
from hass-lovelace-kindle-screensaver.
that looks very promising, the error appears at a refused connection so it is safe to assume that you can catch it with this.browser.on("disconnected"
If you put it in the repo I'm happy to test it.
from hass-lovelace-kindle-screensaver.
I tried, but it seems "disconnected" is not catching this error (but other situations, so it's a good idea). Other suggestions?
Or does anyone know if it's possible to set the node CLI flag --unhandled-rejections=strict
as indicated in the error message, through the puppeteer API? It seems it would make a lot of sense, also if its is going to be the default behaviour.
from hass-lovelace-kindle-screensaver.
I'm seeing a similar issue when I take the home assistant docker container down briefly to update hass-lovelace-kindle-screensaver
crashes with the following in the log:
Error: net::ERR_CONNECTION_REFUSED at http://x.x.x.x:8123
stdout
12:14:19
at navigate (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:155:23)
stdout
12:14:19
at processTicksAndRejections (node:internal/process/task_queues:96:5)
stdout
12:14:19
at async FrameManager.navigateFrame (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:130:21)
stdout
12:14:19
at async Frame.goto (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:500:16)
stdout
12:14:19
at async Page.goto (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:1167:16)
stdout
12:14:19
at async /app/index.js:40:3
from hass-lovelace-kindle-screensaver.
My impression is that the problem is gone: the process crashes and is then restarted. The original error message above said
In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
and my guess is that we are now in that future.
Sometimes waiting will solve the problem. ;-)
from hass-lovelace-kindle-screensaver.
I've fixed this in my fork (as well as lots of other changes) by having the code sleep for a bit and then retry when it can't reach Home Assistant. I've found it greatly helps performance to not have the docker container constantly being restarted just because Home Assistant is down.
Is this fork inline with recent changed in the main code? (battery reporting changes).
from hass-lovelace-kindle-screensaver.
Does it rely on the screensaver extension for the battery reporting to work?
from hass-lovelace-kindle-screensaver.
I've fixed this in my fork (as well as lots of other changes) by having the code sleep for a bit and then retry when it can't reach Home Assistant. I've found it greatly helps performance to not have the docker container constantly being restarted just because Home Assistant is down.
lanrat/hass-screenshot
Image doesn't seem to be available on Docker Hub.
from hass-lovelace-kindle-screensaver.
Hey @sibbl,
My original intent was to submit a few PRs. However since then, the scope of the changes increased and do contain some breaking changes, so I'm not sure how to proceed. Especially since my fork includes some changes you are not ready to include (ex: #7).
Unfortunately I don't have the time to go through and cherry pick commits to submit as PRs, especially since I also forked https://github.com/lanrat/hass-kindle-screensaver to work with the new changes as well.
If it's easiest for everyone, I can look into adding automated docker builds to my fork.
I'm happy to hear your thoughts on this.
from hass-lovelace-kindle-screensaver.
Related Issues (20)
- Error and questions connecting with Hassio Addon HOT 3
- failed to start browser in docker HOT 8
- Feature Request: Multiple Dashboards/Instances HOT 1
- docker failed to start HOT 1
- HA OS 32bit not supported? HOT 9
- Timeout Errors HOT 2
- Feature Request: .monochrome and .crop would be awesome! HOT 1
- Feature request: output to jpg file format HOT 8
- Multiple request array doesnt appear to accept configuration HOT 13
- Error: Command failed: convert: unrecognized dither method `-background' HOT 8
- Feature request - Stop container exiting after error HOT 2
- How to select which theme to take? HOT 2
- Feature Check - ARM Builds HOT 2
- Extension extremely unstable HOT 5
- Failed to render TimeoutError: Navigation timeout of 60000 ms exceeded HOT 6
- Brightness difference between HA addon and standalone docker
- Add healthcheck endpoint at /health
- Add Support for Bitmap-Output HOT 2
- Failed to get TZ variables in container HOT 4
- "Loading data" after first image generation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hass-lovelace-kindle-screensaver.