LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Raspberry Pi time keeping (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/raspberry-pi-time-keeping-4175518970/)

kzo81 09-16-2014 12:47 AM

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)

ferrari 09-16-2014 03:08 AM

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.

kzo81 09-17-2014 10:18 AM

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.

ferrari 09-17-2014 01:36 PM

Perhaps. Can you share your current ntp.conf with us for scrutiny?

rtmistler 11-06-2014 07:05 AM

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


All times are GMT -5. The time now is 12:25 AM.