Hi!
There is a way to perform the date and clock sync via NTP using a root command , or a script?
Thank you !!
date and clock sync
Moderator: Martin
Re: date and clock sync
You can use ntpd, which is part of the busybox.
Add a debug dialog after it to see the result.
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 CommandUsage: 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
Code: Select all
ntpd -n -q -p de.pool.ntp.org
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: date and clock sync
Thank you Desmanto,
I need more hints:
how can I invoke busybox from the flow?
What action should I perform?
Thank you.
I need more hints:
how can I invoke busybox from the flow?
What action should I perform?
Thank you.
Re: date and clock sync
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
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.
Code: Select all
busybox ntpd -n -q -p de.pool.ntp.org
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: date and clock sync
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!
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!