What's new

AutoBW: Automatically set QoS bandwidth using spdMerlin

  • 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!

Hi peepsnet
With your changes the first test is ok, but if I try to repeat it ... strange error:
admin@RT-AC86U-81D8:/tmp/home/root# sh /jffs/scripts/AutoBW

TEST MODE: No changes will be made.

----------- SPDMERLIN --------
Download (Kbps) Upload (Kbps)
--------------- -------------
Test 1 of 2 15155.2 1003.5
Test 2 of 2 15534.1 1003.5
Average 15344.6 1003.5
Scale Factors 0.90 0.90
Scaled Speeds 13810.2 903.2
* Upload speed ( 903.2 Kbps) < lower limit ( 1024.0 Kbps)
Corrected Speeds 13810.2 1024.0

------------- QOS ------------
Download (Kbps) Upload (Kbps)
--------------- -------------
Previous 102400.0 1433600.0
New (from above) 13810.2 1024.0
Scaling by 0.135 0.001

============================ DOWNLOAD =============================
------------- RATE ----------- ------------- CEIL -----------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- --------------- ------------- --------------- -------------
11 20480.0 2762.0 1052000.0 141878.0
10 5120.0 690.5 1052000.0 141878.0
13 5120.0 690.5 1052000.0 141878.0
12 10240.0 1381.0 1052000.0 141878.0
15 3072.0 414.3 1052000.0 141878.0
14 4096.0 552.4 1052000.0 141878.0
17 1024.0 138.1 1052000.0 141878.0
16 2048.0 276.2 1052000.0 141878.0

============================= UPLOAD =============================
------------- RATE ----------- ------------- CEIL -----------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- --------------- ------------- --------------- -------------
11 286720.0 38668.5 1052000.0 141878.0
10 71680.0 9667.1 1052000.0 141878.0
13 71680.0 9667.1 1052000.0 141878.0
12 143360.0 19334.2 1052000.0 141878.0
15 43008.0 5800.3 1052000.0 141878.0
14 57344.0 7733.7 1052000.0 141878.0
17 14336.0 1933.4 1052000.0 141878.0
16 28672.0 3866.8 1052000.0 141878.0

TEST MODE: No changes were made.

admin@RT-AC86U-81D8:/tmp/home/root# sh /jffs/scripts/AutoBW

----------- SPDMERLIN --------
Download (Kbps) Upload (Kbps)
--------------- -------------
Running 1 of 2 speedtest, please wait... tail: can't open '/jffs/addons/spdmerlin.d/csv/Downloaddaily_WAN.htm': No such file or directory
tail: no files
tail: can't open '/jffs/addons/spdmerlin.d/csv/Uploaddaily_WAN.htm': No such file or directory

Now I close the ssh session..... after a new login I try another test, with other errors:
sh /jffs/scripts/AutoBW

TEST MODE: No changes will be made.

----------- SPDMERLIN --------
Download (Kbps) Upload (Kbps)
--------------- -------------
Test 1 of 2 15247.4 1003.5
Test 2 of 2 15288.3 1003.5
Average 15267.8 1003.5
Scale Factors 0.90 0.90
Scaled Speeds 13741.1 903.2
* Upload speed ( 903.2 Kbps) < lower limit ( 1024.0 Kbps)
Corrected Speeds 13741.1 1024.0

------------- QOS ------------
Download (Kbps) Upload (Kbps)
--------------- -------------
Previous 0.0 0.0
New (from above) 13741.1 1024.0
[: bad number
(standard_in) 2: syntax error
[: bad number
(standard_in) 2: syntax error
Scaling by 0.000 0.000

============================ DOWNLOAD =============================
------------- RATE ----------- ------------- CEIL -----------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- --------------- ------------- --------------- -------------
(standard_in) 2: syntax error
(standard_in) 2: syntax error
11 20480.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
10 5120.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
13 5120.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
12 10240.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
15 3072.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
14 4096.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
17 1024.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
16 2048.0 1052000.0 0.0 0.0

============================= UPLOAD =============================
------------- RATE ----------- ------------- CEIL -----------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- --------------- ------------- --------------- -------------
(standard_in) 2: syntax error
(standard_in) 2: syntax error
11 286720.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
10 71680.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
13 71680.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
12 143360.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
15 43008.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
14 57344.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
17 14336.0 1052000.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
16 28672.0 1052000.0 0.0 0.0

TEST MODE: No changes were made.
 
That error is from a "real" speed test running at the same time!!! In my experience
 
Yes, It is possible, but How I can synchronize all ?

Thank for your support
 
update here: https://www.snbforums.com/threads/a...idth-using-spdmerlin.63067/page-4#post-566747

OK OK OK OK.... I wasn't understanding this whole part of the code:
Code:
while read -r line;
    do
        class=$( echo ${line} | sed -n -e 's/.*class htb 1://p' | cut -d' ' -f1 )
        prio=$( echo ${class} | cut -c 2 )

        prevRate=$( echo ${line} | awk -F"rate |Kbit" '{print $2}' )
        prevCeil=$( echo ${line} | awk -F"ceil |Kbit" '{print $3}' )

        Burst=$( echo ${line} | sed -n -e 's/.* burst \([a-zA-Z0-9]*\).*/\1/p' )
        Cburst=$( echo ${line} | sed -n -e 's/.*cburst \([a-zA-Z0-9]*\).*/\1/p' )

        Rate=$(echo "$prevRate*$dscale_factor" | bc -l)
        Ceil=$(echo "$prevCeil*$dscale_factor" | bc -l)

            printf "%2.0f                 %7.1f         %7.1f           %7.1f         %7.1f\n" $class $prevRate $Rate $prevCeil $Ceil
 
            #Debug
            #echo -e "$line\n class=$class\n prio=$prio\n Rate=$Rate\n Ceil=$Ceil\n Burst=$Burst\n Cburst=$Cburst\n"

            #echo -e "tc class change dev br0 parent 1:1 classid 1:${class} htb ${PARMS}prio ${prio} rate ${Rate}Kbit ceil ${Ceil}Kbit burst ${Burst} cburst ${Cburst}"
            if [ "$test_mode" -eq "0" ]; then
            Rate=$(echo $Rate | cut -d. -f1)
            Ceil=$(echo $Ceil | cut -d. -f1)
     
            tc class change dev br0 parent 1:1 classid 1:${class} htb ${PARMS}prio ${prio} rate ${Rate}Kbit ceil ${Ceil}Kbit burst ${Burst} cburst ${Cburst}
     
             fi

    done

turns out I was missing the next lines

Code:
 <<EOF
                $( tc class show dev br0 | grep "parent 1:1 " )
EOF

Now I see it is looking through the lines returned from:
Code:
tc class show dev br0 | grep "parent 1:1 "

With this I now know where the problem is.

The TC command tries to be helpful and gives you the "best" units for each value!! Since my values were > 999Mbps it was nice enough to up it to Mbps from Kbps
Check out the Units section on this website:https://linux.die.net/man/8/tc


UPDATE:

More testing:
Setting the both Bandwidth to 978 returned this:
Code:
 tc class show dev eth0 | grep "parent 1:1"
class htb 1:11 parent 1:1 leaf 11: prio 1 rate 200088Kbit overhead 18 ceil 1Gbit burst 249559b cburst 1249559b
class htb 1:10 parent 1:1 leaf 10: prio 0 rate 50016Kbit overhead 18 ceil 1Gbit burst 62388b cburst 1249559b
class htb 1:13 parent 1:1 leaf 13: prio 3 rate 50016Kbit overhead 18 ceil 1Gbit burst 62388b cburst 1249559b
class htb 1:12 parent 1:1 leaf 12: prio 2 rate 100040Kbit overhead 18 ceil 1Gbit burst 124787b cburst 1249559b
class htb 1:15 parent 1:1 leaf 15: prio 5 rate 30008Kbit overhead 18 ceil 1Gbit burst 36793b cburst 1249559b
class htb 1:14 parent 1:1 leaf 14: prio 4 rate 40016Kbit overhead 18 ceil 1Gbit burst 49594b cburst 1249559b
class htb 1:16 parent 1:1 leaf 16: prio 6 rate 20008Kbit overhead 18 ceil 1Gbit burst 23997b cburst 1249559b

tc class show dev br0 | grep "parent 1:1 "
class htb 1:11 parent 1:1 leaf 11: prio 1 rate 200088Kbit overhead 18 ceil 1Gbit burst 249559b cburst 1249559b
class htb 1:10 parent 1:1 leaf 10: prio 0 rate 50016Kbit overhead 18 ceil 1Gbit burst 62388b cburst 1249559b
class htb 1:13 parent 1:1 leaf 13: prio 3 rate 50016Kbit overhead 18 ceil 1Gbit burst 62388b cburst 1249559b
class htb 1:12 parent 1:1 leaf 12: prio 2 rate 100040Kbit overhead 18 ceil 1Gbit burst 124787b cburst 1249559b
class htb 1:15 parent 1:1 leaf 15: prio 5 rate 30008Kbit overhead 18 ceil 1Gbit burst 36793b cburst 1249559b
class htb 1:14 parent 1:1 leaf 14: prio 4 rate 40016Kbit overhead 18 ceil 1Gbit burst 49594b cburst 1249559b
class htb 1:17 parent 1:1 leaf 17: prio 7 rate 10Mbit overhead 18 ceil 1Gbit burst 11200b cburst 1249559b
class htb 1:16 parent 1:1 leaf 16: prio 6 rate 20008Kbit overhead 18 ceil 1Gbit burst 23997b cburst 1249559b

BUT.......

Setting the valies to 980 returned:
Code:
tc class show dev br0 | grep "parent 1:1 "
class htb 1:11 parent 1:1 leaf 11: prio 1 rate 200704Kbit overhead 18 ceil 1003Mbit burst 249550b cburst 1249382b
class htb 1:10 parent 1:1 leaf 10: prio 0 rate 50176Kbit overhead 18 ceil 1003Mbit burst 62387b cburst 1249382b
class htb 1:13 parent 1:1 leaf 13: prio 3 rate 50176Kbit overhead 18 ceil 1003Mbit burst 62387b cburst 1249382b
class htb 1:12 parent 1:1 leaf 12: prio 2 rate 100352Kbit overhead 18 ceil 1003Mbit burst 124775b cburst 1249382b
class htb 1:15 parent 1:1 leaf 15: prio 5 rate 30104Kbit overhead 18 ceil 1003Mbit burst 36794b cburst 1249382b
class htb 1:14 parent 1:1 leaf 14: prio 4 rate 40136Kbit overhead 18 ceil 1003Mbit burst 49593b cburst 1249382b
class htb 1:17 parent 1:1 leaf 17: prio 7 rate 10032Kbit overhead 18 ceil 1003Mbit burst 11198b cburst 1249382b
class htb 1:16 parent 1:1 leaf 16: prio 6 rate 20064Kbit overhead 18 ceil 1003Mbit burst 23996b cburst 1249382b


tc class show dev eth0 | grep "parent 1:1"
class htb 1:11 parent 1:1 leaf 11: prio 1 rate 200704Kbit overhead 18 ceil 1003Mbit burst 249550b cburst 1249382b
class htb 1:10 parent 1:1 leaf 10: prio 0 rate 50176Kbit overhead 18 ceil 1003Mbit burst 62387b cburst 1249382b
class htb 1:13 parent 1:1 leaf 13: prio 3 rate 50176Kbit overhead 18 ceil 1003Mbit burst 62387b cburst 1249382b
class htb 1:12 parent 1:1 leaf 12: prio 2 rate 100352Kbit overhead 18 ceil 1003Mbit burst 124775b cburst 1249382b
class htb 1:15 parent 1:1 leaf 15: prio 5 rate 30104Kbit overhead 18 ceil 1003Mbit burst 36794b cburst 1249382b
class htb 1:14 parent 1:1 leaf 14: prio 4 rate 40136Kbit overhead 18 ceil 1003Mbit burst 49593b cburst 1249382b
class htb 1:17 parent 1:1 leaf 17: prio 7 rate 10032Kbit overhead 18 ceil 1003Mbit burst 11198b cburst 1249382b
class htb 1:16 parent 1:1 leaf 16: prio 6 rate 20064Kbit overhead 18 ceil 1003Mbit burst 23996b cburst 1249382b

I cannot tell where the Kbit/Mbit/Gbit flip happens. Seems to be random almost.
also
It seems Gbit is a value usable...
So it will have to check for Kbit/Mbit/Gbit
as a unit to calculate the values correctly
 
Last edited:
I hope I have a solution for @squidbilly

This is what I came up with:
Replacing the lines
Code:
       prevRate=$( echo ${line} | awk -F"rate |Kbit" '{print $2}' )
        prevCeil=$( echo ${line} | awk -F"ceil |Kbit" '{print $3}' )

With
Code:
# Using or K or M or G bit. That works for bit/Kbit/Mbit/Gbit
    prevRate=$( echo ${line} | awk -F"rate |K?M?G?bit" '{print $2}' )
    prevCeil=$( echo ${line} | awk -F"ceil |K?M?G?bit" '{print $3}' )

#get the 11th field
    rateUnit=$( echo ${line} | cut -d' ' -f11)

#and pull out all the numbers so all that is left is the letters. That works for bit/Kbit/Mbit/Gbit
    rateUnit=${rateUnit//[0-9]/}

    ceilUnit=$( echo ${line} | cut -d' ' -f15)
    ceilUnit=${ceilUnit//[0-9]/}
 
 
  
        if [ "$rateUnit" = "bit" ]; then
            prevRate=$( echo "$prevRate*0.001" | bc -l)
        fi
        if [ "$rateUnit" = "Mbit" ]; then
            prevRate=$( echo "$prevRate*1000" | bc -l)
        fi
        if [ "$rateUnit" = "Gbit" ]; then
            prevRate=$( echo "$prevRate*1000000" | bc -l)
        fi
      
        if [ "$ceilUnit" = "bit" ]; then
            prevCeil=$( echo "$prevCeil*0.001" | bc -l)
        fi
        if [ "$ceilUnit" = "Mbit" ]; then
            prevCeil=$( echo "$prevCeil*1000" | bc -l)
        fi
        if [ "$ceilUnit" = "Gbit" ]; then
            prevCeil=$( echo "$prevCeil*1000000" | bc -l)
        fi

This is in both the upload and download sections of the code.

There is probable a prettier way to do it but that is what I got to make it work.
I am not 100% on the math.

I am assuming your vaules want to be in Kbit
If bit is found then multiply the found valueof prevRate and prevCeil by 0.001
If Mbit is found then multiply the found valueof prevRate and prevCeil by 1,000
If Gbit is found then multiply the found value of prevRate and prevCeil by 1,000,000

PR on Github
Hope this helps someone!!!
 
Last edited:
I hope I have a solution for @squidbilly

This is what I came up with:
Replacing the lines
Code:
       prevRate=$( echo ${line} | awk -F"rate |Kbit" '{print $2}' )
        prevCeil=$( echo ${line} | awk -F"ceil |Kbit" '{print $3}' )

With
Code:
# Using or K or M or G bit. That works for bit/Kbit/Mbit/Gbit
    prevRate=$( echo ${line} | awk -F"rate |K?M?G?bit" '{print $2}' )
    prevCeil=$( echo ${line} | awk -F"ceil |K?M?G?bit" '{print $3}' )

#get the 11th field
    rateUnit=$( echo ${line} | cut -d' ' -f11)

#and pull out all the numbers so all that is left is the letters. That works for bit/Kbit/Mbit/Gbit
    rateUnit=${rateUnit//[0-9]/}

    ceilUnit=$( echo ${line} | cut -d' ' -f15)
    ceilUnit=${ceilUnit//[0-9]/}
 
 
 
        if [ "$rateUnit" = "bit" ]; then
            prevRate=$( echo "$prevRate*0.001" | bc -l)
        fi
        if [ "$rateUnit" = "Mbit" ]; then
            prevRate=$( echo "$prevRate*1000" | bc -l)
        fi
        if [ "$rateUnit" = "Gbit" ]; then
            prevRate=$( echo "$prevRate*1000000" | bc -l)
        fi
   
        if [ "$ceilUnit" = "bit" ]; then
            prevCeil=$( echo "$prevCeil*0.001" | bc -l)
        fi
        if [ "$ceilUnit" = "Mbit" ]; then
            prevCeil=$( echo "$prevCeil*1000" | bc -l)
        fi
        if [ "$ceilUnit" = "Gbit" ]; then
            prevCeil=$( echo "$prevCeil*1000000" | bc -l)
        fi

This is in both the upload and download sections of the code.

There is probable a prettier way to do it but that is what I got to make it work.
I am not 100% on the math.

I am assuming your vaules want to be in Kbit
If bit is found then multiply the found valueof prevRate and prevCeil by 0.001
If Mbit is found then multiply the found valueof prevRate and prevCeil by 1,000
If Gbit is found then multiply the found value of prevRate and prevCeil by 1,000,000

PR on Github
Hope this helps someone!!!
Thanks for the changes peepsnet. Merged into v1.5
 
Last edited:
nice script, but I am having a hard time grasping the concept, as speed testing on the router does not equal same measures of speed testing from a client or am i doing something wrong?
 
Hi, I installed 1.5 and now I get even more errors, unfortunately. It seems that the script expexts the files
/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC0.htm
and
'/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC0.htm
to be existing. I don't know how to create them (they are not present on my RT-AC88U router)?
Use_VPN -> I didn't change initial config (so parameter is set to '0').

This makes me nervous:
" Something is different about this copy of AutoBW. Just letting you know. :)"
What is wrong?

Error messages:
Code:
 /jffs/scripts/AutoBW
[: Use_VPN: bad number

 AutoUpdate is enabled. Checking for update ...
 Something is different about this copy of AutoBW. Just letting you know. :)
 Based on versioning alone, you have the latest version: v1.5

 TEST MODE: No changes will be made.

               ---------------- SPDMERLIN -------------
                 Download (Kbps)       Upload (Kbps)
               -------------------  -------------------
Running  1 of  2 speedtest, please wait... tail: can't open '/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC0.htm': No such file or directory
tail: no files
tail: can't open '/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC0.htm': No such file or directory
tail: no files
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
Test  1 of  2           0.0                  0.0
Running  2 of  2 speedtest, please wait... tail: can't open '/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC0.htm': No such file or directory
tail: no files
tail: can't open '/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC0.htm': No such file or directory
tail: no files
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Test  2 of  2           0.0                  0.0
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Average                 0.0                  0.0
Scale Factors          0.85                 0.85
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Scaled Speeds           0.0                  0.0
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand

               ----------------- QOS ----------------
                 Download (Kbps)      Upload (Kbps)
               -------------------  -----------------
Previous              48128.0             26624.0
New (from above)          0.0                 0.0
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Scaling by              0.000               0.000

              ====================================== DOWNLOAD ======================================
               ----------------- RATE -----------------    ----------------- CEIL -----------------
Class            Previous (Kbps)        New (Kbps)           Previous (Kbps)         New (Kbps)
-----          -------------------  -------------------    -------------------  -------------------
(standard_in) 1: syntax error
(standard_in) 1: syntax error
 0                        0.0                0.0                       0.0                0.0

              ======================================= UPLOAD =======================================
               ----------------- RATE -----------------    ----------------- CEIL -----------------
Class            Previous (Kbps)        New (Kbps)           Previous (Kbps)         New (Kbps)
-----          -------------------  -------------------    -------------------  -------------------
(standard_in) 1: syntax error
(standard_in) 1: syntax error
 0                        0.0                0.0                       0.0                0.0

 TEST MODE: No changes were made.
 
Hi, I installed 1.5 and now I get even more errors, unfortunately. It seems that the script expexts the files
/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC0.htm
and
'/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC0.htm
to be existing. I don't know how to create them (they are not present on my RT-AC88U router)?
Use_VPN -> I didn't change initial config (so parameter is set to '0').

This makes me nervous:
" Something is different about this copy of AutoBW. Just letting you know. :)"
What is wrong?

Error messages:
Code:
 /jffs/scripts/AutoBW
[: Use_VPN: bad number

 AutoUpdate is enabled. Checking for update ...
 Something is different about this copy of AutoBW. Just letting you know. :)
 Based on versioning alone, you have the latest version: v1.5

 TEST MODE: No changes will be made.

               ---------------- SPDMERLIN -------------
                 Download (Kbps)       Upload (Kbps)
               -------------------  -------------------
Running  1 of  2 speedtest, please wait... tail: can't open '/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC0.htm': No such file or directory
tail: no files
tail: can't open '/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC0.htm': No such file or directory
tail: no files
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
Test  1 of  2           0.0                  0.0
Running  2 of  2 speedtest, please wait... tail: can't open '/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC0.htm': No such file or directory
tail: no files
tail: can't open '/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC0.htm': No such file or directory
tail: no files
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Test  2 of  2           0.0                  0.0
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Average                 0.0                  0.0
Scale Factors          0.85                 0.85
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Scaled Speeds           0.0                  0.0
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand

               ----------------- QOS ----------------
                 Download (Kbps)      Upload (Kbps)
               -------------------  -----------------
Previous              48128.0             26624.0
New (from above)          0.0                 0.0
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Scaling by              0.000               0.000

              ====================================== DOWNLOAD ======================================
               ----------------- RATE -----------------    ----------------- CEIL -----------------
Class            Previous (Kbps)        New (Kbps)           Previous (Kbps)         New (Kbps)
-----          -------------------  -------------------    -------------------  -------------------
(standard_in) 1: syntax error
(standard_in) 1: syntax error
 0                        0.0                0.0                       0.0                0.0

              ======================================= UPLOAD =======================================
               ----------------- RATE -----------------    ----------------- CEIL -----------------
Class            Previous (Kbps)        New (Kbps)           Previous (Kbps)         New (Kbps)
-----          -------------------  -------------------    -------------------  -------------------
(standard_in) 1: syntax error
(standard_in) 1: syntax error
 0                        0.0                0.0                       0.0                0.0

 TEST MODE: No changes were made.
My bad. I committed that part of the code, and I just pushed a derp fixing commit
https://github.com/squidbillyms/AutoBW/pull/6
For now, while the creator doesn't accept the pull request, do
Code:
nano /jffs/scripts/AutoBW
and change the line
Code:
Use_VPN=0
to
Code:
#Use_VPN=0

Regarding the "something is different...", doesn't matter. Autoupdate is off by default (maintainer wants that way), and as you've changed the autoupdate to ON, the md5 hashes are different between yours and the GitHub version, so that message is presented.
No problem
 
@squidbilly @maghuro
V1.4 was fine for me, now with V1.5, ran into errors
.
ASUSWRT-Merlin RT-AC88U 384.16_0 Sun Apr 5 17:35:54 UTC 2020
thunder@RT-AC88U-5940:/tmp/home/root# /jffs/scripts/AutoBW

AutoUpdate is enabled. Checking for update ...
Found new version: this is v1.4 ---> latest version is v1.5.
AutoBW was successfully updated to v1.5. Please run it again.

thunder@RT-AC88U-5940:/tmp/home/root# /jffs/scripts/AutoBW
[: Use_VPN: bad number

TEST MODE: No changes will be made.

---------------- SPDMERLIN -------------
Download (Kbps) Upload (Kbps)
------------------- -------------------
Running 1 of 2 speedtest, please wait... tail: can't open '/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC0.htm': No such file or directory
tail: no files
tail: can't open '/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC0.htm': No such file or directory
tail: no files
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
Test 1 of 2 0.0 0.0
Running 2 of 2 speedtest, please wait... tail: can't open '/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC0.htm': No such file or directory
tail: no files
tail: can't open '/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC0.htm': No such file or directory
tail: no files
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Test 2 of 2 0.0 0.0
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Average 0.0 0.0
Scale Factors 0.85 0.85
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Scaled Speeds 0.0 0.0
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand

----------------- QOS ----------------
Download (Kbps) Upload (Kbps)
------------------- -----------------
Previous 34816.0 36864.0
New (from above) 0.0 0.0
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Scaling by 0.000 0.000

====================================== DOWNLOAD ======================================
----------------- RATE ----------------- ----------------- CEIL -----------------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- ------------------- ------------------- ------------------- -------------------
(standard_in) 2: syntax error
(standard_in) 2: syntax error
11 10444.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
10 1740.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
13 5222.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
12 5222.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
15 1740.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
14 6963.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
17 1740.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
16 1740.0 34816.0 0.0 0.0

======================================= UPLOAD =======================================
----------------- RATE ----------------- ----------------- CEIL -----------------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- ------------------- ------------------- ------------------- -------------------
(standard_in) 2: syntax error
(standard_in) 2: syntax error
11 9216.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
10 1843.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
13 5529.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
12 5529.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
15 1843.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
14 5529.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
17 1843.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
16 5529.0 36864.0 0.0 0.0

TEST MODE: No changes were made.

thunder@RT-AC88U-5940:/tmp/home/root#
 
@squidbilly @maghuro
V1.4 was fine for me, now with V1.5, ran into errors
.
ASUSWRT-Merlin RT-AC88U 384.16_0 Sun Apr 5 17:35:54 UTC 2020
thunder@RT-AC88U-5940:/tmp/home/root# /jffs/scripts/AutoBW

AutoUpdate is enabled. Checking for update ...
Found new version: this is v1.4 ---> latest version is v1.5.
AutoBW was successfully updated to v1.5. Please run it again.

thunder@RT-AC88U-5940:/tmp/home/root# /jffs/scripts/AutoBW
[: Use_VPN: bad number

TEST MODE: No changes will be made.

---------------- SPDMERLIN -------------
Download (Kbps) Upload (Kbps)
------------------- -------------------
Running 1 of 2 speedtest, please wait... tail: can't open '/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC0.htm': No such file or directory
tail: no files
tail: can't open '/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC0.htm': No such file or directory
tail: no files
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
Test 1 of 2 0.0 0.0
Running 2 of 2 speedtest, please wait... tail: can't open '/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC0.htm': No such file or directory
tail: no files
tail: can't open '/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC0.htm': No such file or directory
tail: no files
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Test 2 of 2 0.0 0.0
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Average 0.0 0.0
Scale Factors 0.85 0.85
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Scaled Speeds 0.0 0.0
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand
(standard_in) 1: syntax error
[: 1: unknown operand

----------------- QOS ----------------
Download (Kbps) Upload (Kbps)
------------------- -----------------
Previous 34816.0 36864.0
New (from above) 0.0 0.0
(standard_in) 1: syntax error
(standard_in) 1: syntax error
Scaling by 0.000 0.000

====================================== DOWNLOAD ======================================
----------------- RATE ----------------- ----------------- CEIL -----------------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- ------------------- ------------------- ------------------- -------------------
(standard_in) 2: syntax error
(standard_in) 2: syntax error
11 10444.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
10 1740.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
13 5222.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
12 5222.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
15 1740.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
14 6963.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
17 1740.0 34816.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
16 1740.0 34816.0 0.0 0.0

======================================= UPLOAD =======================================
----------------- RATE ----------------- ----------------- CEIL -----------------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- ------------------- ------------------- ------------------- -------------------
(standard_in) 2: syntax error
(standard_in) 2: syntax error
11 9216.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
10 1843.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
13 5529.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
12 5529.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
15 1843.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
14 5529.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
17 1843.0 36864.0 0.0 0.0
(standard_in) 2: syntax error
(standard_in) 2: syntax error
16 5529.0 36864.0 0.0 0.0

TEST MODE: No changes were made.

thunder@RT-AC88U-5940:/tmp/home/root#
See last answer
 
My bad. I committed that part of the code, and I just pushed a derp fixing commit
https://github.com/squidbillyms/AutoBW/pull/6
For now, while the creator doesn't accept the pull request, do
Code:
nano /jffs/scripts/AutoBW
and change the line
Code:
Use_VPN=0
to
Code:
#Use_VPN=0

Regarding the "something is different...", doesn't matter. Autoupdate is off by default (maintainer wants that way), and as you've changed the autoupdate to ON, the md5 hashes are different between yours and the GitHub version, so that message is presented.
No problem

Still major issues with syntax errors after commenting that line out
 
Still major issues with syntax errors after commenting that line out
Same for me. Still syntax errors.
To solve the VPN-problem as a "quick-fix", I modified the following lines as follows (as I have no VPN; the if-clause seems to be wrong (I'd recommend to check for NULL e.g. by if [-z Use_VPN]; then" insteand of check for value "0" (I am not familiar with bash code)):
Code:
#if [ Use_VPN -eq 0 ]; then
  upload_stats="/jffs/addons/spdmerlin.d/csv/Uploaddaily_WAN.htm"
  download_stats="/jffs/addons/spdmerlin.d/csv/Downloaddaily_WAN.htm"
#else
#  upload_stats="/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC$Use_VPN.htm"
#  download_stats="/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC$Use_VPN.htm"
#fi

Now everything works fine (no more standard_in / syntax errors).
 
Last edited:
Ok, did some additonal testing and this works for me. Anyone using a VPN-config should try it, too, to verify it works with VPN as well.
Code:
#Location of upload/download stats
if [ -z "$Use_VPN" ]; then
  upload_stats="/jffs/addons/spdmerlin.d/csv/Uploaddaily_WAN.htm"
  download_stats="/jffs/addons/spdmerlin.d/csv/Downloaddaily_WAN.htm"
else
  upload_stats="/jffs/addons/spdmerlin.d/csv/Uploaddaily_VPNC$Use_VPN.htm"
  download_stats="/jffs/addons/spdmerlin.d/csv/Downloaddaily_VPNC$Use_VPN.htm"
fi
 

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

Top