Jump to content

ClockSync - synchronize device clock via NTP


Guest JetSerge

Recommended Posts

Guest JetSerge

csicon.png

Synchronizes system time via NTP automatically or manually. Will be useful if your operator doesn't support automatic time synchronization via NITZ (mine doesn't and device clock lags).

ROOT is required for synchronization.

Features:

  • Displays atomic reference time, system time, clock offset and current date or last synchronization time
  • Gets atomic time from the user specified NTP server
  • Update offset by tapping on the Atomic time or Local offset values on the screen
  • Tapping on the system time will synchronize the device clock with the atomic clock
  • Update/Synchronize actions are also available from the application menu
  • Automatic synchronization on user specified interval (battery efficient!)
  • Options to synchronize only via Wi-Fi or when device is already awake
  • Optional Haptic feedback when tapping on the active screen elements
  • am/pm and 24-hour time display based on the system setting
  • Compatible with Android 1.5 and higher version including FroYo (2.2)

cs-main.png?w=240cs-settings.png?w=240

More details:

http://amip.tools-for.net/android/clocksync

Download:

cs-market.png

Background:

I've noticed that my system clock lags ~5 seconds every hour. Last time I checked it was 5 minutes behind the atomic time.

First I thought that it was SetCPU with custom underclock profiles when sleeping, so I've disabled the SetCPU profiles and even uninstalled it. Rebooted the phone, still the same issue.

Now I think that it may have something to do with the TCK 0.8 kernel or other tweaks used in the MDC ROM. My friend with the stock ROM doesn't have this problem.

I should note that you may not notice this issue at all if you have Automatic mode (use network-provided values) enabled in the phone settings and your provider supports NITZ. Unfortunately, it's not the case for me. Providers here do not support NITZ so this option does nothing, the phone can't correct its time OTA.

I had to write an app to synchronize phone clock via NTP (requires root to work). Using this app I've noticed how severe the drifting is. Will have to make it sync automatically every hour or so.

Ideas?

UPDATE1: the issue is more severe when WiFi is connected. When left overnight with WiFi off, it lagged only 0.3s, however when I've enabled WiFi it lags 5s/hour.

UPDATE2: Happens when any data connection is enabled, even 3G. However when disabled with APNdroid/Toggle Data, the time doesn't lag that much. Radio related bug?

UPDATE3: Clock lags much more when connected via USB/charging. With WiFi turned on it lagged ~1 second in 8 hours while when USB connected it lags ~5s/hour.

Edited by JetSerge
Link to comment
Share on other sites

Guest Chicaned

Yes! I have exactly the same thing!!! Are you on Vodafone by any chance? It might be because Vodafone only send their time signal out over GPRS. I remember reading it on somewhere. Could do with an app that updates the time from t'interweb. It 'could' be the ROM/Radio though.

Edited by Chicaned
Link to comment
Share on other sites

Guest gcgspain
Yes! I have exactly the same thing!!! Are you on Vodafone by any chance? It might be because Vodafone only send their time signal out over GPRS. I remember reading it on somewhere. Could do with an app that updates the time from t'interweb. It 'could' be the ROM though.

I´m on vodafone Spain but I have the "use providers time" unmarked, because they´ve already cocked up with the time on a few ocassions. So for me its nothing to do with vodafone.

Link to comment
Share on other sites

Guest Chicaned
I´m on vodafone Spain but I have the "use providers time" unmarked, because they´ve already cocked up with the time on a few ocassions. So for me its nothing to do with vodafone.

You mean it's everything to do with Vodafone right? :)

Link to comment
Share on other sites

Guest Breece
You mean it's everything to do with Vodafone right? :)

Having the same issue with IntersectRaven kernel and cyanogen 5.0.6 ...

[€dit]

And I am not on Vodafone ;)

Edited by Breece
Link to comment
Share on other sites

Guest JetSerge

I've updated ClockSync to 1.0.1. 1.0.0 users will need to remove old version before updating because of the key change.

Link to comment
Share on other sites

Guest bobtentpeg
I've updated ClockSync to 1.0.1. 1.0.0 users will need to remove old version before updating because of the key change.

Only have a ~.78 sec lag after running for 40+ hours without a reboot w/ wifi enabled and everything. Nifty nevertheless

Link to comment
Share on other sites

Guest JetSerge

I've updated to FRF50 (Froyo) and system clock doesn't lag anymore! So it looks like the issue was specific to the MoDaCo Nexus One ROM.

Link to comment
Share on other sites

Guest Karolis

Well, I'm on froyo with CM's tweaked kernel and your app said I had 70 seconds delay.

So I'm keeping it :rolleyes:

I hope you're going to maintain it even though you feel you don't need it any more.

Link to comment
Share on other sites

Guest Chicaned
I've updated to FRF50 (Froyo) and system clock doesn't lag anymore! So it looks like the issue was specific to the MoDaCo Nexus One ROM.

Agree! I'm a happy camper.

Link to comment
Share on other sites

Guest JetSerge

1.0.5

  • don't keep the service running
  • increased default NTP timeout to 10 seconds
  • automatic sync will try connecting to NTP server 3 times if first attempt fails
  • added Log with diagnostics for automatic sync problems
  • added 6 hours interval

Link to comment
Share on other sites

Guest Uxian

Nice work. I just switched from Sytrant which is a lot less friendly and doesn't seem to have a very reliable NTP client implementation.

Link to comment
Share on other sites

  • 3 weeks later...
Guest JetSerge

Just released ClockSync 1.0.6 with the following list of changes:

  • 3 color schemes: ClockSync (Default), Android (Black), Palm Pre (Light)
  • tap on the Atomic time to get the details about NTP server and packet travel times
  • tapping now works not only on digits, but also on the captions
  • option to override default language (only English/Russian at the moment)
  • cosmetics

New color schemes:

cs-black.png?w=320cs-light.png?w=320

Edited by JetSerge
Link to comment
Share on other sites

Guest fishywang

This is great. Thank you!

But if I'm not wrong, you can get the atomic time by GPS, and this is the source of some of the NTP servers. So if there're an app can sync time via GPS, it would be even more great!

Edited by fishywang
Link to comment
Share on other sites

Guest JetSerge
This is great. Thank you!

But if I'm not wrong, you can get the atomic time by GPS, and this is the source of some of the NTP servers. So if there're an app can sync time via GPS, it would be even more great!

Indeed, it's possible, however it would require you to have GPS turned on, to have open sky to get signal from at least a couple of satellites and you should also not move to make the data more precise. Considering all of these, it would make automatic synchronization almost impossible (because GPS will not work in your office or at home) and will also drain the battery quickly. Turn on GPS, wait for satellites, get the data, turn it off, it's a plenty of time and battery.

I plan to add the GPS mode in one of the next updates, but it will be manual only. Imagine you are in Siberia or lost in a jungle with no network coverage and need to synchronize your clock with the precise time (it would be the last thing you need, but it's still cool =).

Link to comment
Share on other sites

Guest fishywang
Indeed, it's possible, however it would require you to have GPS turned on, to have open sky to get signal from at least a couple of satellites and you should also not move to make the data more precise. Considering all of these, it would make automatic synchronization almost impossible (because GPS will not work in your office or at home) and will also drain the battery quickly. Turn on GPS, wait for satellites, get the data, turn it off, it's a plenty of time and battery.

I plan to add the GPS mode in one of the next updates, but it will be manual only. Imagine you are in Siberia or lost in a jungle with no network coverage and need to synchronize your clock with the precise time (it would be the last thing you need, but it's still cool =).

yep, I agree that it can't be automatic sync'ed. but a manual sync by GPS will be cool ;)

thanks for your great work!

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.