Skip to content

Commit

Permalink
refresh at midnight
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhampgonsalves committed Jan 26, 2023
1 parent 10ba406 commit 93ac0e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ ssh [email protected] << 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
14 changes: 8 additions & 6 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 93ac0e8

Please sign in to comment.