LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 11-08-2016, 11:27 PM   #16
Namrata10
LQ Newbie
 
Registered: Oct 2016
Posts: 18

Original Poster
Rep: Reputation: Disabled

Output of ntpq -p:

remote refid st t when poll reach delay offset jitter
==============================================================================
129.250.35.250 .INIT. 16 u - 64 0 0.000 0.000 0.000
118.67.200.10 .INIT. 16 u - 64 0 0.000 0.000 0.000
80.241.0.72 .INIT. 16 u - 64 0 0.000 0.000 0.000
103.245.79.18 .INIT. 16 u - 64 0 0.000 0.000 0.000

Last edited by Namrata10; 11-08-2016 at 11:29 PM.
 
Old 11-08-2016, 11:35 PM   #17
Namrata10
LQ Newbie
 
Registered: Oct 2016
Posts: 18

Original Poster
Rep: Reputation: Disabled
Output of ntpq -p:

remote refid st t when poll reach delay offset jitter
==============================================================================
129.250.35.250 .INIT. 16 u - 64 0 0.000 0.000 0.000
118.67.200.10 .INIT. 16 u - 64 0 0.000 0.000 0.000
80.241.0.72 .INIT. 16 u - 64 0 0.000 0.000 0.000
103.245.79.18 .INIT. 16 u - 64 0 0.000 0.000 0.000
 
Old 11-09-2016, 03:25 AM   #18
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Since the stratum level (st) is 16 ntp will not use those servers. If you stop and restart ntp you will get a new set of servers. If the results are the same try switching the pool.
 
Old 11-09-2016, 03:32 AM   #19
Namrata10
LQ Newbie
 
Registered: Oct 2016
Posts: 18

Original Poster
Rep: Reputation: Disabled
st is still the same. The remote addresses are different now.

remote refid st t when poll reach delay offset jitter
============================================================================
77.235.14.49 .INIT. 16 u - 64 0 0.000 0.000 0.000
125.62.193.121 .INIT. 16 u - 64 0 0.000 0.000 0.000
218.186.3.36 .INIT. 16 u - 64 0 0.000 0.000 0.000
133.242.142.232 .INIT. 16 u - 64 0 0.000 0.000 0.000

And what do you by switching the pool? Do i need to change my server?
 
Old 11-09-2016, 03:46 AM   #20
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Yes, you can pick a different pool. It could take a few minutes before the Pi is synced.

http://www.pool.ntp.org/en/

See what happens when you try:
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org

Last edited by michaelk; 11-09-2016 at 03:50 AM.
 
Old 11-09-2016, 03:56 AM   #21
Namrata10
LQ Newbie
 
Registered: Oct 2016
Posts: 18

Original Poster
Rep: Reputation: Disabled
Still the same. I changed the pool, restarted the ntp. Nothing happened. Time is still the same and st is still 16 while the remote ip addresses are changed.
 
Old 11-09-2016, 04:04 AM   #22
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Wait a few minutes. Looks like ntp is stuck at init.
 
Old 11-10-2016, 12:38 AM   #23
Namrata10
LQ Newbie
 
Registered: Oct 2016
Posts: 18

Original Poster
Rep: Reputation: Disabled
What should I change the localtime to in sudo cp /usr/share/zoneinfo/US/Pacific /etc/localtime?
Universal, UTC or to my timezone Asia or something else?

I changed the pool to:
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org
 
Old 11-10-2016, 02:37 AM   #24
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Syncing depends on the network being up. And access to the internet. I tend to not run ntp(d) and opt to sync one time manually at boot.

# ntpdate <server>

In my case time-b.nist.gov is what I use most often, but regionally appropriate. In the absence of a network, I go even more manual.

# date -s "YYYYMMDD"
# date -s "HH:MM:SS"

There's probably better ways. But sometimes at a fresh installation, the old manual ways get you through the day.

Some ntp servers don't let you sync if you're more than a day or two off. And since the RPi starts at epoch 0 (1970), you're literally years off. So the manual date method helps to overcome that hurdle by putting you back into tolerances.
 
Old 11-10-2016, 03:24 AM   #25
Namrata10
LQ Newbie
 
Registered: Oct 2016
Posts: 18

Original Poster
Rep: Reputation: Disabled
How do I set ntpdate <server>? Just by running this command?

The set time using:
# date -s "YYYYMMDD"
# date -s "HH:MM:SS"
is not permanent. The raspberry pi just carried on from the time it had got to before I'd turned it off.
 
Old 11-10-2016, 07:53 AM   #26
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Unless you added a battery backed real time clock the clock should start at 0000 1 Jan 1970 at power up. It can't just carry on.

The pi does not have the ntpdate command which is obsolete anyway but can be installed. Although it does help with diagnosing problems. You can use ntpd -g -q but you still need to use a valid time server.

Could be a network issue. Do other computers run linux and sync using ntp? Try the following.

sudo apt-get install ntpdate
sudo ntpdate -u pool.ntp.org
 
Old 11-11-2016, 04:40 AM   #27
Namrata10
LQ Newbie
 
Registered: Oct 2016
Posts: 18

Original Poster
Rep: Reputation: Disabled
Done
Thank you for your help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Set Up The Raspberry PI Zero LXer Syndicated Linux News 0 02-02-2016 06:10 PM
VPN set up on Raspberry pi queenstdot Debian 1 10-08-2015 05:09 PM
VPN set up on Raspberry pi queenstdot Linux - Newbie 1 10-04-2015 04:08 AM
LXer: How To Set Up The Raspberry PI 2 LXer Syndicated Linux News 0 03-22-2015 06:28 PM
LXer: How to set up the Raspberry Pi LXer Syndicated Linux News 0 04-23-2012 03:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration