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-07-2012, 08:04 AM   #1
bhaak
Groupie
bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.
 
bhaak's Avatar
 
Posts: 164
Karma: 164969
Join Date: Dec 2011
Device: Palm IIIx, (iPhone|Kindle) Touch
Time synchronization on the Touch and PW

I noticed a funny thing about how the Kindle Touch and Paperwhite do their time synchronization.

The system calls the shell script /usr/sbin/updatetime (identical on the Touch and the PW).

This script first calls a NTP server at Amazon configured in /etc/sysconfig/ntp.

So far, nothing special. Using NTP is standard procedure.

If the script can't reach the NTP server it falls back on making a web request to an Amazon web server, filtering out the date header from the web server's response.

Nice idea for those situation where only http requests into the net are allowed.

In my case this doesn't help as I have blocked any access out of my intranet on my Touch so I changed the address to a local web server. But then I noticed that the web request is not completely standard compliant (the line endings are wrong) and because of that there was no response.

I changed the get_web_time() function and then it worked flawlessly:
Code:
get_web_time()
{
    printf "HEAD / HTTP/1.0\r\n\r\n" | nc ${HTTP_SERVER} 80 | grep "Date: " | cut -d ' ' -f 3-
}
bhaak is offline   Reply With Quote
Old 01-02-2013, 12:30 PM   #2
sitrucz
Connoisseur
sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.
 
sitrucz's Avatar
 
Posts: 55
Karma: 40919
Join Date: Sep 2012
Device: Kindle Paperwhite 3, Apple iPad Mini
I tried modifying the code as suggested and updated the ntp server to time.nist.gov without success. I don’t have a local web server to sync. Does anyone have any other ideas to get time sync working on a wifi only Paperwhite?
sitrucz is offline   Reply With Quote
Advert
Old 01-02-2013, 12:54 PM   #3
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 sitrucz View Post
I tried modifying the code as suggested and updated the ntp server to time.nist.gov without success. I don’t have a local web server to sync. Does anyone have any other ideas to get time sync working on a wifi only Paperwhite?
run the ntp server on your router. I do.
knc1 is offline   Reply With Quote
Old 01-03-2013, 06:51 AM   #4
aditya3098
Guru
aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.
 
Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
Not every router has ddwrt or openwrt
aditya3098 is offline   Reply With Quote
Old 01-03-2013, 08:44 AM   #5
mike.s
Junior Member
mike.s knows the difference between 'who' and 'whom'mike.s knows the difference between 'who' and 'whom'mike.s knows the difference between 'who' and 'whom'mike.s knows the difference between 'who' and 'whom'mike.s knows the difference between 'who' and 'whom'mike.s knows the difference between 'who' and 'whom'mike.s knows the difference between 'who' and 'whom'mike.s knows the difference between 'who' and 'whom'mike.s knows the difference between 'who' and 'whom'mike.s knows the difference between 'who' and 'whom'mike.s knows the difference between 'who' and 'whom'
 
Posts: 8
Karma: 10038
Join Date: Jan 2013
Device: KPW
Quote:
Originally Posted by sitrucz View Post
I tried modifying the code as suggested and updated the ntp server to time.nist.gov without success. I don’t have a local web server to sync. Does anyone have any other ideas to get time sync working on a wifi only Paperwhite?
"The code as suggested" was for getting time from a web server, not an ntp server. nist.time.gov is not a web server. You really shouldn't be configuring an end device to point to a stratum 1 ntp server, anyway.

Try changing /etc/sysconfig/ntp so it has a line like:

NTP_SERVER=0.pool.ntp.org
mike.s is offline   Reply With Quote
Advert
Old 01-03-2013, 08:47 AM   #6
sitrucz
Connoisseur
sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.sitrucz writes the songs that make the whole world sing.
 
sitrucz's Avatar
 
Posts: 55
Karma: 40919
Join Date: Sep 2012
Device: Kindle Paperwhite 3, Apple iPad Mini
I checked my time capsule and it doesn't have an ntp server. I was hoping for a quick fix but I'm ok for the 30 seconds it takes to set the time manually if it slips. Thanks to all.
sitrucz is offline   Reply With Quote
Old 01-03-2013, 08:49 AM   #7
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 aditya3098 View Post
Not every router has ddwrt or openwrt
But many of them do support a time sync service.

Also, the most commonly used TelCo aDSL modem used in the USA has a time sync service which may be optioned "on".
Even has a choice of protocols that it will support.
knc1 is offline   Reply With Quote
Old 01-04-2013, 06:20 AM   #8
bhaak
Groupie
bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.bhaak can program the VCR without an owner's manual.
 
bhaak's Avatar
 
Posts: 164
Karma: 164969
Join Date: Dec 2011
Device: Palm IIIx, (iPhone|Kindle) Touch
Quote:
Originally Posted by sitrucz View Post
I tried modifying the code as suggested and updated the ntp server to time.nist.gov without success. I don’t have a local web server to sync. Does anyone have any other ideas to get time sync working on a wifi only Paperwhite?
When you start /usr/sbin/updatetime manually it will spit out some debug info.

Also before running for a test do 'rm /var/run/prntpset.dat'. The script caches in this file the last result and if not sufficient time has passed since the last run, it doesn nothing.

By default it only allows a check once a day. This is configured by the value of NTP_CHECK_TIME in /etc/sysconfig/ntp.
bhaak 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
kindle synchronization danpeer Amazon Kindle 3 12-25-2011 09:48 AM
Tag Synchronization ccowie Calibre 2 08-27-2010 07:41 PM
Device Synchronization wayner Amazon Kindle 6 04-22-2010 08:47 AM
Never ending Synchronization Raedwulf Sony Reader 8 11-02-2009 01:05 AM
Disable Synchronization help please charlesp Sony Reader 2 01-10-2009 01:18 PM


All times are GMT -4. The time now is 08:38 AM.


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