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!

spdMerlin spdMerlin v4.4.11 [2025-Jun-15] - Internet Speedtest and Monitoring Tool for AsusWRT Merlin

...
[: 0
0: bad number
/jffs/scripts/spdmerlin: line 5531: arithmetic syntax error
Starting speedtest using auto-selected server for WAN interface. Please wait...

I'll be issuing a new spdMerlin release version sometime in the next few days.

@itibi,

While waiting for the next production release, you could switch from the master to the *develop* branch, which has the fix for the problem you're experiencing:
Bash:
/jffs/scripts/spdmerlin develop
If you do the switch, let me know if the problem gets resolved in your router.

Once the next production release is available, you can switch back to the *master* branch:
Bash:
/jffs/scripts/spdmerlin stable

HTH.
 
Release Notes for spdMerlin v4.4.10 production version now available
[2025-Jun-08]


1) FIXED: New code to remove duplicate parameter key names found in the configuration file. Getting duplicate key values can cause "bad number" or "arithmetic syntax" errors.
[Thanks to @itibi for reporting the problem]​

2) FIXED: New code to display correct numeric values when download or upload data units are in GB or KB.
[Thanks to @Tarek Yag for reporting the problem]​

3) IMPROVED: Added code to create a separate logfile to capture the SQLite3 errors with more verbosity.
Debug logfile default location: /opt/share/tmp/

4) Miscellaneous code improvements and fine-tuning.


The fork from @Jack Yaz's spdMerlin is now hosted on the AMTM-OSR GitHub repo:
 
Hello again,

I'm reporting again regarding the numeric values bug I reported a few days ago. Today, while I was having my usual look at the latest automatic Speedtest results it came to my attention that numbers are showing consistently incorrect again!
So, I immediately made a few manual speed tests, but processing the numerics showed random results (alternating between new and old display) with no specific pattern that I could recognize for troubleshooting.

Moreover, for more troubleshooting, I tried switching between built-in and external Speedtest binaries (spdMerlin v4.4.10) to no avail, so I went with a first impression that it's caused by having multiple code paths for processing numeric values and the bug fix isn't applied to all code paths, or it could be some bug with processing Speedtest result's text itself. And I was about to report this first conclusion.

Anyway, I had an idea to try and check if there's any new code in the develop branch, and to my expectation, there was (v4.4.11)! I made more speed tests and the bug vanished completely with both Speedtest binaries (since there's a new external binary with the new version in development).

However, I thought it could be helpful to drop this information here for you guys, @Martinski, @ExtremeFiretop. It might be a bug you're already working on and/or already fixed.
Attached is a screenshot from my Last X Results table, showing automatic test results at the very bottom, then some test results with v4.4.10, then at the very top some test results with v4.4.11.

EDIT #1 : Re-wrote some points for clearance. Added more details.
EDIT #2 : Mentioned members.
 

Attachments

  • 2025-06-15_07-37-10.png
    2025-06-15_07-37-10.png
    308.1 KB · Views: 15
Last edited:
Release Notes for spdMerlin v4.4.11 production version now available
[2025-Jun-15]


1) FIXED: Display correct numeric values when using the built-in Speedtest binary, and download/upload data units are in GB or KB.

2) FIXED: Removed "color escape codes" from the AutoBW Report displayed on the WebUI page.
[Thanks to @maghuro for reporting the issue]​

3) IMPROVED: Updated external Speedtest CLI binaries from the previous 1.1.1.28 to the latest 1.2.0.84 version currently available.

4) Miscellaneous code improvements.


The fork from @Jack Yaz's spdMerlin add-on is now hosted on the AMTM-OSR GitHub repo:
 
Release Notes for spdMerlin v4.4.11 production version now available
[2025-Jun-15]


1) FIXED: Display correct numeric values when using the built-in Speedtest binary, and download/upload data units are in GB or KB.

2) FIXED: Removed "color escape codes" from the AutoBW Report displayed on the WebUI page.
[Thanks to @maghuro for reporting the issue]​

3) IMPROVED: Updated external Speedtest CLI binaries from the previous 1.1.1.28 to the latest 1.2.0.84 version currently available.

4) Miscellaneous code improvements.


The fork from @Jack Yaz's spdMerlin add-on is now hosted on the AMTM-OSR GitHub repo:
Thank you once again for your hard work! 💪🏻

A doubt I always has - what's the difference between the built-in and external binaries? And which should we use, which is the best and why?
 
Thank you once again for your hard work! 💪🏻

A doubt I always has - what's the difference between the built-in and external binaries? And which should we use, which is the best and why?
I don't have sufficient knowledge of the inner workings of the Speedtest binaries to provide meaningful answers to your questions.
 
Would it be possible to add tags and releases with the changelog to the AMTM-OSR github repos? Right now the most recent tag for AMTM-OSR/spdMerlin is 4.4.5 from Dec 2022, and there aren't any releases or changelogs at all. Adding releases would be helpful because then I could watch the repos on github and get email notifications with the changes when a new release is pushed.
 
Would it be possible to add tags and releases with the changelog to the AMTM-OSR github repos? Right now the most recent tag for AMTM-OSR/spdMerlin is 4.4.5 from Dec 2022, and there aren't any releases or changelogs at all. Adding releases would be helpful because then I could watch the repos on github and get email notifications with the changes when a new release is pushed.

It's one of my action items for the team, I think I brought that one up about 2 weeks ago. It's currently pending @thelonelycoder and @Martinski to review in our private discussions and provide feedback. It's on the list of many things but will get done eventually, it just got pushed back by other more priority things.
 
A doubt I always has - what's the difference between the built-in and external binaries? And which should we use, which is the best and why?

I've always had this question in my mind since the first day I started using spdMerlin.
But, since I started realizing how outdated my RT-AC68U is, and experienced a few bugs that I helped troubleshoot and fix in DomainVPNRouting script, specific to my router's model; that's when I've got the ultimate answer.

The external library right now will always be newer than the built-in library I have on my router, as my router's Merlin firmware has reached it's EOL last year, hence, no more Merlin firmware updates and no more library updates for anything.

However, for the newer router models and firmware versions, the external library could be upgraded ahead of the firmware's built-in library for several scenarios and for several reasons. I'll keep this for your imagination.

Moreover, from a Software Engineer's perspective, it's always good to use the latest stable version of any software and/or libraries ;)
 
It seems like it thinks I'm still using JFFS, and triggers a false warning. My real JFFS is 13.54 / 44.46 MB according to ScMerlin, so it must count what I have used on USB (SSD).
Also, last row. Is that supposed to be grayed out? Don't think it used to be that.

Update: spdMerlin show correct JFFS in CLI. So just GUI is affected.
 

Attachments

  • Screenshot 2025-06-19 at 20.40.54.png
    Screenshot 2025-06-19 at 20.40.54.png
    111.6 KB · Views: 11
Last edited:
Welcome to spdMerlin v4.4.11, a script by JackYaz

By installing spdMerlin you are agreeing to Ookla's license: https://raw.githubusercontent.com/AMTM-OSR/spdMerlin/master/speedtest-cli-license


Do you wish to continue? (y/n) y
Checking if your router meets the requirements for spdMerlin

Installing required packages from Entware

Downloading https://bin.entware.net/aarch64-k3.10/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
Package sqlite3-cli (3.49.1-2) installed in root is up to date.
Package jq (1.7.1-2) installed in root is up to date.
Package p7zip (16.02-3) installed in root is up to date.
Package findutils (4.10.0-1) installed in root is up to date.
Speedtest CLI 1.2.0.84 version was downloaded.

New version of spdstats_www.asp downloaded

Mounting WebUI tab for spdMerlin

Mounted spdMerlin WebUI page as user3.asp

Upgrading database - Please wait...

grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
 
Would it be possible to add tags and releases with the changelog to the AMTM-OSR github repos? Right now the most recent tag for AMTM-OSR/spdMerlin is 4.4.5 from Dec 2022, and there aren't any releases or changelogs at all. Adding releases would be helpful because then I could watch the repos on github and get email notifications with the changes when a new release is pushed.

This has been completed...
Any future releases should automatically generate "tags", "releases" and "release notes" for any script within AMTM-OSR.

I also went back and back-dated some missing tags and releases.
 
Last edited:
Welcome to spdMerlin v4.4.11, a script by JackYaz

By installing spdMerlin you are agreeing to Ookla's license: https://raw.githubusercontent.com/AMTM-OSR/spdMerlin/master/speedtest-cli-license


Do you wish to continue? (y/n) y
Checking if your router meets the requirements for spdMerlin

Installing required packages from Entware

Downloading https://bin.entware.net/aarch64-k3.10/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
Package sqlite3-cli (3.49.1-2) installed in root is up to date.
Package jq (1.7.1-2) installed in root is up to date.
Package p7zip (16.02-3) installed in root is up to date.
Package findutils (4.10.0-1) installed in root is up to date.
Speedtest CLI 1.2.0.84 version was downloaded.

New version of spdstats_www.asp downloaded

Mounting WebUI tab for spdMerlin

Mounted spdMerlin WebUI page as user3.asp

Upgrading database - Please wait...

grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
Do you have the log file? Post it?
Debug logfile default location: /opt/share/tmp/
 
Welcome to spdMerlin v4.4.11, a script by JackYaz

By installing spdMerlin you are agreeing to Ookla's license: https://raw.githubusercontent.com/AMTM-OSR/spdMerlin/master/speedtest-cli-license


Do you wish to continue? (y/n) y
Checking if your router meets the requirements for spdMerlin

Installing required packages from Entware

Downloading https://bin.entware.net/aarch64-k3.10/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
Package sqlite3-cli (3.49.1-2) installed in root is up to date.
Package jq (1.7.1-2) installed in root is up to date.
Package p7zip (16.02-3) installed in root is up to date.
Package findutils (4.10.0-1) installed in root is up to date.
Speedtest CLI 1.2.0.84 version was downloaded.

New version of spdstats_www.asp downloaded

Mounting WebUI tab for spdMerlin

Mounted spdMerlin WebUI page as user3.asp

Upgrading database - Please wait...

grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
I have added more error-handling code when an SQLite3 database operation fails to create a file. These changes are found only in the latest 'develop' branch 4.4.12 version.

If you would like to test the latest code, you can switch from the currently installed production/master release to the latest 'develop' branch version using the following command:
Bash:
/jffs/scripts/spdmerlin develop

To go back to the production/master release, use the following command:
Bash:
/jffs/scripts/spdmerlin stable

Thanks for reporting the issue. Let me know if the latest 'develop' version fixes the errors you're seeing; otherwise, please provide the debug logfile available here: /opt/share/tmp/
 
...
Also, last row. Is that supposed to be grayed out? Don't think it used to be that.
Currently, the "Exclude speedtests from QoS" radio buttons are grayed out if you have enabled (i.e. set to "Yes") the AutoBW configuration. Double-check your settings to be sure.

It seems like it thinks I'm still using JFFS, and triggers a false warning. My real JFFS is 13.54 / 44.46 MB according to ScMerlin, so it must count what I have used on USB (SSD).
...
The "JFFS Available" message is displayed whether your "Data Storage Location" is set to JFFS or not. The intention is to let users be aware of the free available space in case they try to switch from USB.

The "NOTICE" tag (not a Warning) is displayed whenever the available JFFS space goes below 20% of total space or 10MB (whichever is lower) after a database operation was performed. This is intended to be a heads-up message to let users know the JFFS free space may be getting "dangerously" low at some point.

Update: spdMerlin show correct JFFS in CLI. So just GUI is affected.
If the numbers do not match, you will need to refresh the WebUI page to get the latest report from the CLI menu.
 
Currently, the "Exclude speedtests from QoS" radio buttons are grayed out if you have enabled (i.e. set to "Yes") the AutoBW configuration. Double-check your settings to be sure.


The "JFFS Available" message is displayed whether your "Data Storage Location" is set to JFFS or not. The intention is to let users be aware of the free available space in case they try to switch from USB.

The "NOTICE" tag (not a Warning) is displayed whenever the available JFFS space goes below 20% of total space or 10MB (whichever is lower) after a database operation was performed. This is intended to be a heads-up message to let users know the JFFS free space may be getting "dangerously" low at some point.


If the numbers do not match, you will need to refresh the WebUI page to get the latest report from the CLI menu.
A refresh does not help. Also cleared all browser data and checked with several browsers. I have used USB since the setup of spdMerlin. The WebUI does not seem to know that USB is used.
All scripts that can use USB for data has that option enabled. Nothing else but spdMerlin shows incorrect JFFS.

Not a major issue, but still an interesting glitch.

Update: away from home and used Chrome via VPN on the phone. Suddenly OK. Will check when home again.

Update 2: Something made it work even on the Mac browser when I remotely controlled it. I see it as solved, whatever that solved it.
 
Last edited:
I have added more error-handling code when an SQLite3 database operation fails to create a file. These changes are found only in the latest 'develop' branch 4.4.12 version.

If you would like to test the latest code, you can switch from the currently installed production/master release to the latest 'develop' branch version using the following command:
Bash:
/jffs/scripts/spdmerlin develop

To go back to the production/master release, use the following command:
Bash:
/jffs/scripts/spdmerlin stable

Thanks for reporting the issue. Let me know if the latest 'develop' version fixes the errors you're seeing; otherwise, please provide the debug logfile available here: /opt/share/tmp/

New version of spdstats_www.asp downloaded
Mounting WebUI tab for spdMerlin
Mounted spdMerlin WebUI page as user3.asp
Upgrading database - Please wait...

grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory

[from another session during install]
tail -f spdMerlin_DBSQL_DEBUG.LOG

[2025-06-20 10:14:25] BEGIN [glx2]
Database: /jffs/addons/spdmerlin.d/spdstats.db
SQLite header and source version mismatch
2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da
2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70
SQLite header and source version mismatch
2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da
2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70
(repeats SEVERAL TIMES)
 

Attachments

New version of spdstats_www.asp downloaded
Mounting WebUI tab for spdMerlin
Mounted spdMerlin WebUI page as user3.asp
Upgrading database - Please wait...

grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
grep: /tmp/spdstats-tableinfo.lst: No such file or directory
sed: /tmp/spdMerlin-lastx.csv: No such file or directory
mv: can't rename '/tmp/spdMerlin-lastx.csv': No such file or directory

[from another session during install]
tail -f spdMerlin_DBSQL_DEBUG.LOG

[2025-06-20 10:14:25] BEGIN [glx2]
Database: /jffs/addons/spdmerlin.d/spdstats.db
SQLite header and source version mismatch
2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da
2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70
SQLite header and source version mismatch
2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da
2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70
(repeats SEVERAL TIMES)

I ran the 4.4.12 (develop version of spdMerlin) and the log file appears to be the same as in 4.4.11
 
...
SQLite header and source version mismatch
...
The above error message indicates that you have a corrupted SQLite3 installation. Follow the instructions below to clean up and restart with a "fresh" installation:

1) Uninstall spdMerlin:
Bash:
/jffs/scripts/spdmerlin uninstall

2) Copy & paste the following set of commands (*including* the enclosing curly braces):
Bash:
{
   rm -f /opt/share/tmp/spdMerlin_*.LOG
   rm -f /opt/share/spdmerlin.d/spdstats.db
   rm -f /jffs/addons/spdmerlin.d/spdstats.db
   opkg remove sqlite3-cli libsqlite3 --force-removal-of-dependent-packages
   opkg update
   opkg install sqlite3-cli
   echo "----------------------------------------"
   opkg list-installed | grep sqlite3
   /opt/bin/sqlite3 -version
   echo "----------------------------------------"
}

3) Download and reinstall the latest spdMerlin 'develop' branch version:
Bash:
curl -LSs --retry 3 --retry-delay 5 --retry-connrefused \
https://raw.githubusercontent.com/AMTM-OSR/spdMerlin/refs/heads/develop/spdmerlin.sh \
-o /jffs/scripts/spdmerlin && chmod 755 /jffs/scripts/spdmerlin
/jffs/scripts/spdmerlin install

4) When the spdMerlin installation is completed, post the results and debug logfile (if any).
 

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!

Staff online

Back
Top