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 synTime.sh) to write network time to system and the RTC. You should put it into “wittypi” directory and run “chmod +x syncTime.sh” to make it executable.
If you want to put the "synchronisation on boot” back, you may specify this script in the beforeScript.sh file, or you may modify the daemon.sh 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 synchTime.sh) to make it unblocking. The syncTime.sh script needs to be blocking everything until the time is synchronised. However as you can see I put a “sleep 120” in the syncTime.sh 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 daemon.sh 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.
Do you advise removing the network time portion from startup / syncTime.sh on Witty Pi 3 Mini also? Perhaps triggering it more infrequently?
I'm running a Pi remotely that connects via cellular and solar.
The same applies to Witty Pi 3 (Mini) too.
Do you advise removing the network time portion from startup / syncTime.sh on Witty Pi 3 Mini also? Perhaps triggering it more infrequently?
I'm running a Pi remotely that connects via cellular and solar.