Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-24-2018, 06:03 PM   #31
_nico
Junior Member
_nico began at the beginning.
 
_nico's Avatar
 
Posts: 7
Karma: 10
Join Date: Mar 2018
Device: Kindle KT3
Yes! Yes! Yes!
It works for me!
Code:
echo 0 > /sys/class/rtc/rtc0/wakealarm
echo $WAKEUPTIMER > /sys/class/rtc/rtc0/wakealarm
echo "mem" > /sys/power/state
Check my Shellscript on GitHub.

My Kindle KT3 keeps on a single charge, with 57 eips updates a day, 30-35 days.
Attached Thumbnails
Click image for larger version

Name:	kindle-kt3_weatherdisplay_battery-optimized.jpg
Views:	612
Size:	58.4 KB
ID:	163039  

Last edited by _nico; 03-24-2018 at 06:08 PM.
_nico is offline   Reply With Quote
Old 03-26-2018, 08:46 AM   #32
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Nicely done.

The full description:
https://github.com/nicoh88/kindle-kt...tery-optimized

Google translated:
https://translate.google.com/transla...zed&edit-text=

Note:
You do not have to use MySQL on the server to create history logs -
SQLite3 is installed on your Kindle.

Humidity sensor in the bathroom?
Shower on == Rain ?
knc1 is offline   Reply With Quote
Advert
Old 08-05-2018, 05:19 PM   #33
Export
Junior Member
Export began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2017
Device: kindle
Nice @nico - thats what i was looking for. i´ll try it if i find some time.

i used this in the meantime, but i was a total battery sucker.
Export is offline   Reply With Quote
Old 09-12-2019, 06:38 PM   #34
bugfinder
Junior Member
bugfinder began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Sep 2019
Location: NUE
Device: Kindle B011 and G090
might give rtcwake a try

played with this a bit on my kindle touch (B011). I could not really get this to
work using echo to the wakealarm sysfs node, but found something that worked for me,
maybe it helps others:
- the B011 has two rtc devices, only rtc1 (the pmic_rtc) has the wakealarm
- the system has the rtcwake tool installed

this simple hack makes it sleep one minute and come back for me, even without other
things like manually disabling wifi or such:


rtcwake -d /dev/rtc1 -m no -s 60
echo "mem" > /sys/power/state
bugfinder is offline   Reply With Quote
Old 04-14-2021, 11:34 AM   #35
Flecmart
Junior Member
Flecmart began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Apr 2021
Device: KT3
Hi all,

I am currently trying use online screensaver for a private project. I got an allready jailbroken kindle for that. It is a kt3 with Firmware 5.8 and installed.

I installed the linkss screensaver hack via the "Install MR Packages" and it is working. I also installed online screensaver and configured it and everything is working except the wake up. I tried different implementations for the wait_for function that scheduleds the wake up... The result is always the same: online screensaver update just starts when I press the power button and then never again.

Has anybody an idea or hint what I could do to debug this better? I had hope in this thread because _nico confirmed that the method in this thread worked for him and the kt3.

Best regards,
Martin
Flecmart is offline   Reply With Quote
Advert
Old 04-16-2021, 04:08 PM   #36
Flecmart
Junior Member
Flecmart began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Apr 2021
Device: KT3
Okay - I got it after reading nicos weather script a little deeper. And I can confirm that it works on my KT3 with Firmware 5.8.

If someone has problems with online screensaver and the KT3 - i use the following:

wait_for() in util.h
Code:
wait_for () {
        logger "wait_for() started"

        ### Enable CPU Powersave
        CHECKCPUMODE=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor | grep -i "powersave"`
        if [ ${CHECKCPUMODE} -eq 0 ]; then
          echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
          logger "CPU powersave mode"
        fi

        ### Disable Screensaver, no energysaving by powerd
        # powerd buggy since 5.4.5 - https://www.mobileread.com/forums/showthread.php?t=235821
        CHECKSAVER=`lipc-get-prop com.lab126.powerd status | grep -i "prevent_screen_saver:0"`
        if [ ${CHECKSAVER} -eq 0 ]; then
          lipc-set-prop com.lab126.powerd preventScreenSaver 1
          logger "Disabled buggy energy saving"
        fi

        # calculate the time we should return
        ENDWAIT=$(( $(currentTime) + $1 )) 

        # disable/reset current wakeup alarm
        echo 0 > /sys/class/rtc/rtc$RTC/wakealarm

        # set new wakeup time
        echo $ENDWAIT > /sys/class/rtc/rtc$RTC/wakealarm

        # suspend
        logger "wait for device to resume from sleep, or for time out"
        echo "mem" > /sys/power/state
        
        logger "wait_for() finished"
}
update.sh:
Code:
#!/bin/sh
#
##############################################################################
#
# Fetch weather screensaver from a configurable URL.

# change to directory of this script
cd "$(dirname "$0")"

# load configuration
if [ -e "config.sh" ]; then
	source config.sh
else
	TMPFILE=/tmp/tmp.onlinescreensaver.png
fi

# load utils
if [ -e "utils.sh" ]; then
	source utils.sh
else
	echo "Could not find utils.sh in `pwd`"
	exit
fi

# do nothing if no URL is set
if [ -z $IMAGE_URI ]; then
	logger "No image URL has been set. Please edit config.sh."
	return
fi

# enable wireless if it is currently off
if [ 0 -eq `lipc-get-prop com.lab126.cmd wirelessEnable` ]; then
	logger "WiFi is off, turning it on now"
	lipc-set-prop com.lab126.cmd wirelessEnable 1
	DISABLE_WIFI=1
fi

# wait for network to be up
TIMER=${NETWORK_TIMEOUT}     # number of seconds to attempt a connection
CONNECTED=0                  # whether we are currently connected
while [ 0 -eq $CONNECTED ]; do
	# test whether we can ping outside
	/bin/ping -c 1 -w 2 $TEST_DOMAIN > /dev/null && CONNECTED=1

	# if we can't, checkout timeout or sleep for 1s
	if [ 0 -eq $CONNECTED ]; then
		TIMER=$(($TIMER-1))
		if [ 0 -eq $TIMER ]; then
			logger "No internet connection after ${NETWORK_TIMEOUT} seconds, aborting."
			break
		else
			sleep 1
		fi
	fi
done

if [ 1 -eq $CONNECTED ]; then
	if wget -q $IMAGE_URI -O $TMPFILE; then
		mv $TMPFILE $SCREENSAVERFILE
		logger "Screen saver image updated"

		# refresh screen
		logger "Updating image on screen"
		eips -f -g $SCREENSAVERFILE
		
	else
		logger "Error updating screensaver"
		if [ 1 -eq $DONOTRETRY ]; then
			touch $SCREENSAVERFILE
		fi
	fi
fi

# disable wireless if necessary
if [ 1 -eq $DISABLE_WIFI ]; then
	logger "Disabling WiFi"
	lipc-set-prop com.lab126.cmd wirelessEnable 0
fi
Flecmart is offline   Reply With Quote
Old 11-14-2021, 01:15 PM   #37
emale
Junior Member
emale began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2021
Device: Kindle 4
Hi there,

is there also a possibility to wake the Kindle by button-press?
Can't find someting here in the forum.

Wrote a script for a clock/weatherdisplay and put the kindle to sleep with
Code:
echo "" > /sys/class/rtc/rtc1/wakealarm
echo "+60" > /sys/class/rtc/rtc1/wakealarm
Around the whole clock thing a
Code:
while true do...
loop so this runs infinitely.
Would be cool to be able to stop the clock and return to KUAL by pressing any button but the kindle seems to be in a very deep sleep and only a restart can wake it up

An option would be to press a button for a minute (until the kindle wakes up) but also wasn't able to catch the button press in a shell script. Has anyone a code snippet for this?

@knc1: Thanks for sharing your code! The "Shutdown as many services as possible" and "deactivate WLAN/activate WLAN"-parts were very helpful for me.
emale is offline   Reply With Quote
Old 03-08-2024, 04:20 PM   #38
Kuhno92
Junior Member
Kuhno92 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2024
Device: PW2
New onlinescreensaver Version for PW2

I created a new version of the onlinescreensaver which works on my PW2. Happy if someone wants to give it a try:

https://github.com/Kuhno92/onlinescreensaverPW2
Kuhno92 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Glo Kobo Glo won't wake from sleep - on battery jamawg Kobo Developer's Corner 3 11-15-2013 10:33 PM
Nov Patch doesn't fix Wake-from-Sleep bug borisb Kobo Tablets 77 12-04-2011 09:06 PM
Kindle 2 Screensaver or Wake From Sleep Problem JoeC Amazon Kindle 13 04-03-2011 02:58 PM
Shortcut to wake up? Way to increase time between idle & sleep-mode? joe2010 Amazon Kindle 0 06-11-2010 08:41 PM


All times are GMT -4. The time now is 05:34 AM.


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