LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-16-2014, 01:47 AM   #1
kzo81
Member
 
Registered: Aug 2014
Location: Hungary
Distribution: Debian, Linux Mint, CentOS
Posts: 183

Rep: Reputation: Disabled
Raspberry Pi time keeping


Hi all,

I need to find a way to keep the time up-to-date on my Raspberry Pi.
The RPI works on an isolated networks, so there is no chance to get the time from an NTP server, however on the network there is a Mikrotik router which could behave as an NTP server.
I enabled the ntp server service on Mikrotik, inserted the Raspberry's ip as well. In the meantime I watched the traffic with wireshark and it only broadcasts the ntp pocket to 224.0.1.1, which is a multicast address. I also edited the /etc/ntp.conf file on the RPI and inserted the ip like this:
server 0.
server 1.
server 2.
server 3.
192.168.88.2 // Mikrotik

I suppose I misconfigurated the NTP settings in Mikrotik since I see no pockets going to the RPI's ip. I'm unsure what mixture should be used regarding to these paramaters:

broadcast=no/yes
enabled=yes
manycast=yes/no
multicast=no/yes

My goal would be this order:
1. get the time from an NTP server (in case internet is available)
2. get the time from MIkrotik (since it has an inbuilt battery)
3. get the time with the fake-hwclock daemon (if none of the above works)
 
Old 09-16-2014, 04:08 AM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,750

Rep: Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137
Quote:
I enabled the ntp server service on Mikrotik, inserted the Raspberry's ip as well. In the meantime I watched the traffic with wireshark and it only broadcasts the ntp pocket to 224.0.1.1,
If you see traffic to that address then multicast is enables. You need to disable broadcast, multicast, and manycast modes. That way it will respond to unicast requests only.
 
Old 09-17-2014, 11:18 AM   #3
kzo81
Member
 
Registered: Aug 2014
Location: Hungary
Distribution: Debian, Linux Mint, CentOS
Posts: 183

Original Poster
Rep: Reputation: Disabled
Hi,

I did what you suggested but the RPI still doesn't get the time from Mikrotik. I guess I need further configuration in /etc/ntp.conf file on RPI.
 
Old 09-17-2014, 02:36 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,750

Rep: Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137Reputation: 1137
Perhaps. Can you share your current ntp.conf with us for scrutiny?
 
Old 11-06-2014, 08:05 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,876
Blog Entries: 13

Rep: Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929
Why not add a RTC to your Pi for times when you can't get to the internet and accomplish NTP via the public domain?

https://learn.adafruit.com/adding-a-...ry-pi/overview
http://afterthoughtsoftware.com/products/rasclock
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ntpd not keeping time accurate humbletech99 Linux - Networking 2 05-22-2007 10:41 AM
clock not keeping time leupi Linux - Software 10 03-22-2006 02:32 AM
hwclock on a laptop is not keeping time okmyx SUSE / openSUSE 1 12-01-2004 09:42 PM
Keeping time set right shilo Slackware 8 11-26-2004 08:19 PM
Clock not keeping time Culbert Linux - Software 3 03-15-2003 07:15 PM

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

All times are GMT -5. The time now is 11:07 PM.

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