ntpd setup

Having issues with your DietPi installation, or, found a bug? Post it here.
Gord_W
Posts: 134
Joined: Sat Oct 24, 2015 6:30 pm

Re: ntpd setup

Post by Gord_W »

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
User avatar
Fourdee
Site Admin
Posts: 2783
Joined: Tue Feb 06, 2007 1:36 pm

Re: ntpd setup

Post by Fourdee »

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.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Gord_W
Posts: 134
Joined: Sat Oct 24, 2015 6:30 pm

Re: ntpd setup

Post by Gord_W »

Now using fresh V102 image Wheezy

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

Gordon Williams
User avatar
Fourdee
Site Admin
Posts: 2783
Joined: Tue Feb 06, 2007 1:36 pm

Re: ntpd setup

Post by Fourdee »

Gord_W wrote:ntp.drift file has ntp ownerhip not root ownership therefore can't be updated by ntpd.
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.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
twentyninehairs
Posts: 14
Joined: Wed Feb 01, 2017 9:38 am

Re: ntpd setup

Post by twentyninehairs »

@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?
User avatar
Fourdee
Site Admin
Posts: 2783
Joined: Tue Feb 06, 2007 1:36 pm

Re: ntpd setup

Post by Fourdee »

twentyninehairs wrote: I would simply edit /etc/ntp.conf?
Yes, if using modes 1-3:
Untitled.png
Daemon mode (4) has now been changed to SystemD-Timesyncd.

Status:

Code: Select all

timedatectl status
Config:

Code: Select all

/etc/systemd/timesyncd.conf
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
eddy
Posts: 4
Joined: Tue May 29, 2018 2:40 pm

Re: ntpd setup

Post by eddy »

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...
User avatar
MichaIng
Site Admin
Posts: 2417
Joined: Sat Nov 18, 2017 6:21 pm

Re: ntpd setup

Post by MichaIng »

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
Post Reply