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 scriptrsvg-convert and pngcrush binaries and libs are included.
config.py
wifi.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
killall kindle-weather.sh
(or if you are using the upstart script stop weatherstation
).