Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 09-10-2019, 08:25 PM   #1
yparitcher
Connoisseur
yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.
 
Posts: 52
Karma: 616590
Join Date: Feb 2019
Device: K4 KT4 PW4 PW5
RTC wakeup KT4

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

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;
the script is also attached

see https://github.com/yparitcher/kindle-zmanim for example usage
yparitcher is offline   Reply With Quote
Old 09-26-2019, 02:06 PM   #2
yparitcher
Connoisseur
yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.yparitcher ought to be getting tired of karma fortunes by now.
 
Posts: 52
Karma: 616590
Join Date: Feb 2019
Device: K4 KT4 PW4 PW5
script attached
Attached Files
File Type: zip wakeup.zip (826 Bytes, 163 views)
yparitcher is offline   Reply With Quote
Advert
Reply

Tags
kt4, rtc


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial FW >= 5.11 Factory JailBreak (i.e., KT4) NiLuJe Kindle Developer's Corner 110 12-13-2020 08:40 AM
Is KT4 still shipped with FW 5.11.0? itisbomb Kindle Developer's Corner 2 07-15-2019 04:14 PM
Trying to Jailbreak KT4 brand new with firmware 5.11.0 susmoka Kindle Developer's Corner 12 07-11-2019 05:05 PM
4NT wakealarm / rtc iikku Kindle Developer's Corner 2 02-20-2019 09:07 AM
IQ PocketBook IQ: battery drain from random wakeup? hiaig PocketBook 10 03-15-2011 09:16 AM


All times are GMT -4. The time now is 09:51 PM.


MobileRead.com is a privately owned, operated and funded community.