DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2007-05-10 12:51:51

animaal
Member
Registered: 2007-04-27
Posts: 8

DNS-323 clock drift

Just some information that may be useful for some people... following on from the topic below:
http://dns323.kood.org/forum/t149-jobs.html

The DNS-323 clock drifts by about 4 minutes per day. Out-of-the-box, the NAS runs a 'rtc' Cron task every night to correct the clock by 227 seconds. Of course, this means that by the end of the day, timestamps etc would be out by almost 4 minutes. This 4 minutes is corrected at one time, which could be "interesting" if there was a lot of file activity just then, or if logging is important.

My DNS-323 runs Etch, and I was able to install ntpd (Run "apt-get install ntp", and start the daemon from Etch on startup). This corrects the system clock every twenty minutes, by which time the drift has reached a little over 3 seconds. A much better solution, IMO.

I added the following to fun_plug to remove the root cron jobs, and reinsert the 'getdhcp' task that may actually be useful.

Code:

# replace Cron daylight jobs
crontab -r
echo '*/10 * * * * /usr/sbin/getdhcp&' > /var/spool/cron/crontabs/root
crontab /var/spool/cron/crontabs/root

In performing the above, I also purposely omitted the 'daylight' cron task - we know that task causes difficulty with the DNS-323 in all firmware versions up to the current one (1.03), so it is of limited benefit. My understanding is that by running 'tzconfig' and setting the correct timezone, Debian will take care of deylight savig time for me.


Cheers,
M.

Offline

 

#2 2007-06-05 23:59:14

kruzes
Member
Registered: 2007-05-31
Posts: 22

Re: DNS-323 clock drift

Besides using ntp in debian, which is definitely a good thing, you should also look into into using the adjtimex tip in the wiki (http://dns323.kood.org/howto:reduce_clock_drift).

My measurements using a tier one ntp server confirm the 9960 number (I get a 0.996005:1 ticks ratio). This correction will make the clock drift less than 0.12s between 20min ntp updates.

For those of you not running ntp, you should measure your drift against a good server, but the value I get for the frequency parameter on my dns323 is 354500, so maybe you can try that.

Offline

 

#3 2007-10-23 13:27:42

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: DNS-323 clock drift

kruzes wrote:

My measurements using a tier one ntp server confirm the 9960 number (I get a 0.996005:1 ticks ratio).

I'm using 9965, with 9960 my clock still drifted heavily, but in the other direction smile Seems there's quite some variation, and I hope I don't have to set different ticks for summer and winter temperatures.

Without tick adjustment, ntpd showed a drift of 500 which is maximum it can compensate - resulting in wrong time (up to several seconds) and step updates. With 9965 drift stabilized around 330 (ntp.drift file) and with ntpd, time is quite accurate now.

Offline

 

#4 2007-11-06 13:01:26

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: DNS-323 clock drift

I've compiled a ntp funplug addon: http://www.inreto.de/dns323/fun-plug/0. … .2.4p4.tgz
It's working quite well on my DNS for weeks now. To use it:
- install the package using funpkg.sh
- create a config file (there a sample ntpd.conf-sample), adjust time servers to your region
- run fun_plug.d/start/ntpd.sh
- let it run for a few days until the drift value in /etc/ntp.drift stabilizes, then cp /etc/ntp.drift /mnt/HD_a2/fun_plug.d/etc
  (start/ntp.sh will copy it to /etc after restart, this significantly improves resynch time after restart)

Important: you need to adjust your clock ticks or frequency before running ntp, or ntp will not be able to keep the clock synchronized.
See also http://dns323.kood.org/forum/p7426-2007 … html#p7426 for my updated 00timezone.sh start script.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB