ROSBot 3 Clock wrong with no internet

Hi,

We are encountering a very strange problem, that I’ve not been able to track down a solution for through other googling.

When our ROSBot 3’s boot, and they have internet, chrony correctly finds and synchonsies to an NTP server and the time on the rosbot is correct.

However, if they boot without internet the timestamp is very wrong. It resets to an old time, that can be hours, or even months out of date. This causes obvious issues when using ROS nodes external to the ROSBot as the timestamps are way off. Only when re-connecting to a network with internet do the timestamps update.

I’ve tried tracking down the issue, but it seems to be some combination of what chrony is doing with the raspberry pi 5 as the hardware clock, system clock or rtc. The best I can find is if I run sudo chronyc makestep, chrony will force the clock to actually be ok. But then on the next boot (without internet) the timestamp gets reset to the match the time when I ran the manual makestep command. I can’t seem to find any setting from chrony to make this functionality permanent, and keep the hardware/rtc clock up-to-date.

Any insights would be greatly appreciated, because we don’t always have our wireless network with internet access.

Regards,
Tim

Hi Tim,

From what I understand, there is no RTC clock in the RPi, so when the power is cut off there is no device that can provide a clock signal.

You can find more about it here:

Regards

Hi Rafael,

Thank you. This is a little new to me as I think the upboard doesn’t seem to have the same.

Do you have a suggestion on the best way to synchronise the time from an external computer, if network isn’t available?

Regards and Thank you.
Tim

The UpBoard in ROSbot 2 PRO has a BIOS battery to maintain the clock.

What do you mean by external computer?

If you want the devices to have a synchronized clock despite the lack of connection, it is possible to do this, but all devices must belong to the same LAN. In this case, you can set up one common device for all robots using chrony. This article may be useful.

Another solution could be to use GPS to get the current time;

Hello Rafael,

Thank you. I suspected this may be the case, but it’s nice to confirm.
I’m looking to see if we can synchronise the date from another computer so ROS can happily communicate to an external computer.

Thank you.