View Single Post
Old 08-27-2022, 06:25 AM   #78
muth
Junior Member
muth began at the beginning.
 
muth's Avatar
 
Posts: 1
Karma: 10
Join Date: Aug 2022
Device: KT2 - 5.10.3
Thanks to these two posts bellow, I could have onlinescreensaver working on a KT2 (basic 2014) with FW 5.10.3 :



Thanks a lot Peterson for the onlinscreensaver scripts, mironov for finding how to wake the kindle from sleep and jonnydeath for the path tricks!


Quote:
Originally Posted by mironov View Post
I'm using Onlinescreensaver on my Kindle Touch (K5), and spent good amount of time getting it to wake up from suspend.

Here is the code I ended up with:

Code:
# runs when in the readyToSuspend state;
# sets the rtc to wake up
# arguments: $1 - amount of seconds to wake up in
set_rtc_wakeup()
{
	lipc-set-prop -i com.lab126.powerd rtcWakeup $1 2>&1
	logger "rtcWakeup has been set to $1"
}

##############################################################################
# sets an RTC alarm
# arguments: $1 - time in seconds from now

wait_for () {
	ENDWAIT=$(( $(currentTime) + $1 ))
	REMAININGWAITTIME=$(( $ENDWAIT - $(currentTime) ))
	logger "Starting to wait for timeout to expire: $1"

	# wait for timeout to expire
	while [ $REMAININGWAITTIME -gt 0 ]; do
		EVENT=$(lipc-wait-event -s $1 com.lab126.powerd readyToSuspend,wakeupFromSuspend,resuming)
		REMAININGWAITTIME=$(( $ENDWAIT - $(currentTime) ))
		logger "Received event: $EVENT"

		case "$EVENT" in
			readyToSuspend*)
				set_rtc_wakeup $REMAININGWAITTIME
			;;
			wakeupFromSuspend*|resuming*)
				logger "Finishing the wait"
				break
			;;
			*)
				logger "Ignored event: $EVENT"
			;;
		esac
	done

	logger "Wait finished"
}
Hope it helps someone
Quote:
Originally Posted by jonnydeath View Post
To get this to run on my PW3 with 5.12.4 I had to change all the

source config.sh
source utils.sh

to the full path:

source /mnt/us/extensions/onlinescreensaver/bin/config.sh
source /mnt/us/extensions/onlinescreensaver/bin/utils.sh

in enable.sh, disable.sh, update.sh, schedule.sh
muth is offline   Reply With Quote