2

I have two embedded system that are connected via ethernet. I want them to run synchronously. Using NTP protocol is an option to synchronize them. But this is a isolated system. I don't have an Internet connection. Is it possible to use ntp protocol locally. One of my system will be the master and the other one will be slave.

Kind regards...

zontragon
  • 275
  • 1
  • 4
  • 14

2 Answers2

3

Yes. You need a NTP server on the local LAN. There's two things here - accurate time (e.g. the time is actually correct) and time sync (they all have the same time, whether correct or not).

If you just need the systems to simply be in sync, to agree on what the time is even if they're not using the correct time, you can just install a cheap box with your favourite Linux distro, configure it to act as a time server (example) and tell both these embedded systems to use that as their time source.

If you need accurate time then you need a GPS or radio time clock, which will set time to an external source without needing an Ethernet connection. This is the one I use, for example, but there are others out there.

Rob Moir
  • 31,884
  • 6
  • 58
  • 89
  • @symcbean, This is an embedded system so that I'm able to use only two 600-800Mhz embedded single board computer becouse of system limits. I'm going to use a RTOS like QNX, VxWorks or RTLinux. Would it be use too much resource if I install ntpd to one of my boards? What whould you do? – zontragon Mar 05 '13 at 12:55
  • @zontragon I think you'd have to test the workload on the system introduced by adding ntpd - this is why i'd favour using a 3rd box (heck it can be something small like a raspberry pi) to handle this kind of misc 'admin' work precisely to keep it off your embedded devices. If they need to use a RTOS then it follows that the extra workload and extra risk of the ntpd process hanging aren't trivial matters in your case in the way they are for most of us working with 'conventional' servers. It might also be that the RTOS implementations of ntpd only function as clients, not servers. – Rob Moir Mar 05 '13 at 15:03
2

Even on a single machine which only has intermittent access to a higher stratum time server, NTP can keep the clock correct by tracking the drift of the system clock from actual time (and applying adjustments). It just needs to be connected some of the time so it can learn what the drift is (drift may vary depending on other factors such as ambient temperature, battery status etc, which NTP can't account for).

In your case, with 2 machines, it's perfectly pssible to have one machine taking it's timestamps from another machine - but both machines will become increasingly out of sync with real time.

You can get cheap radio clocks and GPS dongles which will provide accurate time measurement readable by your computer (which with NTP you'd only need to provision on a single system).

symcbean
  • 21,009
  • 1
  • 31
  • 52