From experimentation and the following documentation - I think that the stock legato OS - date (time) is updated via the cellular network (NITS) and that time update via ntp is disabled
Cellular network time in the UK is very flaky - so I’d like to use ntp instead.
What is the recommended method?
At a guess we have the following options
Modify the time settings - maybe /etc/time_service.conf ?
Manually call ntpd from an app? - something like ntpd -p time.nist.gov works – not sure how to make ntpd available to an app though
something else?
I think the following topic is related to this topic
I think calling “ntpd -p time.nist.gov” in app is the easiest and most controllable way so your app can call it after data connection established.
But “ntpd” requires to run as root so need to set “sandboxed: false” in .adef.
Otherwise, modify /etc/time_service.conf to set
TIME_SERVICES=“qcom_time ntpd_time”
NTPD_SERVERS=“203.95.213.129” #use IP address otherwise ntpd may exit as failed to resolve domain name
NTPD_ONESHOT=“n”
Then ntpd will run in background and wait for data connection to sync time, but reminded it also depends on boot script on the system.
Calling ntpd - pretty much what I thought except I’d forgotten about the root issue which is bad news as it means in practice that a separate app will be needed just to set the time. The advantage is that the IP usage is controlled
Modify /etc/time_service.conf - the issues with this are - I guess it kicks off regular time request updates? using IP data. I guess it means for a production system rebuilding the os with this option set?
I think a better way would be to modify the Legato modem time daemon (assuming below is correct) to add an option to pick up ntp as well as NITS and GNSS time.