User avatar
chrisoh
Posts: 217
Joined: Sun Dec 06, 2015 8:50 pm
Location: Essex, UK

Re: Time does not sync on Pi 3 or when official dongle is us

Mon Mar 28, 2016 9:32 am

oeffoeff wrote:
SR-71 wrote:That points to some firmware/driver defect in RPI3 (it seems unable to forward IP packets with ToS != 0).
Tyvm dude. Is there a bugtracker or something where we could report this issue?
It's a good question. I tried to be helpful and bring it to the specific attention of RPF engineers but the forum report ticket was closed without reply.

Some official acknowledgement on the issue/guidance on recourse would be most welcome seeing as it's not just affecting NTP but also other system processes including SSH.

I'm wondering if a stickied Pi 3 onboard BCM43438 WiFi/BT chip confirmed bugs thread might be helpful to those seeking help by collating all the issues people are finding, seems more intuitive for the general user-base rather than quietly filing them away into a bug tracker.
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

mikluz
Posts: 17
Joined: Thu Mar 31, 2016 11:52 am
Location: Szczecin, Poland

Re: [Solved] Time does not sync on Pi 3 and with official do

Thu Apr 07, 2016 2:47 pm

Hi all,

I've been having problem with NTP sync since I bought my RPi3.
The strange situation is that when I connect my RPi at my home wifi network everything works fine. Time is always synced up perfectly.
However, when I connect my RPi to my work's wifi network time is out of sync! Like ntpd had problems connecting to the ntp servers.

The standard commands ntpd -qg didn't work.

Output for ntpq -p is:

Code: Select all

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 afrodyta.comple .INIT.          16 u    - 1024    0    0.000    0.000   0.000
 62.148.67.62    .INIT.          16 u    - 1024    0    0.000    0.000   0.000
 pscolka.of.pl   .INIT.          16 u    - 1024    0    0.000    0.000   0.000
 ntp.coi.pw.edu. .INIT.          16 u    - 1024    0    0.000    0.000   0.000
To fix it, I've decided to write a startup script and put it to rc.d routines.

To force my RPi to sync time I use the command:
'$ntpdate -b -u pl.pool.ntp.org' and it works perfectly!

In some time I will try the trick with manipulating IPTABLES.
Raspberry Pi 3 @ Raspbian

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

Re: [Solved] Time does not sync on Pi 3 and with official do

Fri Apr 08, 2016 4:33 pm

ntpdate is deprecated and in some distros has been removed. You should use ntpd -q-g.
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.

mikluz
Posts: 17
Joined: Thu Mar 31, 2016 11:52 am
Location: Szczecin, Poland

Re: [Solved] Time does not sync on Pi 3 and with official do

Mon Apr 11, 2016 11:44 am

I confirm that SR-71 suggestion to manipulate iptables did the trick!
It really seems like RPi3 via WiFi have problems with forwarding packets with ToS = 0xc0 (like ntpd by default queries ntp nodes).
Raspberry Pi 3 @ Raspbian

PeterB2
Posts: 3
Joined: Sat Jan 17, 2015 3:39 pm

Re: [Solved] Time does not sync on Pi 3 and with official do

Mon Apr 11, 2016 6:30 pm

Thanks again SR-71, for the '/sbin/iptables -t mangle' etc. workaround, RPi 3 time is now accurately synchronising.

Regards,
Peter

pygmalion
Posts: 26
Joined: Sat Jul 18, 2015 4:44 pm

Re: [Solved] Time does not sync on Pi 3 and with official do

Wed Jun 01, 2016 3:22 pm

I want to confirm that SR-71 solution (partially) solved my problem too. I even opened another thread viewtopic.php?f=63&t=149058 and lost several days in searching the solution until I bumped on this thread.

Obviously, this is global error. It is a shame that Raspberry Pi consortium missed such a basic mistake.

I still don't know how to make update automatic. If I stop and start service, time is updated, but no update happens at boot. Perhaps service is on before internet connection is. If anyone has any suggestions, please let me know.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5380
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Time does not sync on Pi 3 or when official dongle is us

Wed Jun 01, 2016 3:47 pm

oeffoeff wrote:Tyvm dude. Is there a bugtracker or something where we could report this issue?
https://github.com/raspberrypi/linux/issues

pradeepkr
Posts: 7
Joined: Wed May 18, 2016 7:24 pm
Location: US
Contact: Website

Re: [Solved] Time does not sync on Pi 3 and with official do

Mon Jun 06, 2016 7:41 pm

@SR-71 thanks, your solution worked for me too.
thanks, Pradeep Kumar


Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: [Solved] Time does not sync on Pi 3 and with official do

Sun Jun 26, 2016 2:27 pm

i got the problem (ntp + ssh) with my pi3 when connected to a specific network.
now, ok all the workarounds, but did i get it right that this is not solved yet?
thanks

User avatar
HawaiianPi
Posts: 5095
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: [Solved] Time does not sync on Pi 3 and with official do

Wed Jun 29, 2016 12:19 am

Funny story...

I have noticed the time was off on my Pi3 sometimes, but usually not by much, so I didn't worry about it because nothing I'm doing with it is terribly time sensitive. But today I stumbled another thread complaining about the Pi3 not syncing time correctly, and as I glanced up at the time, it was off by almost 40 minutes. That is by far the largest error I have seen, so I started going through all the troubleshooting steps, to no avail.

Eventually I found my way to this thread and found the workaround. Only it didn't work, even after a reboot, and time was even further off!? So I said, screw it and set the time manually. But it STILL didn't update!

While I was scratching my head over this I realized that not only was the time wrong, but the clock in the LXpanel had not updated at all since I first noticed it was off. It read the exact same time, even after rebooting. Same hour. Same minute.

So I typed date into a terminal, and lo and behold the time and date were correct! My problem wasn't with time sync, it was with the stupid Digital Clock in the panel, which was frozen for some reason. Which, coincidentally, just happened tonight while reading about this sync problem. :x

The "fix" for me was to remove the digital clock from the panel, and add it back.

Image
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

fsck
Posts: 26
Joined: Mon Feb 23, 2015 4:49 pm

Re: [Solved] Time does not sync on Pi 3 and with official do

Wed Aug 24, 2016 1:03 am

Just to be clear, the underlying WiFi driver issue (failing to transmit packets with a certain DSCP or TOS value) is not solved. There is only a hacky workaround for NTP.

protean
Posts: 4
Joined: Sun Mar 09, 2014 11:55 pm

Re: [Solved] Time does not sync on Pi 3 and with official do

Fri Dec 02, 2016 9:01 pm

I had the same problem with a hard wired Pi2 with Raspian Lite. The iptables work around also worked for me.

JimWho
Posts: 1
Joined: Sat Dec 10, 2016 3:44 am

Re: [Solved] Time does not sync on Pi 3 and with official do

Sat Dec 10, 2016 4:08 am

Thanks again, SR-71, your solution worked for me too. I am new to Raspbian/Debian/Linux and don't understand any of this, but adding the line to rc.local got the clock on my RPi 3 syncing over wifi.

It takes maybe a minute after powering on for the clock to sync. This is good.

rollyng
Posts: 21
Joined: Sat Dec 10, 2016 4:08 pm
Location: Hong Kong SAR

Re: [Solved] Time does not sync on Pi 3 and with official do

Thu Dec 15, 2016 10:18 am

Sorry for getting back to this thread, the solution provided by SR-71 does not work on my Pi3 even with the latest firmware.
Please take a look and advise. :?:
Thanks,
rolly

Sorry forget to update my problem. It is resolved by pointing to the accessible NTP server within our internal network!
Attachments
ntp_fail.jpg
ntp_fail.jpg (55.07 KiB) Viewed 4629 times
Last edited by rollyng on Sat Aug 05, 2017 4:28 pm, edited 1 time in total.

billskeen68
Posts: 1
Joined: Tue Feb 28, 2017 8:36 pm

Re: [Solved] Time does not sync on Pi 3 and with official do

Tue Feb 28, 2017 8:41 pm

New user here.

Up until now, I had not be able to keep time in sync and ntpq commands locked up, timed out, etc. I found this link and uncommented the restrict ::1 in the ntp.conf, run /etc/init.d/ntp restart, then ran ntpq -cpeers and it worked.

I'll update if time gets out of sync again.

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

Re: [Solved] Time does not sync on Pi 3 and with official do

Wed Mar 01, 2017 7:41 am

::1 is the IPv6 loopback address like 127.0.0.1 in IPv4.

So I suspect your conjecture is incorrect.
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.

liyin
Posts: 3
Joined: Fri Mar 31, 2017 12:30 am

Re: [Solved] Time does not sync on Pi 3 and with official do

Fri Mar 31, 2017 12:34 am

OSMC is the only distro I've tried that syncs with NTP servers at boot time on a Raspberry Pi 2.

[Ok] Started Set Time using HTTP query (first line when booting)

liyin
Posts: 3
Joined: Fri Mar 31, 2017 12:30 am

Re: [Solved] Time does not sync on Pi 3 and with official do

Fri Mar 31, 2017 7:01 pm

This is a post from user lrusak at LibreELEC forums:

I have no problems getting the correct time.

ntp is done through connman not through ntpd itself.

drock79
Posts: 1
Joined: Sat Apr 15, 2017 5:08 am

Re: [Solved] Time does not sync on Pi 3 and with official do

Sat Apr 15, 2017 5:12 am

SR-71,

Thank you!!! This worked:

SR-71 wrote:

"As workaround, add the following command

Code: Select all
/sbin/iptables -t mangle -I POSTROUTING 1 -o wlan0 -p udp --dport 123 -j TOS --set-tos 0x00

to the file

/etc/rc.local

before the exit 0 line

Next reboot"

MikiBroki
Posts: 16
Joined: Wed May 10, 2017 9:53 am

Re: [Solved] Time does not sync on Pi 3 and with official do

Wed May 10, 2017 9:56 am

Thank you very much, it worked for me, I spent a lot of time searching for a solution !

cobaltdr
Posts: 5
Joined: Wed Jun 28, 2017 6:33 am

Re: [Solved] Time does not sync on Pi 3 and with official do

Wed Jun 28, 2017 6:41 am

First post.

Have a similar problem with the Pi Zero W using Raspbian jessie

ntpd will not update the time, with the reach of all 7 servers in the queue being zero when polled with sudo ntpq -p. Using the deprecated ntpdate or sntp recommended to set the clock both work.

Running tcpdump reveals packets being sent by ntpd but none coming back. When running sntp it logs a return packet as normal. There are no messages in the logs.

My understanding is that sntp uses the same procedure as ntpd to send requests to the timeservers. Why am I only getting a reply back with sntp and why does this work consistently if this is meant to me a packet-drop situation related to the hardware/firmware?

The only difference I could find in the two sets of packets was that ntpd was sending packets with INIT from UDP 123 whereas sntp was sending packets without INIT inside, and from a random UDP port in the region of 44000.

Should I open another ticket for this?

EvilBeeker
Posts: 3
Joined: Wed Jul 05, 2017 7:01 pm

Re: [Solved] Time does not sync on Pi 3 and with official do

Wed Jul 05, 2017 7:18 pm

The solution presented here did not work for me. I'm a beginner-ish RP user, intermediate Linux experience (enough to make me dangerous), and I cannot figure this out. My company purchased four RP3 units pre-built online to be used as wireless web kiosks in our lunch rooms, URL link --

https://www.newegg.com/Product/Product. ... 5YB43A9028

Hardware overview:
- Raspberry Pi 3 1.2GHz Quad Core, 1GB RAM, WiFi, BT
- Official Raspberry Pi 3 Case
- 5.1v 2.4A MicroUSB PSU
- 8GB SanDisk Ultra MicroSD Card w/NOOBS (Jessie build)
- 6' HDMI 1.4 Cable w/3D, 4K, ARC, Ethernet

I have tried everything in this thread and nothing is working. If the units do not update their time over NTP then eventually secure websites are going to reject the connection. The only option I have is wireless

Is there any new news on this issue? Or other solutions not in this thread to try? At this point I'm willing to try anything. I would hate to see this investment go to waste.

User avatar
chrisoh
Posts: 217
Joined: Sun Dec 06, 2015 8:50 pm
Location: Essex, UK

Re: [Solved] Time does not sync on Pi 3 and with official do

Sun Jul 30, 2017 8:23 pm

EvilBeeker wrote:
Wed Jul 05, 2017 7:18 pm
The solution presented here did not work for me.
What output do you get for ntpd -qg?

If the iptables fix posted by SR-71 doesn't work for your Pi then there's a chance that its something else causing the problem in your circumstance.
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

EvilBeeker
Posts: 3
Joined: Wed Jul 05, 2017 7:01 pm

Re: [Solved] Time does not sync on Pi 3 and with official do

Mon Sep 11, 2017 12:16 pm

chrisoh wrote:
Sun Jul 30, 2017 8:23 pm
EvilBeeker wrote:
Wed Jul 05, 2017 7:18 pm
The solution presented here did not work for me.
What output do you get for ntpd -qg?
All that command does is lock up my Pi.

I came up with my own workaround of loading Ubuntu Mate and putting in a cron job with a two minute delay that updates the time on boot:
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"

Still very disappointed that a simple thing like NTP isn't working correctly.

Return to “Troubleshooting”