This is a serverless implementation of a weatherstation for the Kindle (PW2) that is also optimized for battery runtime (~ a month).
The Kindle fetches weather data from Openweathermap.org every 60 minutes, creates a SVG file based on a template, converts the SVG to PNG, displays the newly generated PNG and goes to sleep (STR/suspend to RAM) for the remaining time.
weather2svg.py
: Queries weather data and assembles a SVG file based on templatecreate-png.sh
: Gets data, converts svg file to png and compresses png filekindle-weather.sh
: Main loop, gets and displays data, suspend to RAM and wakeupweather-preprocess.svg
: SVG templateconfig.xml
: KUAL config filemenu.json
: KUAL config filesync2kindle.sh
: rsyncs all files to Kindle, helps during development/debuggingwifi.sh
: Wifi helper scriptweatherstation.conf
: Upstart script
rsvg-convert and pngcrush binaries and libs are included.
- Hack the kindle (doh!) --> Mobileread Forum Thread
- Install KUAL
- Add USBnetworking and python (via MPRI)
- Adjust key and location in
config.py
- Adjust SSID and passphrase in
wifi.sh
- Create directory /mnt/us/extensions/weatherstation
- Copy everything to the newly created directory (or use sync2kindle.sh)
Optionally, you can use a startup script to start the weatherstation automatically when the Kindle comes up.
$ mntroot rw
$ cp /mnt/us/extensions/weatherstation/weatherstation.conf /etc/upstart
$ mntroot ro
$ start weatherstation
- Either press button, quickly login and do a
killall kindle-weather.sh
(or if you are using the upstart scriptstop weatherstation
). - Or force reboot kindle by holding powerbutton ~10 seconds
- Building on ideas and code from
- https://mpetroff.net/2012/09/kindle-weather-display/ and
- https://github.com/nicoh88/kindle-kt3_weatherdisplay_battery-optimized