What's new

ntpMerlin ntpMerlin v3.4.14 [2026-Mar-22] - NTP Time Server for AsusWRT Merlin

Release Notes for ntpMerlin v3.4.13 production version now available
[2025-Dec-21]


1) IMPROVED: Modified the CLI top Main Menu to separate some groups of options and settings into their own sub-menus.
This is an effort to make the top Main Menu shorter, more manageable, more user-friendly, and to improve the user experience.​

Sample screenshots:

ntpMerlin_v3.4.13_CLI_MainMenu.jpg


ntpMerlin_v3.4.13_CLI_TimeServerOptions.jpg


ntpMerlin_v3.4.13_CLI_DatabaseOptions.jpg
 
I started using ntpMerlin a couple of weeks ago, and it immediately came to my attention that the rc functions script of the ntpd (S77ntpd) service has a bug that causes the display of somehow misleading action messages.

Details: the script located at /opt/etc/init.d/S77ntpd inappropriately contains a command to kill all ntpd processes (for restart, stop, and kill actions), before normally proceeding to execute the rc.func file functions, which in turn try to kill all ntpd processes again for the aforementioned commands, leading to always reporting that the service is already dead!

When using the rc functions as anyone would normally do, this abnormal behavior leads to always reporting the service as 'dead' when restarting, stopping or killing S77ntpd (because it was just killed in the wrong sequence), omitting related messages where it checks the current state of the service before executing the desired command.

Two screenshots attached for demonstration purposes, the first one shows the wrong behavior of the S77ntpd script, and the second one shows how a normal rc functions script works.
 

Attachments

  • 2026-01-10_09-09-32.png
    2026-01-10_09-09-32.png
    52.3 KB · Views: 47
  • 2026-01-10_09-11-52.png
    2026-01-10_09-11-52.png
    62.5 KB · Views: 47
I started using ntpMerlin a couple of weeks ago, and it immediately came to my attention that the rc functions script of the ntpd (S77ntpd) service has a bug that causes the display of somehow misleading action messages.

Details: the script located at /opt/etc/init.d/S77ntpd inappropriately contains a command to kill all ntpd processes (for restart, stop, and kill actions), before normally proceeding to execute the rc.func file functions, which in turn try to kill all ntpd processes again for the aforementioned commands, leading to always reporting that the service is already dead!

When using the rc functions as anyone would normally do, this abnormal behavior leads to always reporting the service as 'dead' when restarting, stopping or killing S77ntpd (because it was just killed in the wrong sequence), omitting related messages where it checks the current state of the service before executing the desired command.

Two screenshots attached for demonstration purposes, the first one shows the wrong behavior of the S77ntpd script, and the second one shows how a normal rc functions script works.

Yeah, early on when I started maintaining the add-on, I noticed that behavior too but since that code doesn't cause (and AFAIK, hasn't caused) any errors or issues with ntpMerlin itself, I just decided to leave that code alone, especially since I didn't (and I still don't) know all the reason(s) that @JackYaz had for implementing the code the way it is, and without knowing any more details and context, I'd rather play it safe and keep it as is, unless the code is indeed causing errors or interfering with ntpMerlin core functionality.

Also, notice that the ntpMerlin-provided custom Entware service scripts (S77ntpd, S77chronyd) actually execute the custom timeserverd shell script, so the execution flow is not as simple as it looks, and it can't be compared to a standard Entware service script.

And finally, keep in mind that users are not meant to manually stop, start, or restart the NTP services (ntpd or chronyd). Let the ntpMerlin add-on manage the NTP process without any user manual intervention, unless it's failing to start for some reason, or generating some fatal errors.
 
Last edited:
Attempted to install ntpmerlin via AMTM on my AXE-16000
1769271035091.png

or
1769271065950.png

Which caused nonstop
1769271080733.png

(or the same message with chrony)

So I just uninstalled it for now. Or tried too, but got - Any ideas?
1769271236033.png
 
Alright, might not be on your end. Cause I tried to see what was going on with entware and got this.
1769271400111.png

fun. I should figure out what happened there.

Update: 100% on my end. Still not sure why i can't reach entware, but i'll figure it out.
 
Last edited:
Finally got this installed after figuring out everything else that was weird, and it's working great!

It fixed the "Cannot find NTP server" spam in my log that was causing a 5 minute delay on bootup. I believe that was tied to adguard in some fashion, but with ntpmerlin and chrony I boot up everything and am back online within 2 minutes instead of 5. Also there's cool NTP graphs.

Thanks!
 
Release Notes for ntpMerlin v3.4.14 production version now available
[2026-Mar-22]


1) NEW: Added code to support "Automatic Script Updates" via AMTM.
This new functionality requires AMTM 6.4 or a later version.

2) IMPROVED: Added code to double-check that the corresponding Entware package (NTP or Chrony) has actually been installed before proceeding to start/restart the service.



The fork from @Jack Yaz's ntpMerlin add-on is now hosted on the AMTM-OSR GitHub repo:
 
Last edited:
Hi everyone, and thanks again to the AMTM-OSR team for all the work on these add-ons. I wanted to share some troubleshooting notes about a nasty SQLite issue I hit after updating to ntpMerlin v3.4.14 (March 22 build) and how I worked around it.

Recently my ISP dropped the connection at the same time ntpMerlin was doing a database write, and afterwards my messages log started filling up with errors like:
SQLite3 fatal error: SQLite3 binary is likely corrupted and SQLite header and source version mismatch

At first this looked like real database corruption, but after a lot of digging it turned out to be a classic SQLite "header and source version mismatch" situation: one binary was loading a different libsqlite3 than it was built for, which SQLite reports as "likely corrupted" even though the database and binary are actually fine.

In my case I had Python 3 from Entware installed, which brought in its own libsqlite3.so, and the router's native /usr/sbin/sqlite3 (built with the firmware in 2023) was ending up linked against Entware's newer SQLite library in /opt/lib (built in 2026). That version mix is exactly what SQLite warns against and is enough to trigger the error.

How ntpMerlin and Entware interacted?
The piece that surprised me is how ntpMerlin ties into this. The script is written to prefer the Entware sqlite3 binary at /opt/bin/sqlite3 and only fall back to the built-in /usr/sbin/sqlite3 when the Entware one is missing. On top of that, during startup it checks for /opt/bin/sqlite3 and, if it's not there, runs opkg update and opkg install sqlite3-cli to pull it in from Entware, logging "Installing required version of sqlite3 from Entware."

So ntpMerlin itself doesn't change LD_LIBRARY_PATH, but it does take Entware and the Entware sqlite3 toolchain as a hard requirement, and Entware in turn adjusts PATH and library paths system-wide on Asuswrt-Merlin systems. That combination meant that once I had Python 3 and Entware's SQLite on the box, other add-ons (like uiDivStats) could also end up tripping over the same mixed-version SQLite libraries even though they weren't specifically using Entware's binaries.

What I had to do to get my router back?
Because of the way ntpMerlin auto-installs sqlite3-cli when /opt/bin/sqlite3 is missing, I couldn't just remove the Entware sqlite3 package and be done with it - opening the script menu would immediately try to reinstall it. As a workaround I ended up doing something like a "phantom package":
  • I quarantined or removed the Entware sqlite3 binaries and libraries so they wouldn't be picked up unexpectedly.
  • I created a symlink so that anything expecting /opt/bin/sqlite3 would actually hit the native /usr/sbin/sqlite3, which matches the firmware's own libsqlite3.
  • I then locked the Entware sqlite3 package using opkg flag hold sqlite3-cli so that the amtm/ntpMerlin logic wouldn't silently reinstall the real Entware version on the next run.
That was enough to stop the "header and source version mismatch" errors and get both ntpMerlin and other SQLite-using add-ons working again.

Suggestions for more defensive programming behaviour
Routers are already fragile enough ecosystems, and any add-on that pulls in whole subsystems like Entware has a lot of influence over everything else running on the box. Based on this experience, here are two things I'd love to see more of going forward:
  1. Prefer native tools where possible: Asuswrt-Merlin already ships with a usable sqlite3 in /usr/sbin/sqlite3. For many use-cases (including what ntpMerlin is doing) it would be safer to default to the native binary and only fall back to /opt when there's a strong reason to do so. I noticed that later release notes mention an export PATH change to give built-in binaries higher priority than Entware ones, which is exactly the sort of change I'm advocating.
  2. Limit the blast radius of Entware: If an add-on truly must depend on Entware packages, it would help if its scripts wrapped any Entware calls in a carefully controlled environment instead of relying on the global PATH / LD_LIBRARY_PATH that Entware adds. That way a single package upgrade (like Python 3 and its SQLite) is less likely to affect other built-in tools or unrelated scripts.

I hope this write-up helps anyone else who ends up in the same SQLite mismatch loop, and I'd be very happy to see future ntpMerlin/AMTM-OSR releases continue down the path of preferring native tools and isolating Entware where possible.

Best,
H
 

Similar threads

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!
Back
Top