Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-02-2023, 09:05 AM   #1
mat02
Junior Member
mat02 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Aug 2023
Device: PB Touch Lux 3
Question Wake up from the sleep?

Hi.
I know that we can block the device from powersave by writing to /sys/power/wake_lock, but can we do the opposite and force it to sleep with a timer set to wake up the device after some period of time?

The main idea is to write a script that wakes up the device periodically to download some data and, possibly, display it on the screen. This way, the device could be used to display agenda in a conference room for much longer than with the sleep disabled.

What do you think?
mat02 is offline   Reply With Quote
Old 08-02-2023, 11:53 AM   #2
jrw174
Connoisseur
jrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the rough
 
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
Thinking about it in psuedo code way. I'd do this

Create a sh script
Create a infinite loop based on a time interval (I don't think we can use systemDTimers or CRON)
In the loop get your data that you want
In the loop call one of the inkview apis that wake the device maybe OpenScreen() from this link https://github.com/blchinezu/pocketb...lude/inkview.h
Display with Dialogshow
Have an option to exit the script in the DialogShow

So something like
For( time interval) do
GetData()
Call Openscreen()
ShowDialog()
If DialogReponse == exit
Exit
End loop
Exit


Not sure how this would effect battery with an infinite loop. If someone knows how to set timers up please reply! I'd like to know as well
jrw174 is offline   Reply With Quote
Advert
Old 08-02-2023, 04:03 PM   #3
mat02
Junior Member
mat02 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Aug 2023
Device: PB Touch Lux 3
Hmm, I am not quite sure how this could wake up a device after some time of sleep.
Anyhow, I've looked into that header you linked and there is a method called GoSleep(int ms, int deep). Maybe that could work, something like:
while True:
GetData()
GoSleep(300 * 1000, 1) # Deep sleep for 5 minutes

Do you know if these methods can be called directly from the shell?
mat02 is offline   Reply With Quote
Old 08-02-2023, 04:07 PM   #4
jrw174
Connoisseur
jrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the rough
 
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
The dialog one can for sure. Take a look here at a small shell script I created to update KoReader book progress to pocketbook library https://github.com/jjrrw174/PocketBo...ith-PB-Library
jrw174 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wake up from sleep peterson Kindle Developer's Corner 37 03-08-2024 04:20 PM
Old kobo with automatic sleep/wake mattcd216 Kobo Reader 15 06-08-2023 06:41 PM
Clara Magnet for sleep/wake feature ? Rojofo Kobo Reader 15 01-29-2021 08:49 AM
Can I set my Kindle 4 to wake from sleep? tickett Kindle Developer's Corner 4 12-29-2018 06:41 AM
HD how to debug auto wake/ sleep stumped Kindle Fire 5 12-19-2017 12:26 PM


All times are GMT -4. The time now is 04:45 AM.


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