Clear all

[Solved] Witty Pi 4: how to synchronise time with Internet on boot?

1 Posts
1 Users
Posts: 15
Member Admin
Topic starter

It is not recommended to do time synchronisation so frequently, and it is actually not necessary with rather accurate RTC on Witty Pi 4. We have seen many cases that the schedule script was interrupted due to incorrect time from the the Internet, that's why we removed the "synchronisation on boot” feature from Witty Pi 4’s software.

However if you want to, you may use the attached BASH script (please rename it to to write network time to system and the RTC. You should put it into “wittypi” directory and run “chmod +x” to make it executable.

If you want to put the "synchronisation on boot” back, you may specify this script in the file, or you may modify the file and put it in a place you like.

If you rely on the internet time, you can not put the ‘&’ at the end of command (for calling to make it unblocking. The script needs to be blocking everything until the time is synchronised. However as you can see I put a “sleep 120” in the file too, this has been proved to be needed in real use cases, you may reduce the waiting time if you are sure the system gets stable sooner.

Here you can also see our motivation to remove the "synchronisation on boot” feature: the synchronisation requires the whole system to get stable first, and that require rather long time, while it also needs to block the script so the schedule script running can use the time from the network. We will have to either accept the schedule script get executed with a delay (maybe 2 minutes), or we cut the waiting time but accept the possibility to get a wrong network time and mess up everything. It is really hard to implement a solution that ticks all the boxes.

This topic was modified 3 weeks ago 2 times by uugear
Posted : 12/05/2023 6:11 pm