ntpd setup

Just to wrap things up. These are the measured drifts of the clock at different temperatures.

Even without the unit connected to the internet and ntp running the clock is still very stable over a wide temperature range, much to my surprise.

Summary of results
ntpdate -q time.nrc.ca used to measure offset change over hours with linear line fit
rpi in cheap plastic case

Location Ambient T CPU temp Drift ppm
Room 20 45 -42.288
Fridge 3 30 -44.256
Freezer -20 5 -46.560

Change in drift RT to -20 deg C -4.272

Therefore if I set the ntp.drift file to -44.4 ppm I will get on the order of +/- 2ppm drift over +20 to -20 temp range.

Regards,
Gordon Williams

Thanks Gordon, i appreciate the update.
If you get any issues with v102 and the new NTPD options, just post here and I’ll look into it.

Now using fresh V102 image Wheezy

ntp.drift file has ntp ownerhip not root ownership therefore can’t be updated by ntpd.

Gordon Williams

NTPD must be checking ownership matches the user that NTPD is running as, rather than attempt to write to the drift file.
As NTPD is run as root, it does have access to the drift file, regardless of the ownership on the drift file.

I’ve added to the patch file for v103 that sets root:root to the drift file.

Thanks Gordon.

@Fourdee Has there been any major changes to ntp since this? To change the time server that is synced to; I would simply edit /etc/ntp.conf?

Yes, if using modes 1-3:


Daemon mode (4) has now been changed to SystemD-Timesyncd.

Status:

timedatectl status

Config:

/etc/systemd/timesyncd.conf

Any plans to bring back ntpd as a daemon option (mode 5 maybe)? Would make things easier for those of us running a time server under DietPi…

I think we will not bring NTP back, as we just removed it completely from DietPi code for v6.9: https://github.com/Fourdee/DietPi/pull/1628
Systemd-TimeSyncd is enough in most cases an pre-installed on every Debian based image.

But it is most easy to do time sync via another application, aside from DietPi.

  • Go to DietPi-Config > Advanced Options > Time sync mode and choose “0 Disabled”.
  • Then install NTP via APT: apt install ntp
    It will create a service that starts on boot automatically. DietPi cron job will not interfere then with this.

If NTP is already installed and adjusted by DietPi, it might be necessary to purge it once and reinstall it: apt purge ntp