![]() |
#1 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Dec 2022
Location: Sao Paulo, Brazil
Device: Kindle 4 5-way D01100
|
![]()
Hello!
I'm a longtime reader of this forum, and have used many of the hacks here in my kindles for over a decade (I love the custom screensavers!), but this is my first post. I come here kindly asking for help, as a newbie coding for the kindle. I work with programming and scripting, but mostly for the web (PHP, JS, etc) and PowerShell windows scripting. I have dabbled in Unix shell scripting, but I'm not confident enough to start meddling with the kindle right away. Here is what I want to do. I recently found my old K4 lying around, after a move, in an old box. I jailbroke it and installed KUAL and linkss. I want to write a script to force the kindle to go to sleep for a set amount of time, and then wake up for a second and go back to sleep. In conjunction with the linkss tool, it will effectively become a dumb BW, veeery low power digital picture frame, with a few hundred pictures loaded directly via USB after formatting in Lightroom (I first thought of using the Online screensaver tool, but then it would use a lot more battery power). I found many useful guides here, but no comprehensive detail of the kindle lab126 functions that deal with sleep and wake up, setting up timers, etc. Can anyone experienced point me in the right direction? Thanks in advance ![]() |
![]() |
![]() |
![]() |
#2 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
You'll have to deal with RTC shenanigans, and that's always... fun.
I *think* it's been done on a K4, though, but I'll be damned if I can remember when/where :/. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 52
Karma: 616590
Join Date: Feb 2019
Device: K4 KT4 PW4 PW5
|
|
![]() |
![]() |
![]() |
#4 | |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Jan 2023
Device: kindle 4 D01100
|
Quote:
![]() Your scripts - are they run by cron or something? and do they both wake then lock the screen? I'm looking to automatically unlock the kindle, wait a few seconds and then re-lock in order to change the screensaver (photoframe project). Thanks, matt |
|
![]() |
![]() |
![]() |
#5 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 52
Karma: 616590
Join Date: Feb 2019
Device: K4 KT4 PW4 PW5
|
You run them on the command line (via ssh) and it waits litening for the system state to change.
It will put the kindle back to sleep |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Jan 2023
Device: kindle 4 D01100
|
|
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Jan 2023
Device: kindle 4 D01100
|
Struggling a bit.
I saw in one of the threads linked that Code:
lipc-send-event com.lab126.powerd.debug dbg_power_button_pressed So a simple script: Code:
#!/bin/sh lipc-send-event com.lab126.powerd.debug dbg_power_button_pressed sleep 5 lipc-send-event com.lab126.powerd.debug dbg_power_button_pressed Does a jailbroken kindle have a cron scheduler, or similar? Appreciate the help. Matt |
![]() |
![]() |
![]() |
#8 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Jan 2023
Device: kindle 4 D01100
|
Found root's crontab. That'll do
![]() Scheduled every 5 mins and that looked to work ok. Set to @daily now, so will see if the image refreshes overnight. Matt |
![]() |
![]() |
![]() |
#9 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Jan 2023
Device: kindle 4 D01100
|
I take it back. 5 minute cron job is... intermittent. Sometimes works, sometimes doesn't. Haven't spotted a pattern in the behaviour yet.
Will keep trying/experimenting. |
![]() |
![]() |
![]() |
#10 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 52
Karma: 616590
Join Date: Feb 2019
Device: K4 KT4 PW4 PW5
|
Quote:
A cron job is not enough, as cron only runs while the kindle is awake. You need to set a rtc wakealarm to ensure that the kindle wakes up from sleep. Lipc-wait-event also has a flag to tell it how many times to run, if you dont want it to run forever. |
|
![]() |
![]() |
![]() |
#11 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Jan 2023
Device: kindle 4 D01100
|
Thanks for the help @yparitcher.
Couple of questions on your two scripts in this thread: 1. Do both of the scrips need to be run, or does one trigger the other? 2. Could/should they then be added to cron to run on boot? 3. I notice in program script the space to set picture with eips/fbink - I am hoping to use the screensaver hack to display a random image when the kindle is asleep, is this compatible? 4. I put in the eips command, ran, and got: Code:
line 3: syntax error: "do" unexpected ![]() Matt |
![]() |
![]() |
![]() |
#12 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Jan 2023
Device: kindle 4 D01100
|
@yparitcher trying your other single script you linked instead.
I gather this monitors states and when the kindle goes in to readyToSuspend it sets the rtcWakeup. I changed only the delta to 20 to test. Ran the script. I locked the kindle both with the power button and also by waiting the 10 minutes for it to lock itself. Couldn't get any automatic wake from the script. Where does the logger log to? Would be handy to troubleshoot what's happening. Thanks again ![]() |
![]() |
![]() |
![]() |
#13 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
|
![]() |
![]() |
![]() |
#14 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jul 2023
Device: K4
|
Quote:
This project is basically what you want: https://github.com/pascalw/kindle-dash It's very power efficient, think only needing to charge your Kindle once a month. |
|
![]() |
![]() |
![]() |
Tags |
rtc |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wake up from sleep | peterson | Kindle Developer's Corner | 37 | 03-08-2024 04:20 PM |
Clara HD 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 |
Kobo h2o won't wake from sleep | nikev | Kobo Reader | 13 | 01-03-2016 07:01 PM |