Manually synchronise clock


I’m working on a robot using ROS 2 (Foxy) and I’m having an issue that I suspect might be related to clock synchronisation between my Ubuntu PC and my Raspberry Pi which uses balenaOS 2.47.0+rev1.
I’ve read this Time management - Balena Documentation and it uses NTP on the host so container time should be correct.

Is there a way to trigger time synchronisation manually?

Hi, can you expand a little bit on the problem in a sense how big the discrepancy is and how it manifests? Do you suspect that the clock on your Ubuntu PC is wrong or the one on the balenaOS device?

One thing that comes to mind is that on Ubuntu timedatectl should show if the clock is also NTP synchronised. Dual boot (Windows - Ubuntu) could also play tricks

We use chronyd in the later versions of balenaOS to provide NTP sync. You can use chronyc tracking command to view the sync status and systemctl restart chronyd to force a sync.

Hi there - did you try the above advice from my colleague?

Hi guys!
Sorry for the late reply.

I’m not even sure that there was a discrepancy, I just needed a way to manually synchronize the clock to rule out time difference between two machines as ROS is very sensitive to even minor time differences.

I tried systemctl restart chronyd and it did work, thanks for the tip!

It didn’t solve the issue I was debugging, which further suggests that there was no time discrepancy between the machines.