pascalw / kindle-dash

Power efficient dashboard for Kindle 4 NT devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to download image

iantearle opened this issue · comments

Just tried the latest release, all was fine, but it failed to download the image

This line appears to be incorrect: $(dirname "$0")/../ht"

Logs are as follows:

Partial screen refresh
eips: paint_image> cannot open "./dash.png":can't fopen
Going to suspend, next wakeup in s
Wed May 25 12:06:42 UTC 2022 Battery level: 97%.
./dash.sh: line 111: ./next-wakeup: Permission denied
sh: 3600: unknown operand
Refreshing dashboard
Wi-Fi connected
./local/fetch-dashboard.sh: line 4: ./local/../ht: not found
Partial screen refresh
eips: paint_image> cannot open "./dash.png":can't fopen```

Equally, if I move ht folder to some other place in the directory structure I get line 4: local/../ht: Permission denied

Hi, I'm having a similar issue - my logs look like this:
Wed Jul 20 12:05:11 GMT-03:15 2022 Battery level: 96%. ./dash.sh: line 122: ./next-wakeup: Permission denied Refreshing dashboard Wi-Fi connected ./local/fetch-dashboard.sh: line 4: ./local/../ht: not found Not updating screen, fetch-dashboard returned 127 Going to suspend, next wakeup in s

Did you manage to fix this issue?

Ensure the images is coming from http a non secure location. HTTPS isn't available on the Linux build of kindle 4

Hi sorry for my late reply. I'll try to look into this later this week. It seems to be a file permissions issue.

Btw HTTPS should work. The HTTP client (ht) uses rusttls with bundled root certificates.

cool, this is now working perfectly with a github pages HTTPS page - I think my error was because I had failed to make one of my files executable
Thanks so much for your code @pascalw !!

@iantearle @floftus-at-csm I've looked into this and indeed it seems this must be related to (some of the files) somehow missing the executable bit in your case. I've checked the last release however and the tarball does have the right permissions set on the files. Do you remember how you've extracted the tarball and copied it to the Kindle?

Btw HTTPS should work. The HTTP client (ht) uses rusttls with bundled root certificates.

In my case the image download doesn't fail for permission issues, but for xh somehow not being able to parse the system certificates file.
I found curl working very well on my Kindle PW Touch for https links, and it should be a pretty standard utility, present almost everywhere, so I filed a pull request with this and another fix to make it work on PW Touch.

Thank you for this great piece of software!

Hi there, I've come back to this and am attempting to run kindle-dash via KUAL. I am consistently getting this error in my logs
xh: error: builder error: Could not load PEM file "/etc/ssl/certs/ca-certificates.crt" Caused by: Could not load PEM file "/etc/ssl/certs/ca-certificates.crt" Not updating screen, fetch-dashboard returned 1
I am on a Kindle 4
Do you know how to get around this?
The url I am attempting to get is an HTTPS url, the same as I was using before

Yes, it's exactly the problem I was talking about. You should try to use curl. You may want to try my fork or wait for it to be merged. https://github.com/penguin86/kindle-dash
Sorry for the lack of details, but I'm currently away from my computer.

@floftus-at-csm which Kindle model are you using? On my kindle 4 NT I do have a system certificate bundle at /etc/ssl/certs/ca-certificates.crt. I guess that other models might not have this?

The reason that I provide the xh http client is that curl and wget on the kindle 4 NT are too old to communicate with modern HTTPS endpoints. If you have a newer kindle then the built-in curl might work for you. In that case you can just modify fetch-dashboard.sh to use curl instead of xh.

Thinking about this now it might make sense for kindle-dash to include a recent set of root certificates. xh can be compiled with root certificates built into the binary. That's pretty useful given that most kindles that are used for this purpose are old and don't receive updates anymore.

hey, thanks both for your response - I have tried to use the CURL solution but this gives me the error you predicted @pascalw
curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version Not updating screen, fetch-dashboard returned 35
This is on a Kindle 4 (version 4.1.2)
If you could compile xh with root certificates at some point that would be amazing :)

I can confirm my kindle is slightly newer, it's a Paperwhite Touch. I've seen it referred also as "Kindle 5" somewhere. On mine, unfortunately xh does fail with error Could not load PEM file "/etc/ssl/certs/ca-certificates.crt". The file exists and, as long as I can see, is readable.

@floftus-at-csm or @penguin86 could you try if the attached xh build works for you?

xh.zip

Unfortunately I still get the same error with this build

`xh: error: builder error: Could not load PEM file "/etc/ssl/certs/ca-certificates.crt"

Caused by:
Could not load PEM file "/etc/ssl/certs/ca-certificates.crt"`

However! I went back to the ht method from kindle-dash-1.0.0-beta.3 and it worked - images downloaded from an HTTPS url no problem

Humm that's interesting. I guess it might be a bug in xh then. I don't have much time to dive into it now unfortunately, maybe I'll have another look later. It's a bit difficult since I can't reproduce this myself on my kindles.