Change old kindle into weather station.
MIT License
Kindle Weather
This project is fully based on the project shared by Matthew Petroff: http://mpetroff.net/2012/09/kindle-weather-display/
Without his kind share of this great work, my kindle 3 might still sleep in the dust.
The changes I made:
Use crontab
instead of kite
or stop powerd
by changing the
suspend_levels
.
Reorganized the weather_script.py
by spliting weather API out.
Change weather-script-preprocess.svg
to fit the weather API.
Warn user when low battery(less than 10%)
I tried to change weather-script-preprocess.svg
to use <image>
tag
for external image which allow me to easily change the icon, but I failed to
at the rsvg-convert point. So still in embedded way.
weather_script.py
file is based on the work of Matthew Petroff 2012, MITweather-script-preprocess.svg
and its embedded icon are underpython2 pngcrush librsvg2-tools
.URL
in display-weather.sh
by pointing to your own http server.mkdir /mnt/base-us/weather
.mntroot rw
scp display-weather.sh root@k3w:/usr/bin/
display-weather.sh
is executable via chmod +x
on kindle.Execute mntroot rw
.
Add this line into /etc/crontab/root
5 6-22 * * * /usr/bin/display-weather.sh
Changed above line to suit your needs.
reboot
command.sudo yum install httpd pngcrush librsvg2-tools python2 -y
sudo systemctl enable httpd
sudo systemctl start httpd
sudo mkdir /var/www/html/weather
sudo chmod 777 /var/www/html/weather/
or use chown
.Create a script named as kindle_weather.sh like below:
export KW_INCLUDE_SCI=1
export KW_LATITUDE=30.6586 export KW_LONGTITUDE=104.0647
KW_AIRPORT=CTU
export KW_WEATHER_KEY="<I_WILL_NOT_TELL_YOU>"
export KW_AQI_CITY="chengdu"
export KW_LANSCAPE_LEFT=1
export KW_OUTPUT="/var/www/html/weather/weather.png"
/home/fge/Source/kindle-weather/weather_script.py ```
Add this line to crontab -e
to refresh weather every 30 minutes
during 6AM to 10PM:
0,30 6-22 * * * /home/fge/bin/kindle_weather.sh 1>/dev/null 2>/dev/null ```
<PATH>/weather_script.py <API_KEY> <LAT> <LON>
.http://<your_server_hostname>/weather/weather.png