Network Time Protocol (NTP)

Heard this from a Computerphile video, used for time Synchronization.

Wow, this is actually fascinating. First really used this at Enlighted.

In the case ROS, syncing to an NTP server helps reduce jitter between clocks on devices.

ROS 2Ā is dependent upon synchronized clocks between nodes to have all data in the same reference time. When the CreateĀ® 3 is publishing on topics, it is publishing its data with the timestamp of its system clock, which synchronizes with an NTP server.


If the CreateĀ® 3ā€™s Wi-Fi is connected to a network with internet connection, it will sync to a global time NTP server. The CreateĀ® 3 NTP config is also set to listen for servers on USB IP address and If the compute board is connected over USB to the CreateĀ® 3 with the compute board assigned one of these IP addresses on its USB interface, NTP on the compute board can keep the clocks between the compute board and CreateĀ® 3 in sync, even without an internet connection. If there is an internet connection on both compute board and CreateĀ® 3, configuring the NTP server on the compute board to serve the CreateĀ® 3 can still add value by reducing jitter between clocks. If your CreateĀ® 3 and compute board have an internet connection, this is not required, but is still recommended.

I donā€™t think if ROS comes out of the box like this, but this is super important to set up.

  • I guess ROS uses the system clock, so it is up to the OS to set up proper timing


Taken from

  1. On your Compute Board, install chrony NTP server package
sudo apt install chrony
  1. Edit the config file
sudo vi /etc/chrony/chrony.conf
  1. Add the following lines after theĀ pool iburst maxsources #Ā block

    server presend 0 minpoll 0 maxpoll 0 iburst  prefer trust
    # Enable serving time to ntp clients on subnet.
  2. Optionally add the following lines immediately afterward if your SBC will not have a connection to a reference clock (i.e., the Internet)

    # Serve time even if not synchronized to a time source
    local stratum 10
  3. Restart chrony

sudo service chrony restart
  1. Verify compute NTP server is talking to the CreateĀ® 3
sudo chronyc clients
  1. Confirm shows non 0 number in NTP column

    Hostname                      NTP   Drop Int IntL Last     Cmd   Drop Int  Last
    ===============================================================================                  51      0   5   -    32       0      0   -     -
    localhost                       0      0   -   -     -      31      0   7     4
  2. Note that if there is a large jump in the time, the CreateĀ® 3 may not accept it until its next reboot. This can be verified by checking the CreateĀ® 3 robotā€™s log for a line like

user.notice ntpd: ntpd: reply from delay ### is too high, ignoring

If this happens, simply restart the robot (not just the application) via the webserver over the USB network connection.

Combine with ESP32