For anyone trying to wake up the KT4 using the rtc as an alarm to wake at given time here is a script to do so.
every model is a little different this is for a KT4 without SO if you have a different model it will need tweeking
the script is also attached
see https://github.com/yparitcher/kindle-zmanim for example usage
every model is a little different this is for a KT4 without SO if you have a different model it will need tweeking
Code:
#!/bin/sh
#####
# Copyright (c) 2019 Y Paritcher
#####
# runs when the system displays the screensaver
do_ScreenSaver()
{
logger -t "wakescript[$$]" -p local4.info "I display screensaver"
}
# runs when the RTC wakes the system up
wake_up_rtc()
{
logger -t "wakescript[$$]" -p local4.info "I wakeup alarm RTC"
}
# runs when the system wakes up
# this can be for many reasons (rtc, power button)
wake_up()
{
logger -t "wakescript[$$]" -p local4.info "I wakeup alarm"
POWERD_STATES=`lipc-get-prop -s com.lab126.powerd state`
logger -t "wakescript[$$]" -p local4.info "I PowerD state: $POWERD_STATES"
if [ "$POWERD_STATES" == "screenSaver" ] || [ "POWERD_STATES" == "suspended" ] ; then
wake_up_rtc
fi
}
# runs when in the readyToSuspend state;
# sets the rtc to wake up
# delta = amount of seconds to wake up in
ready_suspend()
{
delta="120"
lipc-set-prop -i com.lab126.powerd rtcWakeup $delta
logger -t "wakescript[$$]" -p local4.info "I delta: $delta"
}
# main loop, waits for powerd events
lipc-wait-event -m com.lab126.powerd goingToScreenSaver,wakeupFromSuspend,readyToSuspend | while read event; do
case "$event" in
goingToScreenSaver*)
do_ScreenSaver;;
wakeupFromSuspend*)
wake_up;;
readyToSuspend*)
ready_suspend;;
esac
done;
see https://github.com/yparitcher/kindle-zmanim for example usage