|
|
#1 |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,110
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
KUAL DateTime Button
All Kindle models have some means to set the system date-time, either manually, automatically, or both. If you are "Blocking Big Brother", you will not be able to reach the Amazon time servers. This button, when added will appear on the KUAL 'Helper' menu list. It will set both the system time (in Linux kernel) and command Linux to set the hardware clock from the user's choice of public time servers. Will work on any Kindle with network access by Wifi, USB cable, or non-Amazon 3G. (Untested on the K2 - but one can hope it works there also.) Will work while the "Block Big Brother" (BBB) firewall is active. The button has a simple configuration file, accessible in USB storage (extensions/helper2/ntpdate.conf) where the user can set from one to four public time servers or time server networks. As shipped, one US time server and three time server networks are configured: NTPD_SERVER='nist.time.nosc.us' NTPD_ALT1='0.uk.pool.ntp.org' NTPD_ALT2='0.europe.pool.ntp.org' NTPD_ALT3='pool.ntp.org' Information on regional and pool server zones can be found here: http://www.pool.ntp.org/zone/@ Information on the US time server network can be found here: http://tf.nist.gov/tf-cgi/servers.cgi Information on the UK time servers can be found here: http://www.timetools.co.uk/ntp-serve...-server-uk.htm The button will produce a "book-report" (actually, a text document) if it encounters any errors. As shipped, the button is configured to also produce the "book-report" when successfully setting the date-time. The configuration file has an option to turn off the "Success book-report", the default is to produce the success report. The success report is enabled by setting the configuration file to: NTPD_REPORT='true' The success report can be disabled by setting the configuration file to: NTPD_REPORT='' BIG NOTE: When dragging or copying an update to this button into the extensions directory, it will over-write your modified ntpdate.config file. Not tragic, unless you had to change the time server list. ![]() The configuration file is actually a fragment of a script, it **must** use Linux line-endings. Installation:
Finding the 'book-report' Since the book-report is actually a text file, your kindle will consider it a 'doc' rather than a 'book'. If you have a display filter on your Kindle ('My Items' dropdown thing), then set it to either 'all items' or 'docs' to see the DateTime book-report. Sources: http://hg.minimodding.com/repos/sys/kBBB.hg/summary Changes: 1.0.1 - try to compensate for slow DNS resolvers and fix the problems with Kindles not showing the most recent report document.
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan Last edited by knc1; 02-17-2013 at 03:55 PM. |
|
|
|
|
|
#2 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12
Karma: 28820
Join Date: Dec 2011
Device: Kindle Touch
|
@knc1
Your helper2-1.0.0.zip seems to be missing the bin/ntpdate.sh file (it is in helper2-1.0.0.tar.gz though) |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,110
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
Thanks, FIXED
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan Last edited by knc1; 02-13-2013 at 08:05 PM. |
|
|
|
|
|
#4 |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,110
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
Kpw Drift
I have noticed that with my Kpw asleep for 12 hours, the time base will have drifted nearly 0.1 of a second (reported as: 'offset: ' in the book-report when re-setting).
So a "tap a day" should be enough to keep the file time-date stamps consistent. At least if my Kpw is representative of sleeping Kindles.
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan |
|
|
|
|
|
#5 | |
|
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,134
Karma: 5328985
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW, K5 B011, K3 us, K4, DXG, XDA I&II, Omnia, Ematic E6 + E8 :) etc.
|
Quote:
The DX often wanders by many hours sporadically and then plays catch up on 3g "connect", this is of course a known, other, phenomenon, but I was short of things to talk about and it was not entirely uninteresting and vaguely related ![]() Thanks for the metric on slippage. perhaps I should leave one in a coma for a week or so and see what the slip is like. But, as you say: With the new shiny "Make it So" button "Who cares?"
__________________
Audiophile and electron bully. My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him. The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set Last edited by twobob; 02-14-2013 at 10:45 AM. Reason: s/would/should/ |
|
|
|
|
|
|
#6 |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,110
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
On your DX - -
Log in to 3G so that they system time is correctly set - Steal the one-liner 'hardware clock set from system time' command out of the DateTime script, run that on the DX. I suspect that the sporadic jumps in time is caused by the kernel re-reading an improperly set hardware clock.
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan |
|
|
|
|
|
#7 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,137
Karma: 23467050
Join Date: Dec 2011
Device: Kindle Paperwhite
|
In your ntpdate.sh, after moving the logfile to /mnt/us/documents/ntpdate.txt, why not opening that file so you can look at it? Like this (in red) in ntpdate.sh:
Code:
****snipsnip****
if [ x$RPT == 'xtrue' ]
then
mv $LOG /mnt/us/documents/ntpdate.txt
dbus-send --system /default com.lab126.powerd.resuming int32:1
lipc-set-prop com.lab126.appmgrd start \
app://com.lab126.booklet.reader/mnt/us/documents/ntpdate.txt
else
rm $LOG
fi
exit 0
lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.reader/mnt/us/opt/log/ntpdate.txt (not sure if that works in the menu.json directly, or if you have to wrap it around another shell script) This works fine by editing menu.json to: Code:
{
"items": [
{
"name": "Helper",
"priority": 0,
"items": [
{"name": "Set DateTime from Server", "priority": 1, "action": "bin/ntpdate.sh"},
{"name": "Show DateTime log", "priority":1, "action": "lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.reader/mnt/us/documents/ntpdate.txt"}
]
}
]
}
Last edited by DuckieTigger; 02-15-2013 at 02:10 PM. Reason: added menu.json support |
|
|
|
|
|
#8 | |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,110
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
Quote:
But I was assuming that people would do one of two things: 1) Read it and keep it (somewhere) for a "most recently set" record. 2) Just delete it. And now with four time server addresses (ntpdate uses all that it can reach of the four, and then computes the 'best' of those) - - And the last one of those the 'global' pool - - The button should succeed more often that not. (a lot more often) Anywhere in the world. Once the end-user has acquired some confidence that the button works in their location - - Then they can decide if they want the success record or not. If they disable the success record, then the only time a report will be made is on a failure of some sort. So far - we have had only a couple of dozen downloads - and only one report on if the button works (from twobob). But still that is a thought to keep in mind. Just need a bit bigger sample of user opinions now. PS: Yes, any single line (including multiple statements) shell command will work in the "action" : field of menu.json .
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan |
|
|
|
|
|
|
#9 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,137
Karma: 23467050
Join Date: Dec 2011
Device: Kindle Paperwhite
|
Quote:
(I knew that). Maybe only display the log automatically IF it fails, otherwise keep the record for reference and viewable with the button solution in KUAL? That would be great.And also thank you for the idea - did not know how to start the reader with a script (searched that just to answer) - great way to e.g. create any output in /tmp, display it, and let the Kindle worry about when to delete the /tmp folder to make room. (I do hope it does that )
|
|
|
|
|
|
|
#10 |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,110
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
Ah, I never leave it behind in /var/tmp -
It is either moved or removed. A view last setting helper button? Should be a one-liner in the menu.json file. But it would mean moving it somewhere other than documents. And since I don't use any of the "Collection Management" stuff - I don't know how this will react if someone has put the success report into a "Collection" of reports. What I really need at this point is more than 2 dozen silent users.
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan |
|
|
|
|
|
#11 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,137
Karma: 23467050
Join Date: Dec 2011
Device: Kindle Paperwhite
|
Quote:
|
|
|
|
|
|
|
#12 | |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,110
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
Quote:
Then updated the date-time. Then looked at the ntpdate report (which remained in the collection: "Reports" after its update). A strange thing happened - The first time I looked at it, it still showed the old information. But on the second and subsequent looks, it showed the new information. The system must be caching the document somewhere and just taking a little while (seconds) to clear the cache of outdated material. I haven't tried the same with ixtab's Collection Manager. Will leave that to someone with time on their hands.
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan |
|
|
|
|
|
|
#13 |
|
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,134
Karma: 5328985
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW, K5 B011, K3 us, K4, DXG, XDA I&II, Omnia, Ematic E6 + E8 :) etc.
|
Yeah. I suspect you are 100% correct. but where. who knows
__________________
Audiophile and electron bully. My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him. The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set |
|
|
|
|
|
#14 |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,110
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
In the annotations cache.
Version 1.0.1 released in top post of this thread. Fixes for: 1) Slow DNS resolvers 2) Kindle indexer not showing you the most recent ntpdate action report.
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Kindle] Unified Application Launcher. KUAL | twobob | Kindle Developer's Corner | 857 | Today 08:41 AM |
| HowTo [KUAL] Extension Support and Versioning | twobob | Kindle Developer's Corner | 41 | 05-10-2013 08:01 PM |
| [KUAL] Button Def. Packages | knc1 | Kindle Developer's Corner | 13 | 05-04-2013 03:43 PM |
| Working with DateTime custom columns programmatically? | kiwidude | Development | 13 | 12-15-2011 11:09 AM |
| Datetime error uploading to iPad | wechap | Calibre | 3 | 06-29-2010 07:21 AM |