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 07-16-2023, 07:14 AM   #16
Kindleschokolade
Connoisseur
Kindleschokolade began at the beginning.
 
Posts: 59
Karma: 14
Join Date: Dec 2021
Device: kindle PW3
As a small follow up:
The behaviour seems to be inconstant. The kindle does not wake up everytime when the raspberry pi is powered up and boots.
Maybe it could also be an issue with the cable?
Kindleschokolade is offline   Reply With Quote
Old 07-16-2023, 11:04 AM   #17
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,772
Karma: 103362673
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by Kindleschokolade View Post
As a small follow up:
The behaviour seems to be inconstant. The kindle does not wake up everytime when the raspberry pi is powered up and boots.
Maybe it could also be an issue with the cable?
Are you sure that you are completely shutting down the kindle?
j.p.s is offline   Reply With Quote
Advert
Old 07-17-2023, 06:50 AM   #18
Kindleschokolade
Connoisseur
Kindleschokolade began at the beginning.
 
Posts: 59
Karma: 14
Join Date: Dec 2021
Device: kindle PW3
i run "shutdown -h now"
that should do it, no?
Kindleschokolade is offline   Reply With Quote
Old 07-17-2023, 12:07 PM   #19
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,772
Karma: 103362673
Join Date: Apr 2011
Device: pb360
Yes.

I guess that I haven't connected a powered USB to a shutdown kindle often enough to notice that sometimes that doesn't cause the kindle to boot. (I did check with one of my powered off kindles before I made the suggestion.)
j.p.s is offline   Reply With Quote
Old 07-18-2023, 09:36 AM   #20
Kindleschokolade
Connoisseur
Kindleschokolade began at the beginning.
 
Posts: 59
Karma: 14
Join Date: Dec 2021
Device: kindle PW3
So this gets interesting here.
I have actually two kindle PW2 in my system. Both connected to the raspi.
They both share the same configuration / jailbreak / custom python scripts.
When I request the "shutdown -h now" command both do shutdown.
However, if I do not cut the power to their USB port immediately, they reboot.
If I do they stay shutdown.
One of them however does not wake up automatically when the power is restored.
The other does ...
EDIT: after a couple more tries now the other one also does not wake on usb connect ...

Last edited by Kindleschokolade; 07-18-2023 at 11:51 AM.
Kindleschokolade is offline   Reply With Quote
Advert
Old 07-20-2023, 12:29 PM   #21
Kindleschokolade
Connoisseur
Kindleschokolade began at the beginning.
 
Posts: 59
Karma: 14
Join Date: Dec 2021
Device: kindle PW3
Another follow up on the
lipc-set-prop com.lab126.powerd deferSuspend value
Anytime the "Powerd state" changes this value gets set back to the default.
So the perpectual "ready to suspend" responsive state is not easy to achieve when the device is connected to power on and off over times as it is in my installation.
The moment the raspberry is shut down the kindle goes to first "Screen Saver" for 10 Minutes and then "Ready to suspend" for one minute.
would surely be nice to have a hook in the system event when the power is changed to achieve more granular control.
For now the only thing I could think of is a script which runs every couple of seconds checking on the "Powerd state"
and setting "lipc-set-prop com.lab126.powerd deferSuspend" to a high value when the result is "Ready to suspend"
Kindleschokolade is offline   Reply With Quote
Old 07-20-2023, 05:07 PM   #22
Kindleschokolade
Connoisseur
Kindleschokolade began at the beginning.
 
Posts: 59
Karma: 14
Join Date: Dec 2021
Device: kindle PW3
Ok. So to whom it might concern:
I wrote a little shell script that checks the "Powerd state" and sets com.lab126.powerd deferSuspend to 3000000 if it's less then 10
Code:
#!/bin/sh 
while sleep 1;
do 
r=`powerd_test -s`
g=`echo $r | grep "Ready to suspend"`
if [ ! -z "$g" ]
then
	line=`echo "$r" | grep "Remaining time in this state:"`
	value="${line#*: }"
	if [ "${value%%.*}" -lt 10 ]; then
		lipc-set-prop com.lab126.powerd deferSuspend 3000000
	fi
fi
done
exit 0
I start it via a conf file in /etc/upstart/
and make sure it runs via cron.


of course this will drain the kindles battery quite fast.
In my case its not an issue as the device is usually started / woken up once a day.
Kindleschokolade is offline   Reply With Quote
Old 07-21-2023, 01:45 AM   #23
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
You might want to look into `lipc-wait-event` .
NiLuJe is offline   Reply With Quote
Old 07-21-2023, 11:23 AM   #24
Kindleschokolade
Connoisseur
Kindleschokolade began at the beginning.
 
Posts: 59
Karma: 14
Join Date: Dec 2021
Device: kindle PW3
Ah
Well it was worth doing some shell script syntax recap.

here is the shorter one using the event:
Code:
#!/bin/bash
echo "com.lab126.powerd" |lipc-wait-event -m -l "readyToSuspend" | while read event; do
	g=`echo $event*| grep "readyToSuspend"`
	if [ ! -z "$g" ]
	then
		lipc-set-prop com.lab126.powerd deferSuspend 3000000
	fi
	done
Feel free to make optimisations
Kindleschokolade is offline   Reply With Quote
Reply

Tags
suspend


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle touch 5.1.0 SSH password Oneill Kindle Developer's Corner 19 01-12-2018 04:27 PM
Can't SSH Into Kindle Touch magnetik Kindle Developer's Corner 28 11-18-2012 08:59 AM
17 Grey Levels on Kindle Touch? EternalCyclist Kindle Developer's Corner 5 11-06-2012 02:53 PM
Kindle Touch SSH access? firite Kindle Developer's Corner 3 05-03-2012 09:36 AM
So no sleep or suspend? How about RESUME? Asterra iRex 1 12-28-2007 01:55 PM


All times are GMT -4. The time now is 03:12 AM.


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