squidbilly
Occasional Visitor
Why are you invoking "sh"? Why not just execute "/jffs/scripts/autoqos"? Do you have bash installed?@squidbilly
Something odd when trying to run! Screenshot attached.
Why are you invoking "sh"? Why not just execute "/jffs/scripts/autoqos"? Do you have bash installed?@squidbilly
Something odd when trying to run! Screenshot attached.
Good questions ... I don't know... Teach meWhy are you invoking "sh"? Why not just execute "/jffs/scripts/autoqos"? Do you have bash installed?
Make sure bash and bc (via entware) and spdMerlin are installed ... and just run the script by typing its name.Good questions ... I don't know... Teach me
Yep, both installed via entware.Make sure bash and bc (via entware) and spdMerlin are installed ... and just run the script by typing its name.
admin@RT-AC86U:/tmp/home/root# /jffs/scripts/autoqos
-sh: /jffs/scripts/autoqos: not found
admin@RT-AC86U:/tmp/home/root# ls /jffs/scripts
FreshJR_QOS dnsmasq.postconf firewall-start ntpmerlin scmerlin services-stop www_FreshJR_QoS_Stats.asp
autoqos dnsomatic nat-start post-mount service-event spdmerlin
connmon dnsomatic.bak nsrum pre-mount services-start unmount
Try this then rerun.Yep, both installed via entware.
The output is always the same:
Code:admin@RT-AC86U:/tmp/home/root# /jffs/scripts/autoqos -sh: /jffs/scripts/autoqos: not found admin@RT-AC86U:/tmp/home/root# ls /jffs/scripts FreshJR_QOS dnsmasq.postconf firewall-start ntpmerlin scmerlin services-stop www_FreshJR_QoS_Stats.asp autoqos dnsomatic nat-start post-mount service-event spdmerlin connmon dnsomatic.bak nsrum pre-mount services-start unmount
You can see that it is there...
dos2unix /jffs/scripts/autoqos
Teach me master, what's that magic?!Try this then rerun.
Code:dos2unix /jffs/scripts/autoqos
The script has DOS line endings (CR/LF) instead of UNIX line endings (LF). Common problem when transferring a script from Windows to Linux.Teach me master, what's that magic?!
IT worked!
I hope this helps somebody ... works ok for me. Again, I am not very proficient at coding, just needed something that works for me.
Code:#!/opt/bin/bash ###################################################################### # SET-BW-SPEEDS # Set QoS upload/download speeds using Ookla speedtests and spdMerlin # Requires bash, bc, and spdMerlin ###################################################################### #Make sure speeds (before scaling) are within these boundaries # Mainly just to prevent bandwidth from being set too low # (or too high)... not worried about upper limit but it is there # for the sake of completeness download_lower_limit=10 #Mbps download_upper_limit=50 #Mbps upload_lower_limit=1.0 #Mbps upload_upper_limit=50 #Mbps #Scale average values by this factor #Adjust to optimize bufferbloat and quality grade at DSLreports.com down_scale_factor=0.85 up_scale_factor=0.85 #Do we need to disable QoS to get new QoS bandwidth limits #Maybe not since traffic is from router disable_qos_to_test=0 #Average download and upload speeds over this many # consecutive speedtest runs num_spd_tests=3 #Pause between successive speedtest runs (if num_spd_tests > 1) pause_between_test=0 #If so, pause for how long (will be used with sleep command) pause_this_long=1m #spdMerlin command spdMer_command="/jffs/scripts/spdmerlin generate" #spdMer_command="echo DEBUG: spdMerlin executes now" #Location of upload stats upload_stats="/jffs/addons/spdmerlin.d/csv/Uploaddaily_WAN.htm" #Location of download stats download_stats="/jffs/addons/spdmerlin.d/csv/Downloaddaily_WAN.htm" #Do you wanna to know what is going on if you manually run this script show_me=1 ###################################################################### #Disable QOS to find upload/download speeds if (( $disable_qos_to_test )); then (( $show_me )) && echo "Disabling QoS while performing speedtests ..." nvram set qos_enable=0 nvram commit service restart_qos 1> /dev/null service restart_firewall 1> /dev/null fi #Calculate average download and upload speeds using spdMerlin sum_down=0; sum_up=0; x=1 while [ $x -le $num_spd_tests ] do (( $show_me )) && echo -e "\nRunning spdMerlin test #$x of $num_spd_tests ..." ${spdMer_command} &> /dev/null Mbps_down=$(tail -n1 $download_stats | awk -F ',' '{print $NF}') Mbps_up=$(tail -n1 $upload_stats | awk -F ',' '{print $NF}') sum_down=$(echo $sum_down+$Mbps_down | bc) sum_up=$(echo $sum_up+$Mbps_up | bc) if (( $show_me )); then echo "===== SpeedTest: $x =====" echo Download Speed: $Mbps_down Mbps echo Upload Speed: $Mbps_up Mbps fi x=$(( $x + 1 )) (( $pause_between_test )) && (( $x <= $num_spd_tests )) && echo "Sleeping for $pause_this_long ..." && sleep $pause_this_long done #Calculate the average values Mbps_down=$(echo "scale=3; $sum_down/$num_spd_tests" | bc) Mbps_up=$(echo "scale=3; $sum_up/$num_spd_tests" | bc) if (( $show_me )) && (( $num_spd_tests > 1 )); then echo -e "\n===== Averages: =====" echo Download Speed: $Mbps_down Mbps echo Upload Speed: $Mbps_up Mbps fi #Make sure download and uploads speeds are within defined user-defined limits above if (( `echo "$Mbps_down < $download_lower_limit" | bc` )); then logger " -----> Speedtest avg download speed ($Mbps_down Mbps) was less than lower limit ($download_lower_limit Mbps)" (( $show_me )) && echo "Speedtest avg download speed ($Mbps_down Mbps) was less than lower limit ($download_lower_limit Mbps)" Mbps_down=$download_lower_limit elif (( `echo "$Mbps_down > $download_upper_limit" | bc` )); then logger " -----> Speedtest avg download speed ($Mbps_down Mbps) was greater than upper limit ($download_upper_limit Mbps)" (( $show_me )) && echo "Speedtest avg download speed ($Mbps_down Mbps) was greater than upper limit ($download_upper_limit Mbps)" Mbps_down=$download_upper_limit fi if (( `echo "$Mbps_up < $upload_lower_limit" | bc` )); then logger " -----> Speedtest avg upload speed ($Mbps_up Mbps) was less than lower limit ($upload_lower_limit Mbps)" (( $show_me )) && echo "Speedtest avg upload speed ($Mbps_up Mbps) was less than lower limit ($upload_lower_limit Mbps)" Mbps_up=$upload_lower_limit elif (( `echo "$Mbps_up > $upload_upper_limit" | bc` )); then logger " -----> Speedtest avg upload speed ($Mbps_up Mbps) was greater than upper limit ($upload_upper_limit Mbps)" (( $show_me )) && echo "Speedtest avg upload speed ($Mbps_up Mbps) was greater than upper limit ($upload_upper_limit Mbps)" Mbps_up=$upload_upper_limit fi #Convert to Kbps #Could simplify this but want to know scaled Mbps so that it can be reported Mbps_down=$(echo $Mbps_down*$down_scale_factor | bc) Mbps_up=$(echo $Mbps_up*$up_scale_factor | bc) Kbps_down=$(echo $Mbps_down*1024 | bc) Kbps_up=$(echo $Mbps_up*1024 | bc) #Set Download Limit logger " -----> Setting QoS Download Speed to $Mbps_down Mbps ..." (( $show_me )) && echo -e "\nAfter scaling by $down_scale_factor, setting QoS Download Speed to $Mbps_down Mbps ..." nvram set qos_ibw=$Kbps_down #Set Upload Limit logger " -----> Setting QoS Upload Speed to $Mbps_up Mbps ..." (( $show_me )) && echo "After scaling by $up_scale_factor, setting QoS Upload Speed to $Mbps_up Mbps ..." nvram set qos_obw=$Kbps_up #Re-Enable QoS if it was disabled to perform speedtest if (( $disable_qos_to_test )); then (( $show_me )) && echo "Re-enabling QoS now that speedtest are done ..." nvram set qos_enable=1 fi nvram commit service restart_qos 1> /dev/null service restart_firewall 1> /dev/null (( $show_me )) && echo "Done." exit 0;
I'm trying to install, what numbers do I change/edit within the script? Or does the script does everything automatically? Thanks.@Jack Yaz , consider to put that script/feature on your spdMerlin code, with the proper credits!
It works great.
Do your magic!bash is overkill imo. if i implement it, i will rewrite it using the native shell for busybox
Restarting qos every test is silly. It should hopefully be easier to strip the marking off the traffic.Do your magic!
Just remember, before running any speedtest, QoS must be disabled as it interfere with speeds. I think it shouldn't, but it interferes.
I don't have the knowledge to say that, or how, but if you say please do it...Restarting qos every test is silly. It should hopefully be easier to strip the marking off the traffic.
Where,? And for which model?I just saw the new update for QoS categories is an update, it seem like we need freshjr to come back and update the scripts to accommodate the changes.
Doubt they will be included anytime soon. Freshjr has been MIA for quite some time.Where,? And for which model?
But I'm not understanding... Where did you read that? I don't know nothingDoubt they will be included anytime soon. Freshjr has been MIA for quite some time.
https://www.asus.com/au/Networking/RT-AX88U/HelpDesk_Download/Where,? And for which model?
I just saw the new update for QoS categories is an update, it seem like we need freshjr to come back and update the scripts to accommodate the changes.
I havent been using A. QoS due to the "upload" being broken at this time for the RT-AX88U. Hope its fixed with this new FW.This is good news if it makes QoS work better, but bad news if it "breaks" the esteemed FreshJR QoS tweaks we have come to know and love ...
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!