Stabber
Posts: 19
Joined: Sat Apr 20, 2013 4:12 pm

NTP Again

Sat Apr 20, 2013 4:15 pm

Hi All,
I have in the past used SUSE Linux and in that there is a program where you can localise your time to where you are AND tell it which external ntp servers to use.
You then set the date and time and it works automatically forever after that.

Is there /are there any GUI Programs that can do this?
I have tried editing all sorts of files but hey all I want to do is set the clock here not rewrite the whole code.
I appreciate it is not as slick as SUSE or Windows but surely it should be made easier because of the lack of a real time embedded clock.
Regards

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: NTP Again

Sat Apr 20, 2013 7:20 pm

sudo raspi-config and set the timezone. Linux always work on UTC and the timezone settings tells the local system to adjust the local time to suit. All NTP servers work on UTC, it doesn't matter which you use. Windows has worked the same way for many years. Once the timezone is set and assuming it has a working internet connection, it will work at the correct local time.

Image
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Stabber
Posts: 19
Joined: Sat Apr 20, 2013 4:12 pm

Re: NTP Again

Sat Apr 20, 2013 9:31 pm

It does not work.
Of course you set the clock at the startup and localise the system.
Even if you do the raspi-config and set the local time zone again - it still makes no difference - it does not pick up the time from an ntp server.

I appreciate your answer however the situation is bizarre really - firstly the raspberry has no real time clock which I really understand, but because it has no real time clock surely there should be an even higher priority made to get the unit to sync with ntp by default.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: NTP Again

Sat Apr 20, 2013 9:53 pm

If the Pi has an internet connection, the default is to set the Pis clock to an NTP server which is adjusted to local time . It just works in my experience, I've never had to set the clock on a Pi and they all keep perfect time (I have 5 of 'em). Yours obviously isn't doing the business, so perhaps you'd like to fill us in with some details, of your internet connection, OS and other relevant information.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
scruss
Posts: 2418
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: NTP Again

Sat Apr 20, 2013 11:22 pm

Stabber wrote:It does not work.
Are you sure you have a network connection?

Seriously, if it can find a network connection, the standard Raspbian distro goes off, sets the time, and manages it. Usually. My house-lights-controlling Raspberry Pi thew a bit of a wobbly last night, turning the aquarium lights on at 3:30 am. This doesn't often happen.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

Stabber
Posts: 19
Joined: Sat Apr 20, 2013 4:12 pm

Re: NTP Again

Sun Apr 21, 2013 4:47 pm

Yes it has a network connection.
I have a choice of CAT5 LAN or via WiFi both of which are working.
I can remote desktop to the Pi and it can go on line etc.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: NTP Again

Sun Apr 21, 2013 5:36 pm

It sounds like you've got a corrupted operating system. NTPD has been standard issue since day 1.

What does

ps aux|grep ntp

return ?
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Stabber
Posts: 19
Joined: Sat Apr 20, 2013 4:12 pm

Re: NTP Again

Mon Apr 22, 2013 4:26 pm

OK Thanks for all the replies!
I will try with a fresh download and a new SD Card.
Regards

Stabber
Posts: 19
Joined: Sat Apr 20, 2013 4:12 pm

Re: NTP Again

Tue Apr 23, 2013 2:07 pm

Ok i have it now.
Maybe I didnt describe it correctly.

What you can do is as follows:
install rdate (sudo apt-get install rdate)
edit the file /etc/rc.local before the last line
rdate -ns (your local ntp server) mine is ie.pool.ntp.org

(Thanks to 'nbrock' for this http://www.raspberrypi.org/phpBB3/viewt ... =28&t=7600)

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: NTP Again

Tue Apr 23, 2013 2:22 pm

Bizarre.....

It still just works out of the box for almost everyone but you it seems.

If it didn't have ntpd built in and pre-configured to fudge over the lack of an hardware clock, I'd favour ntpdate (sudo apt-get install ntpdate) and running it from a cron a few times a day. Which is what I've done in the past for other linux boxes rather than set up ntpd which is a bit involved from scratch. But since its already set up I don't bother, it just works.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
scruss
Posts: 2418
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: NTP Again

Thu Apr 25, 2013 2:54 am

That is very strange. rdate is pretty much completely deprecated. The only thing I can think of is that you have NTP's port — 123 — firewalled, but not rdate's (37).
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
rpdom
Posts: 14979
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: NTP Again

Thu Apr 25, 2013 5:03 am

pluggy wrote:Bizarre.....

It still just works out of the box for almost everyone but you it seems.

If it didn't have ntpd built in and pre-configured to fudge over the lack of an hardware clock, I'd favour ntpdate (sudo apt-get install ntpdate) and running it from a cron a few times a day. Which is what I've done in the past for other linux boxes rather than set up ntpd which is a bit involved from scratch. But since its already set up I don't bother, it just works.
I used to use ntpdate, but just use ntpd now. The functionality of ntpdate (i.e. one shot mode) can be had with ntpd -q.

Return to “Beginners”