immi803
Senior Member
Looks your bc is installed, so is entwareI have already done it and it continues to fail.
Time for a good reboot and try to install AutoBW
Looks your bc is installed, so is entwareI have already done it and it continues to fail.
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
<<EOF
$( tc class show dev br0 | grep "parent 1:1 " )
EOF
tc class show dev br0 | grep "parent 1:1 "
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
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
Ok, I will prove that it happens.Looks your bc is installed, so is entware
Time for a good reboot and try to install AutoBW
I believe it goes off what spdmerlin uses..speedtestAny reason speedtest and not dslreports?
prevRate=$( echo ${line} | awk -F"rate |Kbit" '{print $2}' )
prevCeil=$( echo ${line} | awk -F"ceil |Kbit" '{print $3}' )
# 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
I have installed entware from 0 and now it works correctly. Installation no longer fails me, thanks for the help.Looks your bc is installed, so is entware
Time for a good reboot and try to install AutoBW
Thanks for the changes peepsnet. Merged into v1.5I 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!!!
/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 commitHi, 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.
nano /jffs/scripts/AutoBW
Use_VPN=0
#Use_VPN=0
See last answer@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#
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
and change the lineCode:nano /jffs/scripts/AutoBW
toCode:Use_VPN=0
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
Same for me. Still syntax errors.Still major issues with syntax errors after commenting that line out
#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
#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
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!