06-18-2019, 05:30 PM | #1 |
Enthusiast
Posts: 46
Karma: 97694
Join Date: Feb 2012
Device: kindle touch
|
Weather Maps on Kindle
Dear Fellow Mobilereaders,
it's been quite a while since my last visit here, but I'm glad that the forum is still very active. As you might remember I equipped my Kindle Touch with a solar cell in 2012 (and upgraded the cell in 2013): https://www.mobileread.com/forums/sh...d.php?t=182872 I still use this upgraded Kindle and haven't charged it ever since. However: For a few years I have been paragliding now, so I am more interested in the wheater as I used to be. I would like to get a deeper understanding of the wheater than "tomorrow it's gona be rainy and 20 °C". For that I found wheater maps to be helpful (once you learn how to read them and you look in the sky occasionally you understand why the clouds look how they are... I would like to add funcitionality to my device: I would like to show a wheater map when in standby/screensaver mode. Basically I want the Kindle to do the following: - Every Morning at 5:50 AM, wake up, connect to wifi, download a weather map from a public source, e.g.: Analysis: https://www.dwd.de/DWD/wetter/wv_spe...ck_weu_ana.png Prognosis: https://www.dwd.de/DWD/wetter/wv_spe...den_na_024.png - disconnect from wifi (i run on solar power, so i don't have mA's for free ;-) - convert this file to fit the screen (i.e. 800x600 png, greyscale) - the image from DWD (=Deutscher Wetterdienst/German Wheater Service) almost has the correct aspect ratio. The images attached are slightly squeezed to fit 800x600. Cropping a few pixels on the top would also be ok - display this image in standby/screensaver mode until the next update What I've done so far: - Jailbroken my kindle touch (now running 5.3.7.3) - ssh via Wifi works - installed python - installed the Screensavers Hack (it's already displaying a manually uploaded wheater map) Where I need help: - I think I will need a script that does the following - wake up the kindle - I have no idea how the png to png(800x600 greyscale) (or something the screensaver can display) conversion could work on a kindle, I think this is the hardest part- turn on wifi - download the image (unfortnunatley it' served why https only, wget on the kindle doesn't support that?) - turn off wifi - convert the image - copy the image to the screensaver folder - do something to update the screensaver? - go back to sleep/screensaver - I don't know how to run this script every morning automatically - After all I think it would be great to do all this in a way that others can use it aswell (with KUAL and the new MRPI), but I have no idea how to do that. So I would be very happy if someone is willing to help me! Last edited by nick-tech; 06-18-2019 at 05:46 PM. |
06-18-2019, 08:28 PM | #2 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
The first thing to do, if not already done, is to update your KT (K5) to the current Amazon update.
Why? Amazon updated the OS for TLS rather than SSL protocal. I.E: That might be why you can't access HTTPS now (HTTPS/SSL is no longer supported by servers in general). |
Advert | |
|
06-19-2019, 12:12 AM | #3 |
Enthusiast
Posts: 46
Karma: 97694
Join Date: Feb 2012
Device: kindle touch
|
I am currently Running 5.3.7.3, that seems to be the latest Version for KT offerred by amazon. Are there other sources?
|
06-19-2019, 02:11 AM | #4 |
BLAM!
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Might just be the busybox wget build . Kobo's is SSL-less too, FWIW.
Not a massive issue, can be replaced with a custom curl build, or python w/ requests. The png conversion is also trivial, since you already have all you need (IM) in the screensavers hack. If you setup stuff properly, rotating the screensaver is also trivial (there's basically nothing to do as long as there's only a single file, c.f., cover mode) Handling wifi is just a lipc call away (c.f. KOReader). Same for forcing a suspend when you're done. The actually tricky bit will be to get rtc wakes to behave so you can actually wake the device up and make it do stuff. Here be dragons, because every device does it differently. You might want to take a look at a factory firmware and/or diags, because I seem to remember some helpful rtcwake test scripts in there. Last edited by NiLuJe; 06-19-2019 at 02:16 AM. |
06-19-2019, 10:10 AM | #5 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Hmm... That Busybox / wget (whichever) must be from very early in the system development. Because later the OpenSSL library is included, so it was only that Lab126 didn't re-build the older binary(ies) to include the library. Hmm2... That may have changed due to the recent re-configuration of Busybox (with the "fix" of tar). Which of course is not likely to happen on such an out of date system. |
|
Advert | |
|
06-19-2019, 06:21 PM | #6 |
Enthusiast
Posts: 46
Karma: 97694
Join Date: Feb 2012
Device: kindle touch
|
So what du i Need to do to get that png to my Kindle over ssl? I trief it with the built in busybox wget, but i have no idea how to replace that..
And how do i Access the resizing Tool that comes with the screensaver hack? |
06-20-2019, 01:10 AM | #7 |
BLAM!
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
I'm going to be blunt: I'm not going to write this for you, so, do your homework, and come back with actually relevant questions that don't look like "please do it for me".
I hinted earlier that looking at the cover mode implementation of the screensavers hack would be helpful as a "single image" screensaver setup, turns out it's also the place to look for examples on how to deal with image conversion. As for SSL, as I said, I'd go with Python via requests, as that won't require anything custom, since I don't ship curl anywhere on Kindle. Last edited by NiLuJe; 06-20-2019 at 01:12 AM. |
06-21-2019, 04:41 PM | #8 |
Enthusiast
Posts: 46
Karma: 97694
Join Date: Feb 2012
Device: kindle touch
|
hi all,
so I managed with some help to get the kindle to download, shut down wifi and convert the wanted image: Code:
import requests import os r = requests.get('https://www.dwd.de/DWD/wetter/wv_spez/hobbymet/wetterkarten/ico_tkboden_na_024.png', allow_redirects=True) os.system("lipc-set-prop com.lab126.cmd wirelessEnable 0") with open('bild.png', 'wb') as f: f.write(r.content) os.system("/mnt/us/linkss/bin/convert /mnt/us/wetter/bild.png -rotate 270 -colorspace gray -resize 600x800\! -depth 8 -colors 16 +dither -type palette -quality 75 /mnt/us/linkss/screensavers/bg_xsmall_ss00.png") That seems to work. However until now the screensaver only displays a new image after restarting the framework (through kual). Is there a better way to do that? The image should already have the correct format and has always the same name, so I don't understand why that is necessary.. |
06-22-2019, 01:24 AM | #9 |
BLAM!
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
If there's only one image in the pool, you won't have to restart the framework. Both the cover and overlay mode of the screensaver hack take advantage of that fact .
I'm not sure you'll be able to replicate that exactly without switching to said modes, because the standard mode maaaay be doing stuff that messes with that. I honestly can't recall. Last edited by NiLuJe; 06-22-2019 at 01:27 AM. |
06-22-2019, 04:23 AM | #10 |
Enthusiast
Posts: 46
Karma: 97694
Join Date: Feb 2012
Device: kindle touch
|
update:
apparently the kindle only woke up yesterday evening during my test phase (i set the cron wake time to a few minutes in the future). This morning the kindle did not wake up how it should (after a few hours of sleep). Any ideas? But i tired to change the contents of the single screensaver image without changing the name. That did not require a framework restart to be applied. |
06-22-2019, 10:17 AM | #11 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Software programs are required to run a CPU. CPU(s) do not compute (run) when the Kindle is shutdown. Duh... |
|
06-22-2019, 10:58 AM | #12 |
Enthusiast
Posts: 46
Karma: 97694
Join Date: Feb 2012
Device: kindle touch
|
@knc1:
- is there an overview when the kindle is in which sleep mode? Because yesterday evening the screen was in "screensaver mode" and cron worked as it should - this morning the kindle was apparently in a deeper sleep mode and cron did not wake it up - is the kindles cpu really off when in screensaver mode for a longer period of time? Because waking up happens quite fast (a few seconds), while a reboot takes 1-2 minutes @NiLuJe: - you mentioned rtc wake. can you point me to a starting point on how to get that working. (like a path to that diags folder partition) thanks, nick-tech |
06-22-2019, 01:13 PM | #13 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
The screen saver displayed on the screen has very little to do with when the CPU goes to sleep.
Yup, it is a fast resume, it is intended to be a Linux wake-up function fast enough to find your laptop awake by the time you open the top. I.E: It does a "suspend to ram" function. (and the ram is running on a minimal 'stay alive' power function) Yup, the Kindle also has a micro-controller or two that DOES continue to run, including one that maintains the rtc (real time clock). (think about it, how else can you do an electronic resume function on a mechanical push button (or hall effect device) without something that continues to run?). |
06-23-2019, 12:40 PM | #14 |
Enthusiast
Posts: 46
Karma: 97694
Join Date: Feb 2012
Device: kindle touch
|
Hi all,
i tried several ways to get the rtc to wake up the kindle: 1. writing directly to /sys/class/rtc/rtc0/power/wakeup (there is no /wakealarm for rtc0) Code:
echo "1561370760" > /sys/class/rtc/rtc0/power/wakeup cat /sys/class/rtc/rtc0/power/wakeup there is also a 2nd rtc (rtc1), but I can't write to /sys/class/rtc/rtc1/wakealarm either (but at least that exists..) 1. via com.lab126 powerd rtcWakeup after kindle has gone to the "Ready to suspend mode Code:
#!/bin/sh -xe sleeptime=100 sleepfor() { lipc-set-prop -i com.lab126.powerd rtcWakeup $1 } wait_for_ready_suspend() { return `powerd_test -s | grep Ready | wc -l` } while wait_for_ready_suspend; do sleep 1; done sleepfor $sleeptime cat /proc/driver/rtc cat /sys/class/rtc/rtc0/power/wakeup Code:
+ sleep 1 + wait_for_ready_suspend + powerd_test -s + grep Ready + wc -l + return 1 + sleepfor 100 + lipc-set-prop -i com.lab126.powerd rtcWakeup 100 + cat /proc/driver/rtc rtc_time : 16:30:49 rtc_date : 2019-06-23 alrm_time : 00:00:00 alrm_date : 1970-01-01 alarm_IRQ : no alrm_pending : no 24hr : yes alarm_IRQ : no + cat /sys/class/rtc/rtc0/power/wakeup |
06-23-2019, 12:51 PM | #15 |
BLAM!
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Unfortunately, not really, no, which is why I mentioned that this was going to be the tricky bit in my original answer.
Full disclosure: I have no actual experience with this myself, I just know it's potentially highly tricky to get to behave, device-specific, and that quite a few people have given up on it over the years. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle weather dashboard | matopeto | Kindle Developer's Corner | 22 | 02-04-2023 06:12 AM |
Using Apple Maps instead of Google Maps | kakkalla | Marvin | 12 | 11-18-2013 07:03 PM |
Content Kindle Weather Station | kindlews | Amazon Kindle | 38 | 02-15-2012 09:25 AM |
Free (Kindle app) AccuWeather (Weather Forecasts on Kindle) | arcadata | Deals and Resources (No Self-Promotion or Affiliate Links) | 6 | 11-06-2011 02:39 PM |
Maps on Kindle 2? | FreakyT | Amazon Kindle | 7 | 11-19-2010 07:22 PM |