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.13 [2025-Jul-03] - Internet Speedtest and Monitoring Tool for AsusWRT Merlin

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).
Removing package sqlite3-cli from root...
Removing package python3-pip from root...
Removing package python3 from root...
Removing package python3-sqlite3 from root...
Removing package libsqlite3 from root...
Downloading https://bin.entware.net/aarch64-k3.10/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
Installing sqlite3-cli (3.49.1-2) to root...
Downloading https://bin.entware.net/aarch64-k3.10/sqlite3-cli_3.49.1-2_aarch64-3.10.ipk
Installing libsqlite3 (3460100-1) to root...
Collected errors:
* opkg_download_pkg: Package libsqlite3 is not available from any configured src.
* opkg_install_pkg: Failed to download libsqlite3. Perhaps you need to run 'opkg update'?
* opkg_install_cmd: Cannot install package sqlite3-cli.
----------------------------------------
-sh: /opt/bin/sqlite3: not found
----------------------------------------
 
Removing package sqlite3-cli from root...
Removing package python3-pip from root...
Removing package python3 from root...
Removing package python3-sqlite3 from root...
Removing package libsqlite3 from root...
Downloading https://bin.entware.net/aarch64-k3.10/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
Installing sqlite3-cli (3.49.1-2) to root...
Downloading https://bin.entware.net/aarch64-k3.10/sqlite3-cli_3.49.1-2_aarch64-3.10.ipk
Installing libsqlite3 (3460100-1) to root...
Collected errors:
* opkg_download_pkg: Package libsqlite3 is not available from any configured src.
* opkg_install_pkg: Failed to download libsqlite3. Perhaps you need to run 'opkg update'?
* opkg_install_cmd: Cannot install package sqlite3-cli.
----------------------------------------
-sh: /opt/bin/sqlite3: not found
----------------------------------------
[SOLVED]:
My entware packages were FUBAR. So I uninstalled / re-installed the entware packages, ran the spdmerlin install (4.4.11), and spdmerlin is working perfectly now!

Thanks so much for your help and I apologize for the errant rabbit hole side venture!
 
[SOLVED]:
My entware packages were FUBAR. So I uninstalled / re-installed the entware packages, ran the spdmerlin install (4.4.11), and spdmerlin is working perfectly now!

Thanks so much for your help and I apologize for the errant rabbit hole side venture!
Ah, no worries. It was all in a day’s work! Our little side venture actually made the code a little better because now there’s error handling for cases where some output files are not created during a database operation. So it was not all for naught.

Thank you for taking the time to provide feedback and useful data.
 
Release Notes for spdMerlin v4.4.12 production version now available
[2025-Jun-22]


1) IMPROVED: Added error-handling code when an SQLite3 database operation fails to create a file.

2) IMPROVED: When an SQLite3 operation returns error messages indicating a corrupted binary, the error-handling code will now log a separate message to the system logger and to its own debug logfile to let users know of the corrupted SQLite3 and the need to remove and reinstall its Entware package.

3) Miscellaneous code improvements.


The fork from @Jack Yaz's spdMerlin add-on is now hosted on the AMTM-OSR GitHub repo:
 
One issue I've been seeing is that whenever my router reboots, all VPN interfaces are excluded from monitoring. Presumably, spdmerlin is checking if they are up too quickly and then excluding them instead of retaining the prior settings.

Could logic be added to warn if an included interface is disconnected, rather than relying on the user to enable the interfaces after every reboot?
 
Could logic be added to warn if an included interface is disconnected
I like that. Good idea.
Yet, no matter how hard I try, I can't replicate your issue other than disabling or mashing up a vpn's settings before the reboot. Other than the obvious hardware difference perhaps maybe look into why your vpn's are slow at starting or, more likely, slow at connecting. Is there a delay in your WAN connecting?
 
I like that. Good idea.
Yet, no matter how hard I try, I can't replicate your issue other than disabling or mashing up a vpn's settings before the reboot. Other than the obvious hardware difference perhaps maybe look into why your vpn's are slow at starting or, more likely, slow at connecting. Is there a delay in your WAN connecting?
VPNMON-R3 handles the OpenVPN interfaces, so it makes sense that they are slow to come up. I also have two WireGuard clients that always seem to be disconnected (from spdmerlin) initially.

The WAN seems to connect pretty rapidly.
 
One OpenVPN and two Wireguard clients here without issue. Try removing VPNMON for a test reboot.
 
One OpenVPN and two Wireguard clients here without issue. Try removing VPNMON for a test reboot.
Same setup on my router and no issues for me either.
 
One OpenVPN and two Wireguard clients here without issue. Try removing VPNMON for a test reboot.

I believe the conflict may exist because vpnmon starts earlier in the boot process on the router.
The post-mount scripts are executed before the services-start in the boot process.

For example; If I review VPNMON's code I can see it's started in the services-start as found below:

1750721546655.png


However I check spdmerlin it starts in post-mount as found below:

1750721623448.png


@iTyPsIDg Can you share the contents of your post-mount and services-start to confirm?
 
Correction; I was looking at the uninstall section of the code for vpnmon (not a script I handle)
vpnmon does use post-mount, so the question becomes, which one is first in the order within post-mount?

1750722023557.png
 
Correction; I was looking at the uninstall section of the code for vpnmon (not a script I handle)
vpnmon does use post-mount, so the question becomes, which one is first in the order within post-mount?

View attachment 66382
Yes, that's a very good point. The order of execution of VPNMON relative to spdMerlin would affect the timing of when the VPN interfaces come up as active.

Even if the order of execution happens to be correct (i.e. VPNMON before spdMerlin), I think it would be worth adding some delay to the startup sequence where spdMerlin checks for interfaces to allow enough time for them to initialize and become active.

I'll make some changes in the 'develop' branch and make it available for testing purposes.
 
VPNMON-R3 handles the OpenVPN interfaces, so it makes sense that they are slow to come up. I also have two WireGuard clients that always seem to be disconnected (from spdmerlin) initially.

The WAN seems to connect pretty rapidly.
I have added a 90-sec delay to the startup sequence that checks when interfaces are initialized and ready for spdMerlin. Currently, this change is found only in the 'develop' branch.

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

To switch back to the master branch:
Bash:
/jffs/scripts/spdmerlin stable

If you test with the latest 'develop' branch version, please let us know the results.
 
I have added a 90-sec delay to the startup sequence that checks when interfaces are initialized and ready for spdMerlin. Currently, this change is found only in the 'develop' branch.

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

To switch back to the master branch:
Bash:
/jffs/scripts/spdmerlin stable

If you test with the latest 'develop' branch version, please let us know the results.
Too bad I didn't see this before the reboot I just had to perform. I'll update to develop and try rebooting again later. After this particular reboot, I did see that the WGC interfaces were NOT excluded from spdmerlin. The OVPNC interfaces were, as expected.

Bash:
#!/bin/sh


/bin/sh /jffs/addons/amtm/shell_history.mod -run # Added by amtm

/bin/sh /jffs/addons/amtm/sc_update.mod -set # Added by amtm
cru a RunBackupMon "30 2 * * * sh /jffs/scripts/backupmon.sh -backup"
[ -x /jffs/scripts/MerlinAU.sh ] && /jffs/scripts/MerlinAU.sh startup "$@" & #MerlinAU#
[ -f /jffs/scripts/MerlinAU.sh ] && sh /jffs/scripts/MerlinAU.sh addCronJob &  #Added by MerlinAU#
cru a RunVPNMONR3reset "0 5 * * * sh /jffs/scripts/vpnmon-r3.sh -reset"

cru a entware_smb "*/3 * * * * /jffs/scripts/custom-start-smb.sh"
/jffs/scripts/scmerlin startup & # scMerlin
/jffs/addons/scmerlin.d/S95tailtaintdns start >/dev/null 2>&1 & # scMerlin - tailtaintdns

Bash:
#!/bin/sh

swapon /tmp/mnt/Core-Files/myswap.swp # Added by amtm
. /jffs/addons/amtm/mount-entware.mod # Added by amtm

[ -x "${1}/entware/bin/opkg" ] && [ -x /jffs/scripts/uiDivStats ] && /jffs/scripts/uiDivStats startup "$@" & # uiDivStats
(sleep 30 && /jffs/scripts/vpnmon-r3.sh -screen) & # Added by vpnmon-r3

[ -x "${1}/entware/bin/opkg" ] && [ -x /jffs/scripts/connmon ] && /jffs/scripts/connmon startup "$@" & # connmon
[ -x "${1}/entware/bin/opkg" ] && [ -x /jffs/scripts/spdmerlin ] && /jffs/scripts/spdmerlin startup "$@" & # spdMerlin
[ -x "${1}/entware/bin/opkg" ] && [ -x /jffs/scripts/ntpmerlin ] && /jffs/scripts/ntpmerlin startup "$@" & # ntpMerlin

[ -x "${1}/entware/bin/opkg" ] && rm -f /jffs/configs/.smb_started # clear stale flag file so our cron task will run
 
Maybe another option, if possible, is two-fold:
  1. Provide a means from the command-line to enable an interface. Something like /jffs/scripts/spdmerlin enable_interface VPNC4|WGVPN5|WAN|etc
  2. Ask @Viktor Jaep if another configuration prompt could be added to VPNMON-R3 asking if the user wants to include that interface in monitoring. That way, whenever VPNMON-R3 initiates a reset, it could call the enable_interface command.
This will eliminate any need for a manual timer, though it does require some additional configuration changes with two different scripts. Just thinking out loud about possibilities.
 
Maybe another option, if possible, is two-fold:
  1. Provide a means from the command-line to enable an interface. Something like /jffs/scripts/spdmerlin enable_interface VPNC4|WGVPN5|WAN|etc
  2. Ask @Viktor Jaep if another configuration prompt could be added to VPNMON-R3 asking if the user wants to include that interface in monitoring. That way, whenever VPNMON-R3 initiates a reset, it could call the enable_interface command.
This will eliminate any need for a manual timer, though it does require some additional configuration changes with two different scripts. Just thinking out loud about possibilities.

Martinski also added a command to reset the interfaces in PR: https://github.com/AMTM-OSR/spdMerlin/pull/35
Please try again by updating to the develop branch with Martinski's instructions, and report back after your reboot :)

Thanks!
 
Martinski also added a command to reset the interfaces in PR: https://github.com/AMTM-OSR/spdMerlin/pull/35
Please try again by updating to the develop branch with Martinski's instructions, and report back after your reboot :)

Thanks!
I updated. I will try a reboot later when I won't have any complaints about having no internet.

@Viktor Jaep - May I request that you add an option in VPNMON-R3 after settling down to issue the aforementioned reset command? reset_interfaces force
 
@Viktor Jaep - May I request that you add an option in VPNMON-R3 after settling down to issue the aforementioned reset command? reset_interfaces force
"My pleasure!" <said in a Chick'Fil'A voice> So, to be clear I'm documenting this correctly... whenever VPNMON-R3 goes through any kind of reset, you want as one of its last steps to run this command:

Code:
sh /jffs/scripts/spdMerlin.sh reset_interfaces force
 
...
Code:
sh /jffs/scripts/spdMerlin.sh reset_interfaces force
CORRECTION
The shell script filename is all lowercase *and* without a file extension:
Bash:
/jffs/scripts/spdmerlin reset_interfaces force
 
Something odd is happening.
I have auto speed tests configured for AUTOBW.
I have them excluded from QoS so QoS won't interfere.
Today, I configured a wireguard vpn client (wgc2). I included it in auto speed tests just for sake of fun.
Every speed test I realize (even with exclude from QoS), the wan interface is affected by QoS values, but the wgc2 don't as expected.
I tried to set my QoS down/up to 10mbps to test and yes, as soon as I start a speed test, it's capped to 10mbps on Wan (which isn't supposed), but not on wgc2.
 

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