What's new

NTP Daemon for ASUSWRT/Merlin

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

sehfui.png

I followed the process and getting jQuery is not defined with all browsers... currently on 56_2 build with 68P
 
Hi,

I had to re-install the NTP Daemon (following exactly the installation guide) and now it has the same symptom as at the beginning:
The NTP Daemon page is shown, but not embedded into the frame/menu of the overall firmware homepage - looks like the sed commands does not do the right job... :rolleyes:

With kind regards
Joe :cool:
 
Can you try the suggest in #22?

I think it's the same issue. Due to me thinking the added jQuery.noConflict() will fix compatibility for all. So far seems works before version <= 378.55. 378.56 yet gives another little surprise.

I'm not upgrading to 378.56 anytime soon. won't be able to look at why the function call break. Comment out the function call as suggested in #22 shall put people back to good state.

Hi,

I had to re-install the NTP Daemon (following exactly the installation guide) and now it has the same symptom as at the beginning:
The NTP Daemon page is shown, but not embedded into the frame/menu of the overall firmware homepage - looks like the sed commands does not do the right job... :rolleyes:

With kind regards
Joe :cool:
 
Can you try the suggest in #22?

I think it's the same issue. Due to me thinking the added jQuery.noConflict() will fix compatibility for all. So far seems works before version <= 378.55. 378.56 yet gives another little surprise.
Hi,

Yes, this did the trick: :rolleyes:
Try comment out with two slashes (//) or delete the line jQuery.noConflict in /www/Tools_NtpdStats.asp. See if this helps...
By the way: I am on Merlin .56_2 release...

With kind regards
Joe :cool:
 
Yes, this did the trick: :rolleyes:

Nice, enjoy!

If people like to experiment, you may delete the three lines containing "jquery" sub-string in /www/Tools_NtpdStats.asp. Do a backup of the file before the experiment..

I think this might work for all versions (<378.55, 378.55 and >378.55).
 
Kvic, nice job!

I discovered a problem this morning with Merlins 380.57 Alpha build. After I flashed 380.57 I could no longer get past the firmware login page. I enter my Username and Password - it shows some activity - but stays on the Login page.

I ssh'd in and commented out the startup lines in /jffs/scripts/post-mount. Rebooted the router and can now login and manage it.

Good luck - I really like your ntpd!
 
Thanks for reporting the issue. Hopefully it's due to alpha firmware. If the problem persists, I can take a look when the firmware is released.

Glad to hear you like this goodies!

EDIT:

Just a quick thought..did you re-apply the patch of NtpdStats pages by re-running Step 2 and Step 5 in the guide?

Depends on the changes in a firmware version. The difference in /www content could be little to huge.

It's necessary re-applying the patch for a new version of firmware. The patch is generic enough to sustain multple firmware upgrades. So give it a try if you haven't..


Kvic, nice job!

I discovered a problem this morning with Merlins 380.57 Alpha build. After I flashed 380.57 I could no longer get past the firmware login page. I enter my Username and Password - it shows some activity - but stays on the Login page.

I ssh'd in and commented out the startup lines in /jffs/scripts/post-mount. Rebooted the router and can now login and manage it.

Good luck - I really like your ntpd!
 
Last edited:
Thanks for reporting the issue. Hopefully it's due to alpha firmware. If the problem persists, I can take a look when the firmware is released.

Glad to hear you like this goodies!

EDIT:

Just a quick thought..did you re-apply the patch of NtpdStats pages by re-running Step 2 and Step 5 in the guide?

Depends on the changes in a firmware version. The difference in /www content could be little to huge.

It's necessary re-applying the patch for a new version of firmware. The patch is generic enough to sustain multple firmware upgrades. So give it a try if you haven't..

Hi kvic. I just re-did the steps 2-5 in the guide. It still caused problems - odd, at one point it did go to the main page (http://192.168.1.1/index.asp) but then hung the browser. I can't close the tab or access any others.

I commented out the restart_httpd in post-mount and rebooted. I can access the Asus web UI and ntpd is running. I just don't have the web interface.
Good luck with the debugging!
 
I am running Merlin 378.56_beta2 on the RT-AC68U.

Three things I noted:

1. I noticed that at the very bottom of the NTP tab page, I see what seems to be remnants of another page. I included a screenshot.

2. If I scroll all the way down to where I can see this rouge button (from question 1), I am no longer able to scroll back up and see any of the other tabs. I have to actually hit the back key on my browser to fix.

3. After initial config and reboot, I also was unable to log into the webui without executing steps 2&5 again even though I had not updated the code. No sure if this is something that needs to be executed on every reboot regardless of whether you are upgrading firmware or not.
 

Attachments

  • 2015-12-07_13-56-38.png
    2015-12-07_13-56-38.png
    296.5 KB · Views: 741
I am running Merlin 378.56_beta2 on the RT-AC68U.

Three things I noted:

1. I noticed that at the very bottom of the NTP tab page, I see what seems to be remnants of another page. I included a screenshot.

2. If I scroll all the way down to where I can see this rouge button (from question 1), I am no longer able to scroll back up and see any of the other tabs. I have to actually hit the back key on my browser to fix.

I'm running 378.55. Try the fix in #22 for 378.56. A full page shall look like this:

2ext0sp.png


3. After initial config and reboot, I also was unable to log into the webui without executing steps 2&5 again even though I had not updated the code. No sure if this is something that needs to be executed on every reboot regardless of whether you are upgrading firmware or not.

/opt is a partition from USB mounted for Entware or another ware

:)
 
...it uses much less RAM than the NTP shipped in current ASUSWRT or Merlin and yet does much more and doing in a proper way.

Thanks for sharing your work.

Could you explain why it uses "much less ram", especially because it appears to have so many more features and cool graphs?

Also what you mean by "doing in a proper way"?

Thanks!
 
Thanks for sharing your work.

Could you explain why it uses "much less ram", especially because it appears to have so many more features and cool graphs?

Also what you mean by "doing in a proper way"?

Thanks!

The stock "NTP" in asus router was poorly designed as a memory resident program (i.e always stay in RAM and run when needed). For what it does, a simple cron job is sufficient and more efficient.

On startup it calls a helper program (/usr/sbin/ntpclient) to sync time once. Stay in RAM and wake up twice everyday to run the same helper program. Under such scheme accuracy won't be good. Perhaps +/- a few seconds per day. Perhaps because no way to confidently tell the accuracy of the system time.

ntpd is well written by its author. Surprisingly easy to exclude stuff we don't need for small devices. So turns out an optimally compiled ntpd ends up using less RAM than the simplistic "NTP" shipped in asuswrt/merlin. The graphing is handled by rrdtool which is a separate package from Entware. It doesn't have to stay in RAM. But still very compact and efficiently implemented for what it does.

ntpd implements sophisticated algorithms of network time protocol i.e. fully compliant with RFC5905. On startup, it syncs more frequently. As system time stabilises, it syncs less around every ~15mins. The algorithm dynamically adjust the interval to ensure the system time at its best possible accuracy. On my AC56U on average the accuracy is within +/- 2 ms. ntpd also tells the max error (in statistic sense) in its accuracy estimation...fantastic!

The load of ntpd is negligible on today's home router. Even though it may sound like doing lots of work in background.
 
I'm running 378.55. Try the fix in #22 for 378.56. A full page shall look like this:

2ext0sp.png




/opt is a partition from USB mounted for Entware or another ware

:)
I had a similar WebUI issue running Merlin 380.57_alpha3 first on an RT-AC87U and also on an RT-AC88U. Attempting to login into the main WebUI was impossible.

I installed from scatch this morning on the RT-AC88U. But, before doing the "service httpd_restart" I commented out the line kvic mentioned (jQuery.noConflict in /www/Tools_NtpdStats.asp). Did the httpd_restart - everything worked fine.

I then did a reboot - again, all is well.

Thanks!

ps: Now if we can get gpsd in Entware-ng!!!...
 
I had a similar WebUI issue running Merlin 380.57_alpha3 first on an R...

ps: Now if we can get gpsd in Entware-ng!!!...

Interesting, Entware-ng does indeed have gpsd (and cgps). Many thanks Entware-ng devs!

I just tried it. I can read NMEA sentences from a USB GPS dongle. gpsd attaches correctly and cgps shows time, location etc.

When I try to use it as reference source in kvic's ntpd it doesn't show up. Turning up debug, I see a line in /tmp/syslog.log that says this:
Dec 18 14:06:59 ntpd[3665]: refclock 127.127.28.0 isn't supported. ntpd was compiled without refclock support.

Kvic, any chance you can recompile ntpd with refclock support?

Thanks again.
 
@JGrana Are you sure GPSD is what you want to do? Your refclock IP address (127.127.28.0) suggests that you're trying to use the SHM driver with GPSD. Here's the complete list of refclock drivers here:
http://doc.ntp.org/4.2.8/refclock.html#list

I use the Refclock Driver Type#20, Generic NMEA GPS Receiver. No GPSD required. However, I had to recompile the Asuswrt-Merlin firmware to enable the FTDI USB serial driver in the Linux kernel.

ntp.conf
Code:
...
...
# Generic NMEA GPS Receiver
#  mode is 9600 baud + only $GxZDA for time messages
#  /dev/gps0 for NEMA
#  /dev/gpspps0 for PPS
#  http://doc.ntp.org/4.2.8/drivers/driver20.html
server 127.127.20.0 mode 24 minpoll 4 prefer
fudge 127.127.20.0 flag1 1 # Enable PPS signal processing
fudge 127.127.20.0 flag2 0 # Capture the pulse on the rising edge
fudge 127.127.20.0 flag3 1 # Use the kernel discipline
fudge 127.127.20.0 flag4 1 # Obscures location in timecode
...
...
 
Last edited:

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top