Kindle/Weather Display

From Wiki

Based on http://www.mpetroff.net/archives/2012/09/14/kindle-weather-display/

modified for Kindle Touch 5.1.2

Kindle

  • /mnt/us/scripts/weather-init.sh
#!/bin/sh
initctl stop framework &
sleep 3
initctl stop powerd &
sleep 5

/mnt/us/scripts/weather-display.sh >/dev/nul &


  • /mnt/us/scripts/weather-display.sh
#!/bin/sh

while  :
do
	rm weather-image.png
	if wget -q http://host/weather/kindle/weather-image.png
	then
		if [ ! -e weather-current.png ]
		then 
			cp weather-image.png  weather-current.png
		fi

		if [ "$(cat weather-image.png | md5sum)" != "$(cat weather-current.png | md5sum)" ]
		then
			echo $(date -Iseconds) "|" new file >> /tmp/weather-display
			rm weather-current.png
			cp weather-image.png weather-current.png
			eips -c
			eips -c
			eips -f -g weather-current.png
		else
			echo $(date -Iseconds) "|" no changes >> /tmp/weather-display
			#eips -g weather-current.png
		fi
	else
		echo $(date -Iseconds) "|" error >> /tmp/weather-display
		eips -g weather-image-error.png
	fi

	#echo $(date -Iseconds) "|" screen written >> /tmp/weather-display
	sleep 300
done

Server

  • apt-get install pngcrush librsvg2-bin