Skip to content
On this page

Time Synchronization

Set the device time manually

In order to set the time manually, you can open the GUI on the Olive device and click on the "Set Time" button. This will synchronize the device time with your computer's time manually. This is useful when you wish to install a package on the device, as for online services and security protocols like HTTPS, synchronization with the current time is essential; otherwise, errors may occur during security handshaking. If you prefer a more automatic and permanent solution, consider running an NTP server on your host computer and defining the NTP server address for Olive. Subsequently, Olive will automatically synchronize the time with the server using the NTP Client.

a8!

Set the Time using Network Time Protocol (NTP)

  1. Install the NTP package: First, you'll need to install the ntp package. Open a terminal and run:
sudo apt update
sudo apt install ntp
sudo apt update
sudo apt install ntp
  1. Stop the systemd-timesyncd service: Debian11 uses systemd-timesyncd by default for time synchronization. Before using ntp, it's a good idea to stop and disable this service to avoid conflicts.
sudo systemctl stop systemd-timesyncd
sudo systemctl disable systemd-timesyncd
sudo systemctl stop systemd-timesyncd
sudo systemctl disable systemd-timesyncd

Configure the NTP client: Edit the NTP configuration file using a text editor like nano:

sudo nano /etc/ntp.conf
sudo nano /etc/ntp.conf

Find the lines that start with pool or server. By default, Debian11 uses the NTP servers provided by the NTP Pool Project. If you want to use a predefined NTP server, replace these lines or add a new line:

server your.ntp.server.address iburst
server your.ntp.server.address iburst

Replace your.ntp.server.address with the address of your predefined NTP server. The iburst option sends a burst of packets if the server does not respond to the first query.

Save and exit the file (in nano, press CTRL + X, then Y, then Enter).

Start the NTP service:

sudo systemctl start ntp
sudo systemctl start ntp

Enable the NTP service to start on boot:

sudo systemctl enable ntp
sudo systemctl enable ntp

Verify the synchronization: After a few minutes, you can check the synchronization status with:

ntpq -p
ntpq -p

This will show a list of NTP servers your machine is syncing with. The asterisk (*) next to a server indicates that your system's time is being synchronized with that server.

Adjust the firewall (if necessary): If you have a firewall enabled, you might need to allow NTP traffic. For ufw (Uncomplicated Firewall), you can do this with:

sudo ufw allow 123/udp
sudo ufw allow 123/udp

That's it! Your Olive system should now be synchronizing its time with the predefined NTP server. Remember to periodically check the synchronization status and monitor the NTP service to ensure accurate timekeeping.