06-30-2017, 03:52 AM | #16 |
Member
Posts: 12
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 2
|
Yes, I used exactly this version with a few additional outputs to console for diagnostics.
I will add some logging to a file and try again. |
06-30-2017, 08:20 AM | #17 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Please update your info box to indicate what Kindle model you are writing about for the times when you forget to mention it in the text of your posts. There is one of me and over a 1/4 million members registered here. You gotta give me a break, I can't remember what model Kindle everyone has. Last edited by knc1; 06-30-2017 at 08:23 AM. |
|
06-30-2017, 09:56 AM | #18 | |
Member
Posts: 12
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 2
|
Ok, I will update my profile. :-)
But I had written in my first post, it is a PW2 with firmware 5.8.9.2 jailbreaked via serial. Quote:
I added some debug output to a file now. So here is my test script: Code:
RTC=0 LOGGING=1 LOGFILE=/tmp/rtctest.log currentTime () { date +%s } ############################################################################## # Logs a message to a log file (or to console if argument is /dev/stdout) logger () { MSG=$1 # do nothing if logging is not enabled if [ "x1" != "x$LOGGING" ]; then return fi #if no logfile is specified, set a default if [ -z $LOGFILE ]; then $LOGFILE=stdout fi echo `date`: $MSG >> $LOGFILE } ############################################################################## # Wait some time using RTC for wakeup wait_for () { # calculate the time we should return ENDWAIT=$(( $(currentTime) + $1 )) # disable/reset current alarm echo 0 > /sys/class/rtc/rtc$RTC/wakealarm # set new alarm logger "Current time is $(currentTime)" logger "Setting Waketime to $ENDWAIT" echo $ENDWAIT > /sys/class/rtc/rtc$RTC/wakealarm # check whether we could set the alarm successfully if [ $ENDWAIT -eq `cat /sys/class/rtc/rtc$RTC/wakealarm` ]; then logger "Waketime set correctly" # wait for timeout to expire while [ $(currentTime) -lt $ENDWAIT ]; do REMAININGWAITTIME=$(( $ENDWAIT - $(currentTime) )) if [ 0 -lt $REMAININGWAITTIME ]; then logger "Waiting remaining $REMAININGWAITTIME seconds" # wait for device to resume from sleep, or for time out lipc-wait-event -s $REMAININGWAITTIME com.lab126.powerd resuming || true fi done else logger "Failure setting alarm on rtc$RTC, wanted $ENDWAIT, got `cat /sys/class/rtc/rtc$RTC/wakealarm`" fi # not sure whether this is required # the following throws an error, so I commented it # lipc-set-prop com.lab126.powerd -i deferSuspend 1 } # wait 2 hours and then wake up echo "RTCTEST started" logger "RTCTEST started" while [ 1 -eq 1 ]; do wait_for 900 echo "Good morning" logger "Good morning" done Code:
Fri Jun 30 08:19:53 UTC 2017: RTCTEST started Fri Jun 30 08:19:53 UTC 2017: Current time is 1498810793 Fri Jun 30 08:19:53 UTC 2017: Setting Waketime to 1498811693 Fri Jun 30 08:19:53 UTC 2017: Waketime set correctly Fri Jun 30 08:19:53 UTC 2017: Waiting remaining 900 seconds Fri Jun 30 13:42:56 UTC 2017: Good morning Fri Jun 30 13:42:57 UTC 2017: Current time is 1498830176 Fri Jun 30 13:42:57 UTC 2017: Setting Waketime to 1498831076 Fri Jun 30 13:42:57 UTC 2017: Waketime set correctly Fri Jun 30 13:42:57 UTC 2017: Waiting remaining 899 seconds |
|
06-30-2017, 10:14 AM | #19 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
This wake up from sleep thing might also depend on the firmware version running.
Different firmware versions, often different kernel versions, etc. ... This thread originated at a time when firmware (and kernel used) was considerably different (I did just scan the first page or so of the thread and I don't see where anyone documented the firmware version being run). It might be helpful to the debugging to hook into the going to screensaver and wake from screensaver events. Note: If the USB cable is plugged in, then 'going to screensaver' does not imply 'going to sleep'. We have a worked example of that here: https://www.mobileread.com/forums/sh...d.php?t=198484 |
06-30-2017, 11:32 AM | #20 |
Member
Posts: 12
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 2
|
While I will look an the mentioned thread, her another log. I have set the wait time to 300 seconds. You see it wake three times, the Kindle goes asleep and nothing happens anymore.
Yes I disconnected USB for forcing the Kindle to fall asleep. Code:
Fri Jun 30 14:00:30 UTC 2017: RTCTEST started Fri Jun 30 14:00:30 UTC 2017: Current time is 1498831230 Fri Jun 30 14:00:30 UTC 2017: Setting Waketime to 1498831530 Fri Jun 30 14:00:30 UTC 2017: Waketime set correctly Fri Jun 30 14:00:30 UTC 2017: Waiting remaining 300 seconds Fri Jun 30 14:05:30 UTC 2017: Good morning Fri Jun 30 14:05:30 UTC 2017: Current time is 1498831530 Fri Jun 30 14:05:30 UTC 2017: Setting Waketime to 1498831830 Fri Jun 30 14:05:30 UTC 2017: Waketime set correctly Fri Jun 30 14:05:30 UTC 2017: Waiting remaining 300 seconds Good morning Fri Jun 30 14:10:30 UTC 2017: Good morning Fri Jun 30 14:10:30 UTC 2017: Current time is 1498831830 Fri Jun 30 14:10:30 UTC 2017: Setting Waketime to 1498832130 Fri Jun 30 14:10:30 UTC 2017: Waketime set correctly Fri Jun 30 14:10:30 UTC 2017: Waiting remaining 300 seconds Good morning Fri Jun 30 14:15:30 UTC 2017: Good morning Fri Jun 30 14:15:30 UTC 2017: Current time is 1498832130 Fri Jun 30 14:15:30 UTC 2017: Setting Waketime to 1498832430 Fri Jun 30 14:15:30 UTC 2017: Waketime set correctly Fri Jun 30 14:15:30 UTC 2017: Waiting remaining 300 seconds |
06-30-2017, 11:58 AM | #21 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Please post the firmware version your device is running.
You can find that in the 'Device Info' panel of the 'settings' section. |
06-30-2017, 01:29 PM | #22 |
Member
Posts: 12
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 2
|
As I said, firmware is 5.8.9.2, sadly. I don't know how to downgrade, the usual way via "update my kindle" does not work anymore with that version.
I now created a little test script to see the powerd events which are happening. The script puts the current time plus 15 minutes into the wakeupalarm and then waits for all events from powerd. Code:
#!/bin/sh ENDWAIT=$(( `date +%s` + 900 )) echo Wakeup time : `date -d @$ENDWAIT` echo Current time: `date` echo 0 > /sys/class/rtc/rtc0/wakealarm echo $ENDWAIT > /sys/class/rtc/rtc0/wakealarm lipc-wait-event -mt com.lab126.powerd '*' As you can see in the following log, all the expected events came but the wakeup event. Code:
Wakeup time : Fri Jun 30 19:14:38 EEST 2017 Current time: Fri Jun 30 18:59:38 EEST 2017 [19:04:29.706631] goingToScreenSaver 3 [19:05:29.811153] readyToSuspend 10 [19:05:34.813016] readyToSuspend 8 [19:05:39.818784] readyToSuspend 7 [19:05:59.939158] readyToSuspend 7 [19:06:04.910156] readyToSuspend 6 [19:06:09.949382] readyToSuspend 2 [19:06:14.926352] readyToSuspend 1 [19:06:23.667195] suspending "mem" Code:
[19:25:45.384165] wakeupFromSuspend 1160 [19:25:45.392901] resuming [19:25:45.411959] t1TimerReset [19:25:45.470198] outOfScreenSaver 1 |
06-30-2017, 01:53 PM | #23 |
Member
Posts: 12
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 2
|
I found the rtc driver "file" /proc/driver/rtc
Immediately after running my event script I see.. Code:
[root@kindle bin]# cat /proc/driver/rtc rtc_time : 17:47:42 rtc_date : 2017-06-30 alrm_time : 18:02:14 alrm_date : 2017-06-30 alarm_IRQ : yes alrm_pending : no update IRQ enabled : no periodic IRQ enabled : no periodic IRQ frequency : 1 max user IRQ frequency : 64 24hr : yes |
06-30-2017, 05:11 PM | #24 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
I could not find it in your posts, which is why I asked for that information. I do not recall asking you to downgrade your firmware, you must have me confused with someone else your working this problem with. From what you are doing/posting, you must have the device jailbroken. Install rescue pack, and optionally, its add-on coward's rescue pack. Boot into diags. ssh into diags and manually install a lower version of the firmware if that is what you want to do. There are several threads around here with the full details of how to install the 'main' system while running the 'diags' system. Firmware 5.8.9.2 - I have no interest in running that version on any of my Kindles, so I will not be able to attempt to duplicate your problem and help you troubleshoot it, if it can be duplicated. |
|
07-01-2017, 01:32 AM | #25 | |||||
Member
Posts: 12
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 2
|
Hm, it seems somehow we don't understand each other.
Quote:
Quote:
Quote:
Quote:
Or I rip this nice eInk display from the Kindle and attach it to an ESP microncontroller board. Maybe that's easier than friggling around with that fullblown Linux of the kindle for my simple task. Quote:
Sorry, to bother you. Maybe there are others who trapped in this firmware trap and are interested in finding why it is not working either. Bye Thorsten |
|||||
07-01-2017, 04:47 AM | #26 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
You do not need the serial port to downgrade a jailbroken kindle.
You only need to install RP (Rescue Pack) and use it. Start with the sticky thread with "Where do I start?" in its title. You will find out how to manually install a different main OS. The fact that you couldn't find it does not prove that it isn't there, you can't prove a negative. All you proved is that you could not find it. If you refuse to use RP, then you can use the serial port. Only the specifics of the switching from 'main' to 'diags' and back again is slightly different. The rest of the procedure is the same as documented. Your claim that the hardware wakeup does not work is also false. You can't prove a negative. All you have shown is you can not find how to make it work. Please provide a link where the manufacturer (Amazon) claims that your Kindle can be used for the 'simple' use you intend to use it for. I am certain you will not be able to find that one either. When you try to use the device for anything that the manufacturer does not describe as its intended function, your on your own (with whatever help you can find other than the manufacturer). Your failure so far to do that is not the fault of the Kindle or of Amazon. Try your own alternate solution. It will not be as easy as you imagine and it is unlikely to work. There are too many hardware details unknown to you for you to even suggest it. And we have all been able to read how little you like reading (and even following) directions that deviate from your own preconceived notions of what should be required. "Should" according to your own definitions. Lots of luck on your next attempt to use Kindle parts. |
07-01-2017, 07:04 AM | #27 | |||||||||
Member
Posts: 12
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 2
|
Danger! This post is a dircet answer to knc1. It is off topic and long. But I cannot accept the attacks knc1 addresses at me. So if you don't want to be involved, pleas skip this article.
Quote:
And about searching: it is sometimes difficult to find the right search words, esp. if english isn't your mother language. I never understood why people in forums often are so repellent if someone askes a question which is somewhere answered already. If they are so embaressed about the question, they should simply not answer, but blocking a thread for others that are not so embaressed. Quote:
Quote:
Quote:
Quote:
E.g. I bought a computer game some months ago. It works flawlessly on my old PC. Until some day stupid Steam forcefully updated it. Now it crashes and I cannot use it anymore. 30 bucks for trash. Nice. If I knew before buying a product it will be altered afterwards without my approval I would not buy it. But nowaday then I could buy nothing, because all the software producers seem to be the same. Quote:
Quote:
But Linux is a mystery for me. Quote:
Quote:
I think this thread is dead now because of our misunderstandings and blaming each other. I am very sorry for that. Maybe it's the language differences, maybe I missunderstand some of the meanings of this conversations. Maybe I should only post in forums that are in my motherlanguage german. I will not waste more time in asking something and try to find out by myself. As knc1 said: it's all here (hopefully). I only have to find the "needle in a haystack". It should be a joyfull weekend project. But now I am too annoyed to preceed. May be later. |
|||||||||
07-01-2017, 08:52 AM | #28 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
We often do make allowances for people whose native language is not English.
You do not have the part of the world which is your location included in your info box. You have not mentioned that English is not your native language until very recently in the post order. Since English is not your native language: The main index of this forum: https://www.mobileread.com/forums/fo...play.php?f=150 is divided into two main sections, separated by a gray bar. The threads indexed above the gray bar also have a green tag prefix: "Sticky". That means those threads will always be found in that top section of the index. One of those threads includes in its title: (a.k.a: Where do I start?) That is an abbreviation for "Also Known As": It is also known as the "Master Index". Click to the first post of that link. Browse the sections in that first post. Pay specific attention to the ones on the subject of "De-Bricking" the Kindles. At this site, "Bricked" translates to "no apparent operation" sometimes the same thing as "hung". In general, it isn't behaving as intended (by Amazon). Un-Bricking a device almost always include manually installing a 'known good' main operating system. (The touchscreen Kindles are all dual boot systems.) If you include the Kindle running an undesired by owner firmware version as bricked, then those manual directions for installing a 'known good' main operating system includes installing an operating system other than the current. Since around the version 5.2.x firmware version, all Amazon updates include a complete system image. The spoiler of step #7 of the current jailbreak: https://www.mobileread.com/forums/sh...d.php?t=275877 contains a list of links to "older than current" firmware images. The thread: "NiLuJe's snapshots" - https://www.mobileread.com/forums/sh...d.php?t=225030 contains the most recent builds of those things which he maintains. That includes the application: "KindleTool" KindleTool is the application that can convert an Amazon image file into a compressed archive where common tools can access the contents. Which you want to do, if you are looking for where to get an older than current firmware kernel and system image. Near the top of the forum index page you will find a line of buttons and boxes - The 'Prefix Filter' setting tool. Set the first drop down box to "tools" and click the last box "Show threads". That gives you a relatively short (few pages) index list of threads. That list will always include "NiLuJe's snapshots" thread. It may include other tools that your will find of interest to your needs. You should also review the list of things prefixed: "Tutorial" and things prefixed by your device's nickname (PW2). There is no expectation that a person should read all of the thousands of threads here. Like finding a specific tree in a forest, nobody needs to examine each and every tree. That would be foolish. All they have to do is understand how to follow the established paths and comprehend the established path markers. |
07-04-2017, 02:28 PM | #29 |
Member
Posts: 12
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 2
|
Hi
I finally was able to downgrade the Kindle to FW 5.4.5, after trying several howtos until I found one that was working. Then I started my small test script: Code:
#!/bin/sh ENDWAIT=$(( `date +%s` + 900 )) echo Wakeup time : `date -d @$ENDWAIT` $ENDWAIT echo Current time: `date` echo 0 > /sys/class/rtc/rtc0/wakealarm echo $ENDWAIT > /sys/class/rtc/rtc0/wakealarm echo Readback time: `cat /sys/class/rtc/rtc0/wakealarm` lipc-wait-event -mt com.lab126.powerd '*' I then installed the screensaver hack and worked on the server side script. Then, the next day, I tried again and it didn't wake up any more. Aaaargh! Here's the protocol of my testscript: Code:
Wakeup time : Tue Jul 4 19:15:42 EEST 2017 Current time: Tue Jul 4 19:10:42 EEST 2017 Code:
[19:10:46.936943] goingToScreenSaver 2 [19:11:46.974498] readyToSuspend 10 [19:11:51.954220] readyToSuspend 7 [19:12:12.019680] readyToSuspend 7 [19:12:17.021449] readyToSuspend 6 [19:12:22.028260] readyToSuspend 2 [19:12:27.037310] readyToSuspend 1 [19:12:35.584246] suspending Code:
[19:18:26.800988] resuming [19:18:26.819733] t1TimerReset [19:18:26.909454] outOfScreenSaver 1 Now I see two alternatives: it happens to wakeup once because of who knows what (current star constellations, subspace anomalies, whatever) or because of the only change which I did to the system: the screensaver hack. So I uninstalled it. It doesn't work. So what? Subspace Anomalies? If anyone has any idea, I will try. If not, I think I have to give up. Running out of ideas. |
07-04-2017, 03:29 PM | #30 |
Member
Posts: 12
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 2
|
I think, I found the problem. If Wifi is on when device is suspending it does not wake up. I added a Wifi-Off Command before setting the wakeup time and it seems to wake up. Hope it is stable.
|
|
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 |