diff --git a/install.sh b/install.sh index 35149cd7..861dc6c3 100755 --- a/install.sh +++ b/install.sh @@ -14,5 +14,5 @@ ssh root@192.168.2.12 << EOF chmod 777 main chmod 777 /etc/init.d/life-dashboard-init - echo "Install complete, start script with: `/etc/init.d/life-dashboard-init start`." + echo "Install complete, start script with: `/etc/init.d/life-dashboard-init start` and let it run till the ssh session hangs" EOF \ No newline at end of file diff --git a/start.sh b/start.sh index cad22612..50b00b82 100644 --- a/start.sh +++ b/start.sh @@ -38,13 +38,15 @@ while true; do echo "drawing image" eips -f -g /image.png - sleep 1 - echo "drawing battery level" - batteryLevel=$(lipc-get-prop com.lab126.powerd battLevel) - eips 46 38 "$batteryLevel" - + echo "writing stats" + next_refresh=$((`date +%s` % 86400 - (4*60*60) )) # seconds till midnight + if [ $next_refresh -le 0 ]; then next_refresh = 24*60*60; fi + battery_level=$(lipc-get-prop com.lab126.powerd battLevel) + eips 2 37 "$next_refresh $battery_level" + eips 2 38 "$(TZ=UTC+4 date -R "+%a %l:%M")" + echo "entering rtc sleep" sleep 5 - echo 86400 > /sys/devices/platform/mxc_rtc.0/wakeup_enable + echo $next_refresh > /sys/devices/platform/mxc_rtc.0/wakeup_enable echo "mem" > /sys/power/state done