1

I'm setting up an installation where a small number of LAN connected Pis (model 3) will display a number of image slideshows, each on a separate display. As the images on each of the displays must appear and dissappear approximately at the same time I thought to use a global clock for synchronisation purposes

My issue is that it has been quite hard to find a concise guide on setting up a LAN clock across the various forums - for example I have found several references to setting up an NTP server on a PI but each tutorial seems to be slightly different than the next - on one only ntp.conf is edited, in another additional conf files are edited (dhcp) and in yet another it is mentioned that NTP is obsolete because the timesync service is now used.

I was wondering if someone could please point me to a current and correct guide to setup a time server on my LAN so that the Pis on it can have the same time?

12
  • "it is mentioned that NTP is obsolete because the timesync service" -> timesyncd ( freedesktop.org/software/systemd/man/…) is NTP based so this is a bit fallacious; hopefully what was actually said was that the NTP client implementation had changed and ntpd was obsolete -- although I think this now applies to timesyncd as well in favour of chronyd, which is also NTP based. Point being: NTP is not going anywhere. It is a very widely (not just on Linux) used used system involving a global infrastructure...
    – goldilocks
    Jul 8, 2018 at 14:28
  • ...2nd point being: If you configure a local NTP server (by any means), you can count on a client existing for it using pretty much any operating system worth the name. So focus on that.
    – goldilocks
    Jul 8, 2018 at 14:30
  • Thanks for the feedback. So what should I use as server and client mplementations to achieve what I am looking for?
    – Socrats
    Jul 8, 2018 at 14:33
  • Don't worry about the client, that's just a matter of finding out what it is and configuring it to use your server (shouldn't be too hard). As for setting up a server, after looking around it is surprisingly hard to find information; I recommend you ask "How to set up an NTP server on Linux" on our larger sibling site, Unix & Linux. Personally I'd find it simpler to just bang out a simple UDP app because it would take me less time to code than to sift through NTP docs, if you have anyone like that around.
    – goldilocks
    Jul 8, 2018 at 14:52
  • From the resources I'd found I got the impression that setting up a Pi as an NTP server was a simple affair... most tutorials included a modified ntp.conf file as "ntp server" and did not mention any other steps....so is there no Rasbian built-in support for something like this? Regarding your UDP app suggestion, what's the high level design behind this? I mean how would the pis synchronise through this?
    – Socrats
    Jul 8, 2018 at 15:02

1 Answer 1

0

As goldilicks has pointed out NTP is alive and well, although Debian Stretch has adopted a simpler client systemd-timesyncd.service

You can restore ntpd, which can function as a server, but as I have not done this will refrain from attempting to explain - you may find https://digitalbarbedwire.com/2015/05/16/debianubuntu-systemd-ntp-and-something-called-timesyncd/ useful.

You would need to configure the other Pi to use this in /etc/systemd/timesyncd.conf

This seems like overkill; if I was running an isolated network I would use an inexpensive RTC - those based on DS3231 are at least an order of magnitude better than the system clock, and temperature stabilised.

An even simpler approach is to copy the date from the host by running ssh pi@hostname.local sudo date -s$(date -Ins) . This should synchronise the clocks, and could be run regularly using chron. I use this approach to synchronise clocks on systems without internet access.

1
  • The simple ssh approach you are suggesting may work for what I have in mind, I will look into it and provide feedback, thanks
    – Socrats
    Jul 9, 2018 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.