Code:opkg install bc
opkg install bc
opkg install nano
curl "https://raw.githubusercontent.com/squidbillyms/AutoBW/master/AutoBW" -o /jffs/scripts/AutoBW && chmod 755 /jffs/scripts/AutoBW && sh /jffs/scripts/AutoBW
nano /jffs/scripts/AutoBW
/jffs/scripts/AutoBW
Type:I still do not know since I am a novice, I will leave it for later to see if the installation becomes easier as what is introduced in amtm. Thanks anyway for the explanation.
@squidbilly @maghuro@squidbilly @maghuro
After what time interval it should scale bandwidth again? Let's suppose It was set initially at 6 am, now when should it set again?
Here is complete step by step guide
After it's run compete, go to device webui and see your download and upload bandwidth set by AutoBW
That's exactly i asked auther that either it will repeat the settings after desired time interval, so as many people have changing bandwidth in peak hours or so, didn't get the reply yet , I'll update once i get a replyIs that all it does!!!! LOL ok I get it now!!
It sets based on real tested Bandwidth and not claimed bandwidth.
@immi803
Is the idea of this script to run this with a cron(once a day, every 12 hours, or what?) to more accurately reflect your "realtime BandWidth" and set that value so all the other percentages from that are better calculated??
or
Just a onetime thing to set the values
or
Both
Here is complete step by step guide
1. You have entware installed
2. You've working AMTM
3. You should have SpdMerlin installed
SSH device, DON'T GO TO AMTM
install bc if you don't have it already by command
And install nano by codeCode:opkg install bc
Code:opkg install nano
Once nano is installed, install AutoBW by code
Code:curl "https://raw.githubusercontent.com/squidbillyms/AutoBW/master/AutoBW" -o /jffs/scripts/AutoBW && chmod 755 /jffs/scripts/AutoBW && sh /jffs/scripts/AutoBW
Now input code
Code:nano /jffs/scripts/AutoBW
You can edit options
1. Make permanent changes(otherwise it won't affect anything)
2. Scale parameters
3. Number of times Spdmerlin take speed tests (so it make an average of your true bandwidth
Save file in nano
After saving file, make sure you are in manual mode in asus merlin webui, not in automatic bandwidth
Now run AutoBW again by code in SSH
Code:/jffs/scripts/AutoBW
After it's run compete, go to device webui and see your download and upload bandwidth set by AutoBW
Happy
Well:That's exactly i asked auther that either it will repeat the settings after desired time interval, so as many people have changing bandwidth in peak hours or so, didn't get the reply yet , I'll update once i get a reply
Technically, Auto means it should repeat by set interval to repeat again, i don't know that interval yet, mine was set more than 12 hours and it didn't repeat yet, looking at logs every 3 hours but it is not resetting again
Let's wait for reply from author
cru l
I have already done it and it continues to fail.type "opkg install bc"
esto instalará el 'bc' que falta
I have already done it and it continues to fail.
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)
class htb 1:17 parent 1:1 leaf 17: prio 6 rate 52633Kbit overhead 18 ceil 1052Mbit burst 12789b cburst 1249258b
if $line contains "rate blablabla Kbit" then
prevRate=$( echo ${line} | awk -F"rate |Kbit" '{print $2}' )
scale=Kbit
elseif $line contains "rate blablabla Mbit" then
prevRate=$( echo ${line} | awk -F"rate |Mbit" '{print $2}' )
scale=Mbit
else
prefRate = 0 and Throw an error(something like that)
prevCeil=$( echo ${line} | awk -F"ceil |Kbit" '{print $3}' )
Burst=$(echo $Burst | sed 's/[^0-9]*//g')
Cburst=$(echo $Cburst | sed 's/[^0-9]*//g')
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}' )
prevCeil=1052000
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' )
Burst=$(echo $Burst | sed 's/[^0-9]*//g')
Cburst=$(echo $Cburst | sed 's/[^0-9]*//g')
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"
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
----------- SPDMERLIN --------
Download (Kbps) Upload (Kbps)
--------------- -------------
Test 1 of 2 446279.7 37836.8
Test 2 of 2 433377.3 37939.2
Average 439828.5 37888.0
Scale Factors 0.85 0.85
Scaled Speeds 373854.2 32204.8
------------- QOS ------------
Download (Kbps) Upload (Kbps)
--------------- -------------
Previous 1052672.0 40960.0
New (from above) 373854.2 32204.8
Scaling by 0.355 0.786
============================ DOWNLOAD =============================
------------- RATE ----------- ------------- CEIL -----------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- --------------- ------------- --------------- -------------
11 157900.0 56077.8 1052.0 373.6
10 52633.0 18692.5 1052.0 373.6
13 315801.0 112156.0 1052.0 373.6
12 105267.0 37385.3 1052.0 373.6
15 52633.0 18692.5 1052.0 373.6
14 105267.0 37385.3 1052.0 373.6
17 52633.0 18692.5 1052.0 373.6
16 210534.0 74770.7 1052.0 373.6
============================= UPLOAD =============================
------------- RATE ----------- ------------- CEIL -----------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- --------------- ------------- --------------- -------------
11 6144.0 4830.7 40960.0 32204.8
10 2048.0 1610.2 40960.0 32204.8
13 4096.0 3220.5 40960.0 32204.8
12 4096.0 3220.5 40960.0 32204.8
15 2048.0 1610.2 40960.0 32204.8
14 12288.0 9661.4 40960.0 32204.8
17 2048.0 1610.2 40960.0 32204.8
16 8192.0 6441.0 40960.0 32204.8
TEST MODE: No changes were made.
xxxxxxx@router:/jffs/scripts# sh /jffs/scripts/AutoBW
AutoUpdate is enabled. Checking for update ...
(23) Failed writing body
Something is different about this copy of AutoBW. Just letting you know. :)
Based on versioning alone, you have the latest version: v1.4
TEST MODE: No changes will be made.
----------- SPDMERLIN --------
Download (Kbps) Upload (Kbps)
--------------- -------------
Running 1 of 1 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
This error seems to be from anybody with GIGabit internet!!!Hi
Same error on the test found by others : sh /jffs/scripts/AutoBW
TEST MODE: No changes will be made.
----------- SPDMERLIN --------
Download (Kbps) Upload (Kbps)
--------------- -------------
Test 1 of 2 14991.4 901.1
Test 2 of 2 15155.2 921.6
Average 15073.3 911.4
Scale Factors 0.85 0.85
Scaled Speeds 12812.3 774.7
* Upload speed ( 774.7 Kbps) < lower limit ( 1024.0 Kbps)
Corrected Speeds 12812.3 1024.0
------------- QOS ------------
Download (Kbps) Upload (Kbps)
--------------- -------------
Previous 0.0 0.0
New (from above) 12812.3 1024.0
Scaling by 1.000 1.000
============================ DOWNLOAD =============================
------------- RATE ----------- ------------- CEIL -----------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- --------------- ------------- --------------- -------------
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
11 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'ceil'
0.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '1249348b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
10 524288.0 524288.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '654311b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
13 524288.0 524288.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '654311b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
12 printf: invalid number '1048Mbit'
0.0 printf: invalid number 'ceil'
0.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '1249378b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
15 314568.0 314568.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '391951b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
14 419424.0 419424.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '523126b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
17 104856.0 104856.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '129575b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
16 209712.0 209712.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '260750b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
============================= UPLOAD =============================
------------- RATE ----------- ------------- CEIL -----------
Class Previous (Kbps) New (Kbps) Previous (Kbps) New (Kbps)
----- --------------- ------------- --------------- -------------
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
11 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'ceil'
0.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '1249348b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
10 524288.0 524288.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '654311b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
13 524288.0 524288.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '654311b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
12 printf: invalid number '1048Mbit'
0.0 printf: invalid number 'ceil'
0.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '1249378b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
15 314568.0 314568.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '391951b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
14 419424.0 419424.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '523126b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
17 104856.0 104856.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '129575b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
(standard_in) 1: illegal character: M
(standard_in) 1: syntax error
16 209712.0 209712.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '260750b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
0.0 0.0 0.0
TEST MODE: No changes were made.
Thanks
Well...Hi
my line is an ADSL+ (20mb in download and 1mb il upload).
12 printf: invalid number '1048Mbit'
0.0 printf: invalid number 'ceil'
0.0 printf: invalid number '1895Mbit'
0.0 printf: invalid number 'burst'
0.0
printf: invalid number '1249378b'
0 printf: invalid number 'cburst'
0.0 printf: invalid number '1249348b'
Getting a bit further with my experimenting.Hi
my line is an ADSL+ (20mb in download and 1mb il upload).
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!