wrt1200acv2 clock adds 1 minute fast each day - solved

Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.)
Author Message
consorts
DD-WRT User


Joined: 13 Sep 2017
Posts: 88

PostPosted: Sun Jun 24, 2018 14:01    Post subject: wrt1200acv2 clock adds 1 minute fast each day - solved Reply with quote
i've tried a variety of NPT client server/ip
i've tried a variety of firmware beta
and i still gain a minute every day and
am forced to save/update the setup page weekly
to get the time back near the actual UTC-5 time.

normally i would not care so much, but i'm running
YAMonitor which is obviously time stamp sensitive.
is there any solution? or does my box simply have
a fast clock crystal and i'm stuck with this warp,
since my box is well out of warranty and otherwise
works flawlessly Wink

is there some way that dd-wrt can save/update with ntp
to synchronize more frequently, such as daily (overnight)?
so i don't have manually do it each week.


i do NOT want to do an automatic reboot of the router
(administration, keep alive, schedule reboot)
because that would disrupt other endpoints that i use.
those wifi endpoints already have accurate clocks,
and i don't want to have to auto reboot them as well.
i also don't want to reboot because verizon fios dhcp
often assigns me a new public wan ip after a reboot,
which i know makes no sense, but they do it anyway.
i would rather keep the same wan ip unless i have a
specific security reason to release it.


Last edited by consorts on Tue Jun 26, 2018 20:14; edited 1 time in total
Sponsor
spuriousoffspring
DD-WRT Guru


Joined: 05 Apr 2017
Posts: 981
Location: Louisiana, USA

PostPosted: Sun Jun 24, 2018 15:31    Post subject: Reply with quote
Copy & paste this into the Additional Cron Jobs box in Administration Tab - Management Sub Tab:

*/10 * * * * root ntpclient us.pool.ntp.org

Change the ntp server as needed.
Then 'Apply Settings'

* This will update the time every 10 minutes.

_________________
DD-WRT Installation & Setup TUTORIAL
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=311117

WRT32X DD-WRT Installation Procedure
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=315569

IPVanish OpenVPN Client Setup TUTORIAL
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=308565

FIRMWARE: OpenWrt SNAPSHOT r8217-2cc821e / LuCI Master (git-18.276.41146-280dd33)
MODEM: ARRIS SURFBoard SB8200
ROUTER: Linksys WRT32X
USB NAS: Western Digital BLACK 1 TB Hardrive + Startech USB 3.0 External SATA III Enclosure
consorts
DD-WRT User


Joined: 13 Sep 2017
Posts: 88

PostPosted: Sun Jun 24, 2018 15:52    Post subject: Reply with quote
thanks Wink

i'm not sure if all those * are needed or variables.

please post what that entry as a daily
(1440 minute) resync would look like?
spuriousoffspring
DD-WRT Guru


Joined: 05 Apr 2017
Posts: 981
Location: Louisiana, USA

PostPosted: Sun Jun 24, 2018 17:47    Post subject: Reply with quote
Copy the command as is for 10 minute time sync. Recommended, especially if you run an OpenVPN Client.

30 Minutes Time sync:
*/30 * * * * root ntpclient us.pool.ntp.org

60 Minutes Time sync:
*/60 * * * * root ntpclient us.pool.ntp.org

1 Hour Time sync:
*/1 * * * root ntpclient us.pool.ntp.org

24 Hour Time sync:
*/24 * * * root ntpclient us.pool.ntp.org

_________________
DD-WRT Installation & Setup TUTORIAL
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=311117

WRT32X DD-WRT Installation Procedure
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=315569

IPVanish OpenVPN Client Setup TUTORIAL
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=308565

FIRMWARE: OpenWrt SNAPSHOT r8217-2cc821e / LuCI Master (git-18.276.41146-280dd33)
MODEM: ARRIS SURFBoard SB8200
ROUTER: Linksys WRT32X
USB NAS: Western Digital BLACK 1 TB Hardrive + Startech USB 3.0 External SATA III Enclosure
ATHF
DD-WRT Guru


Joined: 14 Dec 2015
Posts: 774
Location: 127.0.0.1

PostPosted: Mon Jun 25, 2018 7:40    Post subject: Reply with quote
d0ug wrote:
The reason this happens is that AFAIK the built in NTP config in DDWRT only updates the time ONCE at boot up. None of these routers have built in RTC hardware, so all the time keeping is done in software which is notoriously inaccurate over time. So you either need to setup a cron job to sync it at least once a day, or under the admin tab schedule your router to reboot daily at some time you typically don't use the internet.


From my syslog, all three of my WRT's update time at regular intervals.

_________________
Tutorial for flashing WRT series
WRT Installation,Upgrade & Basic Setup–Cliff Notes
r52242: WRT3200ACM, WRT1200ACv1 & 1 Velop in bridge mode(IoT subnet), r52242 WRT1900ACv1 AP
Velop:2 WHW0101, RE6500, RE9000(AP)
Spectrum - 1000/50
SysLog Watcher 5, New security Onion box coming soon, Fingboxes, PiHoles, NEMS, Cacti, rpisurv
consorts
DD-WRT User


Joined: 13 Sep 2017
Posts: 88

PostPosted: Mon Jun 25, 2018 12:55    Post subject: Reply with quote
d0ug wrote:
time keeping is done in software which is notoriously inaccurate over time.

i really appreciate you adding this - makes me feel better that my hardware isn't defective, it's just one of the minor compromises we pay for using dd-wrt instead of manufacturer firmware.

at first i let cron do the job every hour, but then i noticed during that re-sync moment my internet connection would drop to everyone on my lan for a minute - that's not something we can endure so often. so i got up at 3am and save/applied a 24 hour job instead. now i'm curious to see if i wake up one day with a different public IP address (like I might from a full power cycle reboot).

i guess my question now; is there some less intrusive variation of this command that re-syncs your time with ntp without disrupting your internet connection every time?
spuriousoffspring
DD-WRT Guru


Joined: 05 Apr 2017
Posts: 981
Location: Louisiana, USA

PostPosted: Mon Jun 25, 2018 16:23    Post subject: Reply with quote
@d0ug I always thought it was the number and the position in the (*) asterisk. Thanks for clarifying. (Learn something new every day Mr. Green)

I too haven't seen a disconnect during ntp sync, but I suppose it's possible I may not have noticed if it were happening.

@consorts Do you use dnscrypt?

_________________
DD-WRT Installation & Setup TUTORIAL
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=311117

WRT32X DD-WRT Installation Procedure
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=315569

IPVanish OpenVPN Client Setup TUTORIAL
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=308565

FIRMWARE: OpenWrt SNAPSHOT r8217-2cc821e / LuCI Master (git-18.276.41146-280dd33)
MODEM: ARRIS SURFBoard SB8200
ROUTER: Linksys WRT32X
USB NAS: Western Digital BLACK 1 TB Hardrive + Startech USB 3.0 External SATA III Enclosure
jwieland
DD-WRT User


Joined: 31 May 2018
Posts: 72

PostPosted: Mon Jun 25, 2018 18:13    Post subject: Reply with quote
I haven't seen this problem with my WRT1200ACv2. I'm currently running r36168. From the router logs, I'm seeing ntp updates happening once an hour:

Jun 25 10:45:22 wrt1200ac.foo [daemon.debug] ntpclient[30053]: Connecting to us.pool.ntp.org [104.131.139.195] ...
Jun 25 10:45:23 wrt1200ac.foo [daemon.info] ntpclient[30053]: Time set from us.pool.ntp.org [104.131.139.195].
Jun 25 10:45:23 wrt1200ac.foo [daemon.info] process_monitor[8249]: cyclic NTP Update success (servers us.pool.ntp.org)
Jun 25 11:45:19 wrt1200ac.foo [daemon.debug] ntpclient[30271]: Connecting to us.pool.ntp.org [69.89.207.99] ...
Jun 25 11:45:19 wrt1200ac.foo [daemon.info] ntpclient[30271]: Time set from us.pool.ntp.org [69.89.207.99].
Jun 25 11:45:19 wrt1200ac.foo [daemon.info] process_monitor[8249]: cyclic NTP Update success (servers us.pool.ntp.org)
Jun 25 12:45:16 wrt1200ac.foo [daemon.debug] ntpclient[30489]: Connecting to us.pool.ntp.org [208.75.88.4] ...
Jun 25 12:45:16 wrt1200ac.foo [daemon.info] ntpclient[30489]: Time set from us.pool.ntp.org [208.75.88.4].
Jun 25 12:45:16 wrt1200ac.foo [daemon.info] process_monitor[8249]: cyclic NTP Update success (servers us.pool.ntp.org)
Jun 25 13:45:12 wrt1200ac.foo [daemon.debug] ntpclient[30707]: Connecting to us.pool.ntp.org [129.6.15.28] ...
Jun 25 13:45:12 wrt1200ac.foo [daemon.info] ntpclient[30707]: Time set from us.pool.ntp.org [129.6.15.28].
Jun 25 13:45:12 wrt1200ac.foo [daemon.info] process_monitor[8249]: cyclic NTP Update success (servers us.pool.ntp.org)

_________________
Netgear R9000
Netgear R7800 (spare)
Linksys WRT1200ac v2 (spare)
spuriousoffspring
DD-WRT Guru


Joined: 05 Apr 2017
Posts: 981
Location: Louisiana, USA

PostPosted: Mon Jun 25, 2018 20:44    Post subject: Reply with quote
d0ug wrote:
Since I wasn't 100% certain about how each of those 3 different ways to run hourly jobs are interpreted. I have added the following to my cron at 1:03pm. I'll see what the time stamps in those 3 files look like later this evening

0 * * * * root date >> /tmp/0.txt
*/60 * * * * root date >> /tmp/60.txt
*/1 * * * root date >> /tmp/1.txt

Even a minute after adding them there are still no files generated. So it is quite likely they are all the same and will all just run at XX:00


**EDIT**

Looks like 0 * * * * and */60 * * * * are the same. The */1 * * * appears to not run. There is no output file. It probably needs to be formatted as * */1 * * *. Another odd issue, cron seems to run the jobs twice since there are double time stamps.

root@RouterAP:/tmp# cat 0.txt
Mon Jun 25 14:00:00 EDT 2018
Mon Jun 25 14:00:00 EDT 2018
Mon Jun 25 15:00:00 EDT 2018
Mon Jun 25 15:00:00 EDT 2018
root@RouterAP:/tmp# cat 60.txt
Mon Jun 25 14:00:00 EDT 2018
Mon Jun 25 14:00:00 EDT 2018
Mon Jun 25 15:00:00 EDT 2018
Mon Jun 25 15:00:00 EDT 2018
root@RouterAP:/tmp#

Thanks for figuring this out. Any noticeable loss in connectivity during sync?

_________________
DD-WRT Installation & Setup TUTORIAL
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=311117

WRT32X DD-WRT Installation Procedure
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=315569

IPVanish OpenVPN Client Setup TUTORIAL
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=308565

FIRMWARE: OpenWrt SNAPSHOT r8217-2cc821e / LuCI Master (git-18.276.41146-280dd33)
MODEM: ARRIS SURFBoard SB8200
ROUTER: Linksys WRT32X
USB NAS: Western Digital BLACK 1 TB Hardrive + Startech USB 3.0 External SATA III Enclosure
consorts
DD-WRT User


Joined: 13 Sep 2017
Posts: 88

PostPosted: Tue Jun 26, 2018 17:15    Post subject: Reply with quote
spuriousoffspring wrote:
@consorts - Do you use dnscrypt?

yes i use DNSMasq, but i found the problem i was having.

thanks to d0ug breaking down the command syntax
i put in; * 4 * * * root ntpclient us.pool.ntp.org
which works great at sync'ing me at 4am each day
without any isp interruptions (like a save+apply).
my "software" clock ends up 90sec fast
every 24 hours but i can live with that.


before d0ug's post i thought i had to wake up at 4am
and use; * 24 * * * root ntpclient us.pool.ntp.org
as in 24 hours from now sync again, which i now know
was complete nonsense... so thanks d0ug Wink

anyway, i learned a lot of useful stuff on this thread,
as you regulars here are great at sharing your wisdom.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.) All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum