Page 1 of 1
date and clock sync
Posted: 03 Jan 2018 14:23
by wfrcrd
Hi!
There is a way to perform the date and clock sync via NTP using a root command , or a script?
Thank you !!
Re: date and clock sync
Posted: 03 Jan 2018 16:32
by Desmanto
You can use
ntpd, which is part of the busybox.
Usage: ntpd [-dnqNwl -I IFACE] [-S PROG] [-p PEER]...
NTP client/server
-d Verbose
-n Do not daemonize
-q Quit after clock is set
-N Run at high priority
-w Do not set time (only query peers), implies -n
-S PROG Run PROG after stepping time, stratum change, and every 11 mins
-p PEER Obtain time from PEER (may be repeated)
If -p is not given, 'server HOST' lines
from /etc/ntp.conf are used
-l Also run as server on port 123
-I IFACE Bind server to IFACE, implies -l
Go to
http://www.pool.ntp.org and find the nearest server to you location. For example, I will use German. Then you can change the time by using Execute root Command
Add a debug dialog after it to see the result.
Re: date and clock sync
Posted: 04 Jan 2018 01:51
by wfrcrd
Thank you Desmanto,
I need more hints:
how can I invoke busybox from the flow?
What action should I perform?
Thank you.
Re: date and clock sync
Posted: 04 Jan 2018 05:27
by Desmanto
You mean to use command from busybox? No extra action needed as long as you have installed busybox. When you install the busybox you should already have all the command from busybox linked to the system path (usually /system/xbin/). ntpd can be used directly, or you can just add busybox at the beginning of the command, to make sure it use the binary from busybox
Code: Select all
busybox ntpd -n -q -p de.pool.ntp.org
Most of the time, the "busybox" is not needed anymore. You can try the command in terminal emulator first, by typing su first to switch to root shell. If you don't have the ntpd (not found), then install busybox first, or maybe the binary is installed in different path.
Re: date and clock sync
Posted: 04 Jan 2018 13:31
by wfrcrd
Yes it works!
Simpy edit an action->execute root command->
in the command line put " ntpd -n -q -p de.pool.ntp.org " (as you said),
and wait for the next minute on the statusbar clock to see the time upgrade.
Thank you!