What's new
  • 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!

ntpMerlin ntpMerlin v3.4.7 - NTP Time Server for AsusWRT Merlin

Martinski

Very Senior Member
Release Notes for ntpMerlin v3.4.7 production release now available
[2025-May-29]


The fork from @Jack Yaz's repository is now hosted on the AMTM-OSR GitHub repo:

1) FIXED: Errors when loading the webGUI page on the 3006.102.x F/W version.

2) FIXED: Bug giving incorrect results when computing the free space available of a large-capacity USB-attached drive. This was preventing the user from resetting the database using the CLI menu.

3) FIXED: "Reset Database" functionality on the CLI menu, where the database file was correctly reset but the result was not reflected on the webGUI page where "old" entries were still shown as if the database had not been reset.

4) IMPROVED: Modified all SQLite3 calls to capture and log errors in the system log.

5) IMPROVED: Modified SQLite3 configuration parameters to improve the trimming of records from the database and then perform "garbage collection" of deleted entries to reclaim unused space & avoid excessive fragmentation.

6) IMPROVED: Modified SQLite3 configuration parameters to improve the processing of database records.

7) IMPROVED: Modified code to set the corresponding priority level of log entries when calling the built-in logger utility.

8) IMPROVED: Modified the startup call made in the post-mount script to check if the USB-attached disk partition passed as the argument has indeed Entware installed.

9) IMPROVED: Added code to show the current database file size information on the CLI menu and the webGUI page.

10) IMPROVED: Added code to show the "JFFS Available" space information for the "Data Storage Location" option on the CLI menu and the webGUI page.

11) IMPROVED: Added code to check if sufficient JFFS storage space is available before moving database-related files/folders from USB location to JFFS partition. An error message is reported if not enough space is available, and the move request is aborted.

12) IMPROVED: Added code to check if the available JFFS storage space falls below 20% of total space or 10MB (whichever is lower) and report a warning when it does. A warning message is also shown on the SSH CLI menu and WebGUI page.

13) IMPROVED: Added and modified code so that every time the SSH CLI menu is run, it checks if the WebGUI page has already been mounted. If not found mounted, the script will run the code to remount the WebGUI.

14) IMPROVED: Improved code that creates (during installation) and removes (during uninstallation) the "AddOns" menu tab entry for the WebGUI to make sure it checks for and takes into account other add-ons that may have been installed before or were later installed after the initial installation.

15) IMPROVED: Added "export PATH" statement to give the built-in binaries higher priority than the equivalent Entware binaries.

16) IMPROVED: Various code improvements & fine-tuning.
 
Very nice work to all the contributors. I'm sure jack will be happy his baby has graduated and is moving on to bigger things.
 
Dear @Martinski,

May you please follow-up from this thread/post: What I did wrong?

🙏 in advance!
Based on the error messages shown in your screenshot, it looks like the database was corrupted going from 3.4.5 to 3.4.7 version since the table ID "main.ntpstats" being referenced is unknown.

I'd suggest deleting the current database file and then reinstalling the latest 3.4.7 version.
Bash:
rm -f /opt/share/ntpmerlin.d/ntpdstats.db*
rm -f /jffs/addons/ntpmerlin.d/ntpdstats.db*
/jffs/scripts/ntpmerlin install

I don't use ntpMerlin at all, so I don't know what could have corrupted the database, but I've seen reports of other add-ons where it has happened as well.
 
Something odd is going with the databases on this script.
When running 'generate' it throws many errors when trying to truncate the db:
Code:
+ rm -f /tmp/ntpMerlinStats_TMP_13463.LOG
+ [ 0 -lt 5 ]
+ [ 0 -lt 25 ]
+ /opt/bin/sqlite3 /opt/share/ntpmerlin.d/ntpdstats.db
+ cat /tmp/ntpMerlinStats_TMP_13463.LOG
+ sqlErrorMsg=truncate
Illegal instruction
+ echo truncate
Illegal instruction
+ grep -qE ^(Parse error|Runtime error|Error:)
+ [ 1 -ge 25 ]
+ [ 0 -ge 5 ]
+ sleep 1
+ [ 0 -lt 5 ]
+ [ 1 -lt 25 ]
+ /opt/bin/sqlite3 /opt/share/ntpmerlin.d/ntpdstats.db
+ cat /tmp/ntpMerlinStats_TMP_13463.LOG
+ sqlErrorMsg=truncate
Illegal instruction
truncate
Illegal instruction
+ echo truncate
Illegal instruction
truncate
Illegal instruction
+ grep -qE ^(Parse error|Runtime error|Error:)
+ [ 2 -ge 25 ]
+ [ 0 -ge 5 ]
+ sleep 1
+ [ 0 -lt 5 ]
+ [ 2 -lt 25 ]
+ /opt/bin/sqlite3 /opt/share/ntpmerlin.d/ntpdstats.db
+ cat /tmp/ntpMerlinStats_TMP_13463.LOG
+ sqlErrorMsg=truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
+ echo truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
+ grep -qE ^(Parse error|Runtime error|Error:)
+ [ 3 -ge 25 ]
+ [ 0 -ge 5 ]
+ sleep 1

Before you ask, I removed all the db and performed a completely clean install.
 
Something odd is going with the databases on this script.
When running 'generate' it throws many errors when trying to truncate the db:
Code:
+ rm -f /tmp/ntpMerlinStats_TMP_13463.LOG
+ [ 0 -lt 5 ]
+ [ 0 -lt 25 ]
+ /opt/bin/sqlite3 /opt/share/ntpmerlin.d/ntpdstats.db
+ cat /tmp/ntpMerlinStats_TMP_13463.LOG
+ sqlErrorMsg=truncate
Illegal instruction
+ echo truncate
Illegal instruction
+ grep -qE ^(Parse error|Runtime error|Error:)
+ [ 1 -ge 25 ]
+ [ 0 -ge 5 ]
+ sleep 1
+ [ 0 -lt 5 ]
+ [ 1 -lt 25 ]
+ /opt/bin/sqlite3 /opt/share/ntpmerlin.d/ntpdstats.db
+ cat /tmp/ntpMerlinStats_TMP_13463.LOG
+ sqlErrorMsg=truncate
Illegal instruction
truncate
Illegal instruction
+ echo truncate
Illegal instruction
truncate
Illegal instruction
+ grep -qE ^(Parse error|Runtime error|Error:)
+ [ 2 -ge 25 ]
+ [ 0 -ge 5 ]
+ sleep 1
+ [ 0 -lt 5 ]
+ [ 2 -lt 25 ]
+ /opt/bin/sqlite3 /opt/share/ntpmerlin.d/ntpdstats.db
+ cat /tmp/ntpMerlinStats_TMP_13463.LOG
+ sqlErrorMsg=truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
+ echo truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
+ grep -qE ^(Parse error|Runtime error|Error:)
+ [ 3 -ge 25 ]
+ [ 0 -ge 5 ]
+ sleep 1

Before you ask, I removed all the db and performed a completely clean install.
Thanks for reporting, but unfortunately, you didn't provide enough details and context. Please post the full normal output from the 'generate' operation (*not* only from the script in debug mode). Once I have all the necessary info, I can take a look over the weekend.

NOTE:
Do *not* edit the output or log to show only what you believe is relevant. More details and context around the issue are needed. Your custom configuration file may also be useful to see.

Thanks.
 
Thanks for reporting, but unfortunately, you didn't provide enough details and context. Please post the full normal output from the 'generate' operation (*not* only from the script in debug mode). Once I have all the necessary info, I can take a look over the weekend.

NOTE:
Do *not* edit the output or log to show only what you believe is relevant. More details and context around the issue are needed. Your custom configuration file may also be useful to see.

Thanks.
Thanks for your help!

Attached is my config file.
'sh /jffs/scripts/ntpmerlin generate' doesn't generate any output.
When doing 'sh -x' it loops that output 25 times.

Please tell me if you need more info 💪🏻
 

Attachments

  • Screenshot_2025-06-04-11-03-35-530_com.server.auditor.ssh.client.jpg
    Screenshot_2025-06-04-11-03-35-530_com.server.auditor.ssh.client.jpg
    40.1 KB · Views: 22
Thanks for your help!

Attached is my config file.
'sh /jffs/scripts/ntpmerlin generate' doesn't generate any output.
When doing 'sh -x' it loops that output 25 times.

Please tell me if you need more info 💪🏻

Just in an attempt to get a clearer picture and better data, can you run the following?
Code:
which -a sqlite3

And then get the versions of anything that returns? For example:
Code:
/opt/bin/sqlite3 --version

Should give an output like:
Code:
3.46.1 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33 (64-bit)

Alternatively do:
Code:
opkg list-installed | grep -i sqlite
 
Hey @ExtremeFiretop

I have been trying to get ntpMerlin to fail here this morning, but so far no luck.

For comparison, using 388.8_4 on a AX86U-PRO, the output of your request is as follows;

Code:
ClientAdmin@RTAX86UPro:/tmp/home/root# which -a sqlite3
/opt/bin/sqlite3
/usr/sbin/sqlite3
/opt/bin/sqlite3

ClientAdmin@RTAX86UPro:/tmp/home/root# /opt/bin/sqlite3 --version
3.46.1 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33 (64-bit)

ClientAdmin@RTAX86UPro:/tmp/home/root# /usr/sbin/sqlite3 --version
3.42.0 2023-05-16 12:36:15 831d0fb2836b71c9bc51067c49fee4b8f18047814f2ff22d817d25195cf350b0

The only issue I've had since the upgrade is ntpMerlin fails to mount the webUI page. Even after a reboot. I am able to resolve this by issuing ntpmerlin startup force .

I very seldom use the WebUI for ntpMerlin (I mean, the router is not a very good clock, so I expect to see wide variations, so why bother watching it). I just wanted chrony and this this script saved me from setting it up.

After running ntpmerlin generate, I did notice that my graphs looked off, like there was no data to load prior the generate. Does not bother me though as I don't use the WebUI or the graphs. Hopefully the above version info will help.
 
Just in an attempt to get a clearer picture and better data, can you run the following?
Code:
which -a sqlite3

And then get the versions of anything that returns? For example:
Code:
/opt/bin/sqlite3 --version

Should give an output like:
Code:
3.46.1 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33 (64-bit)

Alternatively do:
Code:
opkg list-installed | grep -i sqlite

Here goes nothing!
Code:
adminGT-AX6000/tmp/home/root which -a sqlite3
/opt/bin/sqlite3
/usr/sbin/sqlite3
/opt/bin/sqlite3
adminGT-AX6000/tmp/home/root /opt/bin/sqlite3 --version
3.46.1 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33 (64-bit)
adminGT-AX6000/tmp/home/root /usr/sbin/sqlite3 --version
3.42.0 2023-05-16 12:36:15 831d0fb2836b71c9bc51067c49fee4b8f18047814f2ff22d817d25195cf350b0
adminGT-AX6000/tmp/home/root /opt/bin/sqlite3 --version
3.46.1 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33 (64-bit)
adminGT-AX6000/tmp/home/root opkg list-installed | grep -i sqlite
libsqlite3 - 3460100-1
sqlite3-cli - 3460100-1
 
Thanks for your help!

Attached is my config file.
'sh /jffs/scripts/ntpmerlin generate' doesn't generate any output.
When doing 'sh -x' it loops that output 25 times.

Please tell me if you need more info 💪🏻
Frankly, your screenshot is unreadable and therefore unhelpful. One has to squint their eyes very hard to try to read the relevant information, which takes up less than ~40% of the screenshot. As a result, the majority of the image ends up showing useless information, relegating the pertinent data to a small area of the screen. I'd highly recommend learning how to take better screenshots.

UPDATE:
I have modified the ntpMerlin script to create a separate debug log to capture the SQLite3 errors with more verbosity. This new code is currently only in the *develop* branch, so if you want to check if the errors are being logged, you can switch from the *master* to the *develop* branch using the following command:
Bash:
/jffs/scripts/ntpmerlin develop
After switching to the develop branch, try running the same test that generates the errors, and when completed, look for the debug log in the /opt/share/tmp/ directory, and please post the entire logfile.
 
Last edited:
Frankly, your screenshot is unreadable and therefore unhelpful. One has to squint their eyes very hard to try to read the relevant information, which takes up less than ~40% of the screenshot. As a result, the majority of the image ends up showing useless information, relegating the pertinent data to a small area of the screen. I'd highly recommend learning how to take better screenshots.

UPDATE:
I have modified the ntpMerlin script to create a separate debug log to capture the SQLite3 errors with more verbosity. This new code is currently only in the *develop* branch, so if you want to check if the errors are being logged, you can switch from the *master* to the *develop* branch using the following command:
Bash:
/jffs/scripts/ntpmerlin develop
After switching to the develop branch, try running the same test that generates the errors, and when completed, look for the debug log in the /opt/share/tmp/ directory, and please post the entire logfile.
Code:
adminGT-AX6000/tmp/mnt/AX6000-USB/entware/share/tmp cat ntp*
===========================================
[2025-06-05 16:00:45] BEGIN [tme1]
Database: /opt/share/ntpmerlin.d/ntpdstats.db
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
--------------------------------
PRAGMA temp_store=1;
PRAGMA journal_mode=TRUNCATE;
CREATE TABLE IF NOT EXISTS [ntpstats] ([StatID] INTEGER PRIMARY KEY NOT NULL,[Timestamp] NUMERIC NOT NULL,[Offset] REAL NOT NULL,[Frequency] REAL NOT NULL,[Sys_Jitter] REAL NOT NULL,[Clk_Jitter] REAL NOT NULL,[Clk_Wander] REAL NOT NULL,[Rootdisp] REAL NOT NULL);
INSERT INTO ntpstats ([Timestamp],[Offset],[Frequency],[Sys_Jitter],[Clk_Jitter],[Clk_Wander],[Rootdisp]) values(1749135645,-0.367992,+19.129,1.722640,0.680,0.047,62.388);
--------------------------------
[2025-06-05 16:00:55] END [tme1]
 
Code:
adminGT-AX6000/tmp/mnt/AX6000-USB/entware/share/tmp cat ntp*
===========================================
[2025-06-05 16:00:45] BEGIN [tme1]
Database: /opt/share/ntpmerlin.d/ntpdstats.db
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
truncate
Illegal instruction
--------------------------------
PRAGMA temp_store=1;
PRAGMA journal_mode=TRUNCATE;
CREATE TABLE IF NOT EXISTS [ntpstats] ([StatID] INTEGER PRIMARY KEY NOT NULL,[Timestamp] NUMERIC NOT NULL,[Offset] REAL NOT NULL,[Frequency] REAL NOT NULL,[Sys_Jitter] REAL NOT NULL,[Clk_Jitter] REAL NOT NULL,[Clk_Wander] REAL NOT NULL,[Rootdisp] REAL NOT NULL);
INSERT INTO ntpstats ([Timestamp],[Offset],[Frequency],[Sys_Jitter],[Clk_Jitter],[Clk_Wander],[Rootdisp]) values(1749135645,-0.367992,+19.129,1.722640,0.680,0.047,62.388);
--------------------------------
[2025-06-05 16:00:55] END [tme1]
Thank you for providing the test/debug results.

Over the weekend, I may send you a DM with instructions to download a separate test/debug script to try to gather more information and, hopefully, narrow down the root cause of the problem.
 

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