User avatar
dobra-dobra
Posts: 32
Joined: Wed Dec 26, 2012 2:04 pm
Location: Poland

[Solved] Time does not sync on Pi 3 and with official dongle

Wed Mar 23, 2016 5:19 pm

I'm running Raspbian Jessie with all recent updates. When using Pi 2 or 3 time/date is not synchronizing at boot. When I placed the same SD card in Pi Zero time was updated correctly. What may be the problem?

Edit
Problem only occurs when using official WiFi dongle (no matter what Pi) or on Pi 3 when using WiFi connection. When I switched to other, Chinese dongle (which was plugged to Pi Zero in my first test) time was updated correctly.
Last edited by dobra-dobra on Sat Mar 26, 2016 9:31 pm, edited 1 time in total.

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

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

Thu Mar 24, 2016 9:38 pm

What channel is your AP running on?

Try the following:
ip route
ping -c3 $(ip route | awk '/default/ {print $3}')
ping -c3 8.8.8.8
ping -c3 google.com
cat /etc/resolv.conf


Do it both ways once with your dongle, once with the on-board WiFi and note the differences.

Edit: added the missing $.
Last edited by DougieLawson on Fri Mar 25, 2016 9:49 am, edited 1 time in total.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
dobra-dobra
Posts: 32
Joined: Wed Dec 26, 2012 2:04 pm
Location: Poland

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

Thu Mar 24, 2016 11:28 pm

Thank you for your response.

My AP runs on channel 6. Output from ip route and cat /etc/resolv.conf is exactly the same no matter what dongle I use and I receive ping responses (except ping -c3 (ip route | awk '/default/ {print $3}') which does not work - syntax error near unexpected token `(', but if it should ping my AP adress I have response from it). Still for official dongle with Broadcom chip there is no time sync (and the same is true for RPi 3 connected using build in WiFi), while for dongle with RTL8192CU chip time is updated just after reboot.

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

Thu Mar 24, 2016 11:57 pm

I don't know if it is related, but I also noticed that the system time did not update using the Pi 3 onboard WiFi. It updates normally with a (Ralink based) dongle though. I only got as far as identifying that UDP communication (used to update NTP) was not working as expected. IIRC, installing ntpdate 'fixed' it, despite being deprecated. There's a bunch more info in the 'Pi 3 SSH over WiFi not working' threads in Troubleshooting. I'm not familiar enough with linux routing to understand how it all fits together and what could be wrong though so haven't got any further it.
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

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

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

Fri Mar 25, 2016 9:50 am

Run the commands above and note the differences. Also beware that ntpd may start before the network is running and then your clock will be wrong. Restart ntpd and the problem should go away.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
dobra-dobra
Posts: 32
Joined: Wed Dec 26, 2012 2:04 pm
Location: Poland

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

Fri Mar 25, 2016 4:42 pm

Here are the outputs: http://pastebin.com/Ys1GWWrm, I can't see any differences.

I tried new option in raspi-config to wait for network during boot but issue still occurs. I also tried to restart NTP server using /etc/init.d/ntp restart without any luck.

Edit
Here is output of /etc/init.d/ntp status: http://pastebin.com/hayrXJq0 It seems to me that NTP server is running, but time is not set (it's close to acurate because I'm switching between both dongles).

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

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

Fri Mar 25, 2016 5:54 pm

You have no apparent connectivty problems, you can get to Google's servers and you can turn http://google.com into an IPv4 address.

sudo /etc/init.d/ntp stop
sudo ntpd -qg
sudo /etc/init.d/ntp start

will get your clock set right.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

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

Fri Mar 25, 2016 7:11 pm

@Dougie, what's your take on this output:

Pi 3

Code: Select all

pi@raspberrypi3:~ $ sudo ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 bwntp2.bluewin. .INIT.          16 u    - 1024    0    0.000    0.000   0.000
 head1.mirror.ca .INIT.          16 u    - 1024    0    0.000    0.000   0.000
 funky.fuchsi.de .INIT.          16 u    - 1024    0    0.000    0.000   0.000
 main.macht.org  .INIT.          16 u    - 1024    0    0.000    0.000   0.000
Pi Zero

Code: Select all

pi@raspberrypizero:~ $ sudo ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+ntp1.karneval.c 116.49.102.213   2 u   19   64  357   50.221    1.170   0.706
*stratum2-2.NTP. 129.70.130.71    2 u   55   64  377   49.913   -2.280   1.722
-s1.vlns.de      129.70.132.36    3 u   49   64  377   46.850   -3.015   0.606
+tilia.zsx.hu    192.53.103.108   2 u   25   64  377   68.430    2.838   0.820
Both clean Jessie installs.

@dobra-dobra, what's your ouput using:

Code: Select all

sudo ntpq -p
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

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

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

Fri Mar 25, 2016 10:05 pm

Your RPi3 isn't connected to the public internet or you've got a badly configured firewall blocking NTP.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
dobra-dobra
Posts: 32
Joined: Wed Dec 26, 2012 2:04 pm
Location: Poland

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

Fri Mar 25, 2016 10:24 pm

I left Pi 2 with official dongle (Broadcom chip) on for 5 hours and time is still incorrect.

@DougieLawson
I tried these commands already. I have a freeze after sudo ntpd -qg when using official dongle. Waited about 10 minutes to complete without any luck. When I switched to dongle with Realtek chip I got response after about 10 seconds.

@chrisoh
I have similar results - zeroes for Broadcom dongle and non-zero values for Realtek.

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

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

Fri Mar 25, 2016 10:43 pm

If ntpd -qg hangs then your network isn't configured correctly.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
dobra-dobra
Posts: 32
Joined: Wed Dec 26, 2012 2:04 pm
Location: Poland

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

Fri Mar 25, 2016 10:45 pm

But how it is possible that it works for one dongle, and does not work for other? Setup is exactly the same.

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

Fri Mar 25, 2016 10:54 pm

DougieLawson wrote:If ntpd -qg hangs then your network isn't configured correctly.
So you're basically saying my network isn't configured correctly for the Pi 3 WiFi chipset? Since all other wireless devices (and a nano dongle plugged into the Pi 3) work without problem. Is it just me or does that not sound quite backwards?
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

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

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

Fri Mar 25, 2016 11:46 pm

Try running sudo apt-get update && sudo apt-get -y upgrade && sudo reboot.

If you're using NOOBS then trash your SDCard and try again with NOOBS 1.9.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

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

Sat Mar 26, 2016 12:05 am

It's already up to date. I've never used NOOBs and get the same result with Jessie, Jessie lite and DietPi; doesn't work with onboard WiFi and does work with a variety of nano dongles. All other Pi's work fine too. Android phones work, iPhones work, OSX and Windows work. Just the Pi 3 onboard WiFi that doesn't. Bemused is an understatement.
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

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

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

Sat Mar 26, 2016 12:21 am

Try
sudo BRANCH=next rpi-update

If that doesn't work then RMA the board as it's most likely a hardware fault.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

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

Sat Mar 26, 2016 12:28 am

DougieLawson wrote:Try
sudo BRANCH=next rpi-update

If that doesn't work then RMA the board as it's most likely a hardware fault.
I'll give the rpi-update a go tomorrow ta.

But can it really be a hardware fault if it's only NTP and IPv4 SSH that are exhibiting problems? That resembles a firmware/driver issue to me rather than hardware :?:
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

User avatar
dobra-dobra
Posts: 32
Joined: Wed Dec 26, 2012 2:04 pm
Location: Poland

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

Sat Mar 26, 2016 7:56 am

It's not a hardware issue. I have two official RPi dongles with Broadcom chips and RPi 3. All of them do not sync time (but there is internet connection, I can ssh to them, make update or ping Google), while when I switch to other dongle in the same setup time is set just after boot. Moreover, in older Raspbian versions (before RPi 3 release) Broadcom-based dongles were working just fine, so to me it seems like software regression.

I tried sudo BRANCH=next rpi-update but problem still occurs. Freeze after sudo ntpd -qg is also still present.

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

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

Sat Mar 26, 2016 9:49 am

In that case I suspect you may have faulty hardware.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
SR-71
Posts: 16
Joined: Fri Nov 23, 2012 7:56 pm

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

Sat Mar 26, 2016 8:50 pm

Hi all,

ntpd emits IP/UDP packets with ToS field set to 0xc0.
So that is quite similar to the other issue I (and many others) have with RPI3 when operated over WiFi internal interface.

EDIT:

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 and check the sync state of NTP daemon as follows

Code: Select all

ntpq -cpeers
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
-kazan.admin.sar 212.45.144.3     3 u    7   64    3   20.413    1.826   2.975
+vodka.sublink.O 193.204.114.233  2 u    7   64    3   29.012    0.479   1.871
+kraken2.bilink. 193.204.114.232  2 u    7   64    3   29.342    1.270   3.581
*nettuno.ntp.irh 193.204.114.232  2 u    7   64    3   26.978    0.728   3.038
That points to some firmware/driver defect in RPI3 (it seems unable to forward IP packets with ToS != 0).
Last edited by SR-71 on Sat Mar 26, 2016 9:03 pm, edited 2 times in total.

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

Sat Mar 26, 2016 8:58 pm

SR-71 wrote:Hi all,

ntpd emits IP/UDP packets with ToS field set to 0xc0.
So that is quite similar to the other issue I (and many others) have with RPI3 when operated over WiFi internal interface.
Try to reconfigure ntpd in such way it uses ToS = 0.

If confirmed, that definitively points to some firmware/driver defect in RPI3 (it seems unable to forward IP packets with ToS != 0).
I came back to the computer to ask this very same question as I was just wondering if it was all somehow related, and here you are :!:
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

User avatar
SR-71
Posts: 16
Joined: Fri Nov 23, 2012 7:56 pm

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

Sat Mar 26, 2016 9:02 pm

chrisoh wrote:
SR-71 wrote:Hi all,

ntpd emits IP/UDP packets with ToS field set to 0xc0.
So that is quite similar to the other issue I (and many others) have with RPI3 when operated over WiFi internal interface.
Try to reconfigure ntpd in such way it uses ToS = 0.

If confirmed, that definitively points to some firmware/driver defect in RPI3 (it seems unable to forward IP packets with ToS != 0).
I came back to the computer to ask this very same question as I was just wondering if it was all somehow related, and here you are :!:
I edited my previous message, if feasible, please give a try to the workaround suggested there.

User avatar
dobra-dobra
Posts: 32
Joined: Wed Dec 26, 2012 2:04 pm
Location: Poland

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

Sat Mar 26, 2016 9:29 pm

I confirm that workaround presented by @SR-71 worked for both RPi 3 connected with built-in WiFi and RPi A+ with official WiFi dongle. Yay!

Thank you all for help with this issue.

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

Sat Mar 26, 2016 9:52 pm

SR-71 wrote:I edited my previous message, if feasible, please give a try to the workaround suggested there.
Spot on mate, can confirm this work-around is working here too.
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

oeffoeff
Posts: 1
Joined: Sun Mar 27, 2016 4:53 pm

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

Sun Mar 27, 2016 5:11 pm

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?

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 80 guests