sumanratnam
Posts: 1
Joined: Wed May 18, 2016 3:56 am

Time is not updating

Tue May 24, 2016 3:47 am

Hi all.

My Raspberry pi3 not updating time.
tried few recommendations from the forum as well as google.
issue remains.

Please assist . Thanks.

User avatar
DougieLawson
Posts: 36578
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Time is not updating

Tue May 24, 2016 8:04 am

It needs an active internet connection.

sudo /etc/init.d/ntp stop
sudo /etc/init.d/ntp start

should get it to sync.

If that doesn't work
sudo /etc/init.d/ntp stop
sudo ntpd -q -g
sudo /etc/init.d/ntp start
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Time is not updating

Tue May 24, 2016 1:25 pm

sumanratnam wrote: My Raspberry pi3 not updating time.
tried few recommendations from the forum as well as google.
issue remains.
Mine too ...

... something changed with a recent update. ntp is no longer syncing automatically, nor reliably. Over the past week, and since my apt-get update, apt-get upgrade (and on one machine rpi-update) ntp has stopped working.

I also had to install ntpdate... to help fix this...

Dougie is right, stopping and starting ntp syncs it up... in a couple of minutes... but that should not have to be. It should be automatic, and it should be reliable... and until last week it was !
marcus
:ugeek:

User avatar
DougieLawson
Posts: 36578
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Time is not updating

Tue May 24, 2016 1:30 pm

To be reliable you need a permanent connection to the internet.

ntpdate
ntpq -p


give you some details of what NTP is doing.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Time is not updating

Tue May 24, 2016 1:32 pm

DougieLawson wrote:To be reliable you need a permanent connection to the internet.

ntpdate
ntpq -p


give you some details of what NTP is doing.
Dougie, I'm telling you something changed very recently. I know how ntp works; and its not now. Something is different. All of my clocks are fine except the PI 3B (s) and only since last week.
marcus
:ugeek:

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Time is not updating

Tue May 24, 2016 1:52 pm

1) stopped the ntpd with :

sudo systemctl stop ntp

2) rather than running ntpdate, ran ntpdate-debian:

sudo ntpdate-debian

3) started ntpd

sudo systemctl start ntp

4) check

sudo ntpq -p

Now, servers found, clocks synced, times right... now we'll see if the clocks drift, and whether they
sync-up on a boot-up later...

:roll:
marcus
:ugeek:

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Time is not updating

Tue May 24, 2016 1:58 pm

Did /etc/ntp.conf get honked on a recent update?
marcus
:ugeek:

epoch1970
Posts: 3894
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Time is not updating

Tue May 24, 2016 9:40 pm

MarkHaysHarris777 wrote:Did /etc/ntp.conf get honked on a recent update?
I participated in the sinking of another thread about ntp recently :) (But that wasn't really my fault, nor ntp's I think)
I have one Pi 3 I use as my lab mouse, it is up to date with the stable distro.
I have my own ntp.conf, I can assure you nothing has changed recently.
The last one who tried messing with it, namely systemd-timesyncd, has been locked in a closet for a while.

(Perhaps you want to check if "timedatectl"does not report "NTP enabled" which would mean it competes with the ntpd daemon?)
(Also, I do not use pool.ntp.org servers. I've found fr.pool servers to be of unequal quality, so what I did a long time ago is lookup a list of public ntp servers and sent an email to a few admins asking the right to hookup to their servers. Yes, an email; and the guys replied, it was 1990 all over again ;) I also have on my network a USB radio-driven clock source, it's not super accurate but it's impervious to Internet weather conditions. Nowadays I believe a GPS module is even cheaper.)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Time is not updating

Tue May 24, 2016 10:02 pm

epoch1970 wrote: (Perhaps you want to check if "timedatectl"does not report "NTP enabled" which would mean it competes with the ntpd daemon?)
(Also, I do not use pool.ntp.org servers. I've found fr.pool servers to be of unequal quality, so what I did a long time ago is lookup a list of public ntp servers and sent an email to a few admins asking the right to hookup to their servers. Yes, an email; and the guys replied, it was 1990 all over again ;) I also have on my network a USB radio-driven clock source, it's not super accurate but it's impervious to Internet weather conditions. Nowadays I believe a GPS module is even cheaper.)
Thanks for the reply. I have used a GPS receiver time source for several years... mostly reliable. Some of my problem is that I have avoided systemctl (timedatectl) and systemd until now... with Jessie Raspbian systemd is an issue for me too. My PI 3Bs are my first set of computer (tiny or not) that use systemd by default (and, its a classic case of once I learned all the answers they changed all the questions!) aarge.... :x

My clocks have been stable all day, have not drifted, but I don't know yet whether there is a conflict or whether there is a bug, or both. I'll know on reboot ... which I'm not ready to do yet.
marcus
:ugeek:

epoch1970
Posts: 3894
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Time is not updating

Tue May 24, 2016 10:33 pm

Talking about reboot, I am about sure that systemd competes with ntpdate.
The dreadful timesyncd-systemd service tries to step the clock with ntp servers at boot time, exactly what ntpdate did. As usual the feature comes unannounced. So I think on jessie you can remove ntpdate. This is what I did after a while.
Now the second "service" of timesync-systemd is to be an always-on ntp client. Normally this is not activated by default, but one day I've found unknown peers reported by ntpd...
So now for me:

Code: Select all

$ service systemd-timesyncd status
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; disabled)
   Active: inactive (dead)
     Docs: man:systemd-timesyncd.service(8)
$ timedatectl 
      Local time: Wed 2016-05-25 00:29:57 CEST
  Universal time: Tue 2016-05-24 22:29:57 UTC
        RTC time: n/a
       Time zone: Europe/Paris (CEST, +0200)
     NTP enabled: no
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
...
$ service ntp status
● ntp.service - LSB: Start NTP daemon
   Loaded: loaded (/etc/init.d/ntp)
   Active: active (running) since Tue 2016-05-24 16:33:02 CEST; 7h ago
  Process: 1295 ExecStart=/etc/init.d/ntp start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/ntp.service
           └─1379 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 107:112
$ sudo dpkg -l | grep ntp
ii  ntp                            1:4.2.6.p5+dfsg-7+deb8u1        armhf        Network Time Protocol daemon and utility programs
(and no ntpdate)
Roughly it is stable, I have sometimes ntpd go poof, it's not specific to the Pi, that's a debian (linux? ntpd?) thing that started a few releases ago... I have a cron job on the machine that has my refclock to check and restart the daemon if it's gone.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

RJB
Posts: 5
Joined: Wed May 01, 2013 1:11 pm

Re: Time is not updating

Sun May 29, 2016 7:56 am

NTP on RP 3 + Jessie - I cannot get to work
ntpq -p always shows refid as ".INIT." ie no connection
I have tried all the suggestions I have found on the web
Living in Hong Kong I tried changing my servers to
server 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org
as suggested by the NTP website
Note that my earlier PI's running Wheezy are still keeping time without missing a heartbeat in a couple of location here in HK
Having the correct time is important not just for external timed events but also for good file management and as such are essential to me.
My next step has to be to try and load Wheezy on my PI3 - but I do this reluctantly

RJB
Posts: 5
Joined: Wed May 01, 2013 1:11 pm

Re: Time is not updating

Sun May 29, 2016 8:14 am

MarkHaysHarris777 wrote:1) stopped the ntpd with :

sudo systemctl stop ntp

2) rather than running ntpdate, ran ntpdate-debian:

sudo ntpdate-debian

3) started ntpd

sudo systemctl start ntp

4) check

sudo ntpq -p

Now, servers found, clocks synced, times right... now we'll see if the clocks drift, and whether they
sync-up on a boot-up later...

:roll:
This seems to have worked for me - at least now the time is not wandering off after reboot
But the out put from timedatectl
Local time: Sun 2016-05-29 16:06:52 HKT
Universal time: Sun 2016-05-29 08:06:52 UTC
RTC time: n/a
Time zone: Asia/Hong_Kong (HKT, +0800)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
Shows NTP not enabled - should I be worried about this?
Can I change it?
BTW - still have only ".INIT" in refid on netpq -p

epoch1970
Posts: 3894
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Time is not updating

Sun May 29, 2016 10:40 am

.INIT. is not no connection, it means "not synced for the first time yet".
For those of you running multiple NTP *servers*, why not leave one server be the master, and others sync to it on the LAN?
- "Master" server, say, stratum 3: server some.public.ntp.server
- "Secondary" server, stratum 4: server refclock-pi.lan

Look at your router's NAT/firewall tables. 123/udp must be allowed to flow out and IN: servers make unsolicited connections to each other. So if you have a port forwarding rule in your router, you have to dedicate 1 server as the "master".
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
DougieLawson
Posts: 36578
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Time is not updating

Sun May 29, 2016 11:23 am

epoch1970 wrote: For those of you running multiple NTP *servers*, why not leave one server be the master, and others sync to it on the LAN?
- "Master" server, say, stratum 3: server some.public.ntp.server
- "Secondary" server, stratum 4: server refclock-pi.lan
That's how my LAN runs. My internet facing server acts as the master NTP server for all my other Raspberries.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Hcgrant
Posts: 21
Joined: Sun Oct 14, 2012 4:51 pm

Re: Time is not updating

Thu Jun 02, 2016 9:12 pm

I had the problem too, see viewtopic.php?f=28&t=141454, particularly the solution suggested by SR-71. His /Her ? solution worked for me. So many thanks SR-71 :D

Return to “Troubleshooting”