How to change NTP server

Update
TIME_SERVICES=“ntpd_time” works only if I connect to internet via eth cable.

#TIME_SERVICES=“qcom_time ntpd_time”
TIME_SERVICES=“ntpd_time”
NTPD_SERVERS=“80.153.195.191”
NTPD_USE_DNS_SERVERS=“n”
NTPD_USE_GATEWAY=“n”
NTPD_ONESHOT=“n”

I have noticed, date and time is synch without internet connection when TIME_SERVICES=“qcom_time” is set. Does anyone know how FX30 synchronize time without access to NTP (sim is in and is logged to GSM network but without connection to internet)? How does it work?

As mentioned in the link, “qcom_time” make use the cellular network time (NITZ) so it will work and automatic update the system time if the registered carrier network support it.

For NTP issue, to my understanding, it will fail and terminate if no IP connectivity when the script run.
So maybe your app can force run this script after it setup data connection properly, or trigger command “/usr/sbin/ntpd -p 80.153.195.191” whenever you want to sync the time.

Hope it helps.

hi
I have the same problem now.
How did you solve it?

Hi,
I took @lotam advice and sync time manually after data connection is established.
In other words. If you want to sync date and time you have to run

system("/usr/sbin/ntpd -p <your ntp server here>");

in your code.

Hi,
I tried using this command to run ntp but still its not working.
I tried running sudo dpkg install ntp command , but it is showing dkpg not installed
Please guide on how to install dpkg

Thanks

Hi @Sahithi,
Do you run this command system(“/usr/sbin/ntpd -p <your ntp server here>”); from terminal or use it in your code?

We used it in the code.

Here is a screenshot of the code.

It still shows the error ‘host name not found’. (The same code works when run on a linux machine.)

Hi,
To synch the time you have to establish internet connection (make sure you are connected) and run system(“/usr/sbin/ntpd -p <your ntp server here>”);. End of story.

I have got no idea why you want to resolve us.pool.ntp.org, open socket, … etc. If you want to open the socket anyway try 0.us.pool.ntp.org, 1.us.pool.ntp.org, 2.us.pool.ntp.org or 3.us.pool.ntp.org instead of us.pool.ntp.org

Or check iptables

Application that has a call to system(“/usr/sbin/ntpd -p <your ntp server here>”); has to be UNSANDBOXED otherwise it wont work.

I can confirm also that:

TIME_SERVICES=“ntpd_time” works only if I connect to internet via eth cable.

How can i change timezone to EET via bash command?

You can see here

Try to use command settz
Example which setup PC timezone:
legato.framework.16.10.1.m3.fx30_wp85-201809041005/resources/legato/bin/settz 192.168.2.2

-sh: legato.framework.16.10.1.m3.fx30_wp85-201809041005/resources/legato/bin/settz: not found

I can find it in both 16.10.1 and 16.10.3:

owner@CNHKG-EX-001367:~$ ls /home/owner/legato/packages/legato.framework.16.10.1.fx30_wp85-201704031310/resources/legato/bin/settz -l
-rwxrwxr-x 1 owner owner 1628 Feb 13 2020 /home/owner/legato/packages/legato.framework.16.10.1.fx30_wp85-201704031310/resources/legato/bin/settz
owner@CNHKG-EX-001367:~$ ls /home/owner/legato/packages/legato.framework.16.10.3.fx30_wp85-201711101456/resources/legato/bin/settz -l
-rwxrwxr-x 1 owner owner 1628 May 10 2018 /home/owner/legato/packages/legato.framework.16.10.3.fx30_wp85-201711101456/resources/legato/bin/settz
owner@CNHKG-EX-001367:~$

I am using stock fw 16.10.1.m3_f5d280aff1eaa96ea8459ca6effa50c5
Do i have to upgrade?

There is no settz inside my /bin folder.

you can try to “make clean” and then “make 85”

where do i type them?

of course in the linux terminal:

cd /home/owner/legato/packages/legato.framework.16.10.1.fx30_wp85-201704031310/resources/legato
. bin/configlegatoenv
make clean
make wp85

root@fx30s:~# make clean
-sh: make: not found

cd /home/owner/legato/packages/legato.framework.16.10.1.fx30_wp85-201704031310/resources/legato

. bin/configlegatoenv
make clean
make wp85

Here is my settz on my pc, not sure if you can use it directly:
settz (1.6 KB)