Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-22-2019, 06:01 PM   #1
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
help with kindle time setting

I am confused about setting the correct time on my jailbroken pw4.
I issue the following commands to set the time:
1) ntpdate -u 0.ca.pool.ntp.org
2) hwclock -w
Both clocks now show the same time now, however it is exactly 2 minutes fast.
What am I doing wrong?
Thanks for the help!
handyguy is offline   Reply With Quote
Old 12-22-2019, 06:16 PM   #2
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,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Use setdate (it accepts an epoch (i.e., from date +%s)).
NiLuJe is offline   Reply With Quote
Advert
Old 12-22-2019, 06:47 PM   #3
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
Hi niluje, can you give me a little more detail on using setdate? I can't find a formal syntax for it. I would like to pull the correct time from the internet.
Thanks!
handyguy is offline   Reply With Quote
Old 12-22-2019, 09:21 PM   #4
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
Any other ideas why ntp is off by 2 minutes?
handyguy is offline   Reply With Quote
Old 12-22-2019, 10:13 PM   #5
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by handyguy View Post
Hi niluje, can you give me a little more detail on using setdate? I can't find a formal syntax for it. I would like to pull the correct time from the internet.
Thanks!
There is a KUAL add-in for exactly that purpose.
My nickname as author, ah...
"Date-Time" (or something like that in the title).

The exact purpose being to set the Kindle from the NTP network.
Not the exact purpose in repeating the published:
Code:
man date
in your favorite web search tool

Last edited by knc1; 12-22-2019 at 10:17 PM.
knc1 is offline   Reply With Quote
Advert
Old 12-22-2019, 10:43 PM   #6
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,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Define "off".

What's shown in the Kindle status bar != what date will output. Hence my recommendation of using setdate over date, because it does extra crap to resync the UI without having to restart it.

Welcome to Kindle .
NiLuJe is offline   Reply With Quote
Old 12-23-2019, 12:59 AM   #7
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
Quote:
Originally Posted by knc1 View Post
There is a KUAL add-in for exactly that purpose.
My nickname as author, ah...
"Date-Time" (or something like that in the title).

The exact purpose being to set the Kindle from the NTP network.
Not the exact purpose in repeating the published:
Code:
man date
in your favorite web search tool
Except I need to execute the commands from a script...
handyguy is offline   Reply With Quote
Old 12-23-2019, 01:05 AM   #8
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
If the syntax for 'setdate' is the same for 'date', there is no option for obtaining the correct time from an internet time source (that I can see in man date). I need a scriptable/programmatic way to access the internet time/date and correct the local clock.
handyguy is offline   Reply With Quote
Old 12-23-2019, 08:59 AM   #9
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,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Set via ntp, get the fixed epoch via date, feed it to setdate?
NiLuJe is offline   Reply With Quote
Old 12-23-2019, 10:17 AM   #10
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by handyguy View Post
If the syntax for 'setdate' is the same for 'date', there is no option for obtaining the correct time from an internet time source (that I can see in man date). I need a scriptable/programmatic way to access the internet time/date and correct the local clock.
So if you do not want to use my KUAL add-in and would rather re-invent that wheel ...
Just read the script for yourself, I have it released as an Open Source posting.


PS: in case you are not familiar with the man(ual) command in Linux and other *nix type systems, it is not limited to the 'date' example I posted. You really don't need us to copy the information down for you.

If you do not have a full Linux system, but only a cut-down embedded version, your favorite web search engine can find you copies of the manual pages.
It was one of the first things ever added to web search engines.
knc1 is offline   Reply With Quote
Old 12-23-2019, 11:48 AM   #11
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
sorry, i did mean to re-invent anything; i just assumed that this feature was executed from within the kual gui, whereas i wanted a programmatic solution. I'm guessing i was wrong, and your solution can be executed from within a program? Remember I also have wifi off, so my solution also turns wifi on temporarily. Programing is all about standing on the shoulders of others!

Last edited by handyguy; 12-23-2019 at 12:30 PM.
handyguy is offline   Reply With Quote
Old 12-23-2019, 12:02 PM   #12
Junket
Nil adsuetudine maius
Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.Junket ought to be getting tired of karma fortunes by now.
 
Junket's Avatar
 
Posts: 278
Karma: 500000
Join Date: Nov 2019
Location: US
Device: PW4
As far as I can see much of Kindle land runs on scripted busybox commands, whether from Amazon or the local wizards here. You can do almost anything on the command line once you look at what the scripts reference.
Junket is offline   Reply With Quote
Old 12-23-2019, 01:29 PM   #13
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,262
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by handyguy View Post
sorry, i did mean to re-invent anything; i just assumed that this feature was executed from within the kual gui, whereas i wanted a programmatic solution. I'm guessing i was wrong, and your solution can be executed from within a program? Remember I also have wifi off, so my solution also turns wifi on temporarily. Programing is all about standing on the shoulders of others!
A significant portion of KUAL extensions are scripts. You should grab some, unzip them, and explore the contents. If you find the ones I've done, they are guaranteed to be short and (maybe) sweet.
j.p.s is offline   Reply With Quote
Old 12-23-2019, 10:10 PM   #14
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
Unfortunately, I am not enough of a programming wiz to figure out the correct syntax to take the NTP time through to setdate/date.
Perhaps the knc1-date-time could be used, however the wifi is usually off to save battery life.
handyguy is offline   Reply With Quote
Old 12-23-2019, 11:13 PM   #15
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,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
You... kinda don't have to?

ntp uses settimeofday()/adjtime()
date uses gettimeofday()

As long as you do things in order (i.e., ntpdate -> date +%s -> setdate: ntp sets, date gets, setdate sets to what date returned), everything will be coherent.

If it isn't, your NTP setup is borked (and/or you have extra TZ/DST shenanigans to take care of first).

----

Or, just try @knc1's extension, which goes with ntpdate -> hwclock -w

Last edited by NiLuJe; 12-23-2019 at 11:22 PM.
NiLuJe is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting Kindle, Wi-Fi, 6" Time Setting? Guiltyr1 Amazon Kindle 10 10-26-2014 12:29 PM
Setting Time on the Kindle DreamWriter Amazon Kindle 5 03-19-2011 10:32 PM
Troubleshooting [Q] setting local time on unregistered kindle random43743 Amazon Kindle 8 01-18-2011 06:20 PM
setting time on Kindle anzacman Amazon Kindle 9 05-25-2010 07:05 PM
Setting the Time pcinfoman Sony Reader 5 01-28-2010 09:41 AM


All times are GMT -4. The time now is 01:28 PM.


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