What's new

[Release] FreshJR Adaptive QOS (Improvements / Custom Rules / and Inner workings)

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

Status
Not open for further replies.
Hey @FreshJR What does this log entry mean after booting up?
Code:
Mar 17 09:53:42 kernel: HTB: quantum of class 10011 is big. Consider r2q change.
 
Hey @FreshJR What does this log entry mean after booting up?
Code:
Mar 17 09:53:42 kernel: HTB: quantum of class 10011 is big. Consider r2q change.

Means the quantum which is set by the tc i think is big. Its just a notification saying its bigger than expected most likly because you have a good high speed internet conn and the tc is outdated and thinks its rediculously high. Those big or small msgs are harmless.
 
Means the quantum which is set by the tc i think is big. Its just a notification saying its bigger than expected most likly because you have a good high speed internet conn and the tc is outdated and thinks its rediculously high. Those big or small msgs are harmless.
Thanks friend for the fast response! Good to hear its of no consequence.
 
avNVGLj.png


Are these priories settings fitting with script? or should I change the order? Also, can somebody confirm please if this arrangements is the the default one? Thanks,
 
Last edited:
avNVGLj.png


Are these priories settings fitting with script? or should I change the order? Also, can somebody confirm please if this arrangements is the the default one? Thanks,

That would depend on your needs. If your traffic you want higher prioity is landing in the top ones then id say your good to go. But.. most of us were experiencing most important traffic was ending in default and Freshs script mainly moves unidentified traffic from default into the "other" container so you can actually move it to where you want if needed. Netcontrol and default arent movable is why we all needed that ability.
 
That would depend on your needs. If your traffic you want higher prioity is landing in the top ones then id say your good to go. But.. most of us were experiencing most important traffic was ending in default and Freshs script mainly moves unidentified traffic from default into the "other" container so you can actually move it to where you want if needed. Netcontrol and default arent movable is why we all needed that ability.
Thank you for your valuable response ! now it is clear

Another questions: will enabling (Statistics under Traffic Analyzer option) effect the QoS process negatively?
 
Thank you for your valuable response ! now it is clear

Another questions: will enabling (Statistics under Traffic Analyzer option) effect the QoS process negatively?

I dont believe so. From what i understand the qos is already doing that in the background anyway which is how it functions. At worst small performance impact being enabled but its a very usefull tool for diagnosing where asus is putting your data. Like in which catagory.
 
copied new files in, tried both enable and install options, but just kept getting:

Had this problem again.... FreshJR wasn't enabling because the fakeTC "mount bind" was not in place again. Well, turned out from last time that the start line wasn't being entered into firewall-start.

Hmmm. Dig dig dig.

OK, figured it out. DOH. Little thing but JR your help text is misleading/wrong really. It is missing the dashes required to run the options.

You tell us:

Code:
These are available commands:

FreshJR_QOS                   check status of script, views help file
FreshJR_QOS enable      starts script, enables autostart on boot
FreshJR_QOS install       starts script, enables autostart on boot
FreshJR_QOS disable     stops script, turns off autostart on boot
FreshJR_QOS uninstall  stops script, turns off autostart on boot, deletes from on disk

Those appear to be literally the arguments (and look at any man / --help output and "-" are usually explicitly indicated...) so I was following the help text and running 'enable' and 'install'... The other thing that wasted my time on it was getting the status report and help text back with no indication of "invalid option" or whatever...

Really you mean:

Code:
These are available commands:

FreshJR_QOS                    check status of script, views help file
FreshJR_QOS -enable      starts script, enables autostart on boot
FreshJR_QOS -install       starts script, enables autostart on boot
FreshJR_QOS -disable     stops script, turns off autostart on boot
FreshJR_QOS -uninstall  stops script, turns off autostart on boot, deletes from on disk

Should also add a line to the *) section to along the lines of if $#>1 then echo "Sorry dumbass, that's not a valid option" or something of that nature.
 
OK, figured it out. DOH. Little thing but JR your help text is misleading/wrong really. It is missing the dashes required to run the options.

Those appear to be literally the arguments (and look at any man / --help output and "-" are usually explicitly indicated...) so I was following the help text and running 'enable' and 'install'... The other thing that wasted my time on it was getting the status report and help text back with no indication of "invalid option" or whatever...

Considering @FreshJR's self confession:

upload_2018-3-19_17-40-14.png


I would say he has written a robust script despite not wishing (like myself) to adhere to the formal 'getopt/getopts' argument convention where short form '-' and alternative /long form '--' prefixes are used.

Really you mean:

Code:
These are available commands:
FreshJR_QOS                    check status of script, views help file
FreshJR_QOS -enable      starts script, enables autostart on boot
FreshJR_QOS -install       starts script, enables autostart on boot
FreshJR_QOS -disable     stops script, turns off autostart on boot
FreshJR_QOS -uninstall  stops script, turns off autostart on boot, deletes from on disk

No he doesn't.

The two hidden '-init' and '--start' directives are not described in the help but do require the alternative long form arg convention '-' prefix. Clearly he could quickly validate all invalid options in two lines of code by invoking the 'getopt' utility to force use of the long form directives but this minor shell scripting oversight can be forgiven by his truly exceptionally technically complex script.
 
Errrr um OK.

No he doesn't.

Well. Yes, yes he does. But before we get to that.

Seems like you're all sensie and defensive on JR's part. I didn't criticize him, just pointing out his help text explicitly displays no option dash when it is for sure required by his code. I've been super friendly here. I just am pointing out what is 1. really a typo in the help text and 2. a suggestion for a super mini comment tweak in the default case section that he already has in the form of one or two lines.

I'm sure he's not offended by either of these suggestions, and doesn't need to be and as he well shouldn't be as they were offered in friendly and cheerful manner... Like with most script authors/threads around, he generally seems super cool about getting feedback like this and usually say "cool! thanks for pointing that out!" or at worst, "OK thanks for the input but I have reasons for this so I'm gonna leave as is because ____" So. No need to be so defensive on his part I don't think. If he doesn't like my suggestion no problem at all! Just trying to help and share...

Now. On to your misunderstanding.

Slow down for a second and process what I'm saying:

If you type
FreshJR_QOS enable
or
FreshJR_QOS disable
or
FreshJR_QOS install
etc.
etc.​

The script will do nothing. Well nothing, except fall through to the *) case and print the help and status, and then exit. End of story.

The "-" is required.

For all options.

Example... snip snip...

'-install'|'-enable') ## INSTALLS AND TURNS ON SCRIPT
if [ "$(nvram get qos_enable)" = "1" ] ; then
....etc.

I could give two hootsa bout 'formal getopts etc.' and not trying to say he should use those or long form or anything else so you're barking up the wrong tree there... It'd be fine with me if he wants to instead pull the "-" out of the case statement and leave the help alone... its just misleading to get the help statement that doesn't mention the "-".
 
Errrr um OK.

The script will do nothing.

The "-" is required.

For all options.

Still beg to differ...this is what happens with the '-'

Code:
 ./FreshJR_QOS   -install

These are available commands:
FreshJR_QOS            check status of script, views help file
FreshJR_QOS enable     starts script, enables autostart on boot
FreshJR_QOS install    starts script, enables autostart on boot
FreshJR_QOS disable    stops script, turns off autostart on boot
FreshJR_QOS uninstall  stops script, turns off autostart on boot, deletes from on disk

 QOS System is left in a glitched state, please reboot router

 (Adaptive QOS is turned OFF in router UI)

now without the '-'
Code:
./FreshJR_QOS   install

Placing FreshJR_QOS entry into firewall-start
grep: /jffs/scripts/int-start: No such file or directory
Placing FreshJR_QOS entry into init-start
 FreshJR QOS was successfully installed

 (Adaptive QOS is turned OFF in router UI)

NOTE: I explicitly do not have init-start so the error is expected.
 
hi.
i just installed the compatible version and im getting the following messages after it runs. are they OK?

Code:
Mar 19 00:00:08 custom_script: Running /jffs/scripts/firewall-start (args: eth0)
Mar 19 00:00:09 adaptive QOS: Delayed Start Cancelled
Mar 19 00:00:09 adaptive QOS: Delayed Start Triggered (5min)
Mar 19 00:00:19 syslogd started: BusyBox v1.25.1
Mar 19 00:00:19 kernel: klogd started: BusyBox v1.25.1 (2018-03-15 16:14:50 EDT)
Mar 19 00:00:20 dropbear[22422]: Running in background
Mar 19 00:00:20 nat: apply nat rules (/tmp/nat_rules_eth0_eth0)
Mar 19 00:00:21 custom_script: Running /jffs/scripts/firewall-start (args: eth0)
Mar 19 00:00:22 hour_monitor: daemon is starting
Mar 19 00:00:22 adaptive QOS: Delayed Start Cancelled
Mar 19 00:00:22 adaptive QOS: Delayed Start Triggered (5min)
Mar 19 00:00:34 kernel: ERR[parse_qos_conf:932] Can't set new QoS conf while QoS is started!
Mar 19 00:00:34 kernel: ERR[ioctl_iqos_op_config:3592] parse qos_conf error!!
Mar 19 00:00:34 kernel: ioctl_iqos_op_config() fail!
Mar 19 00:00:34 kernel: ERR[qos_start:3344] QoS is already started!
Mar 19 00:00:34 kernel: ioctl_iqos_op_switch(1) fail!
Mar 19 00:00:37 kernel: ERR[parse_qos_conf:932] Can't set new QoS conf while QoS is started!
Mar 19 00:00:37 kernel: ERR[ioctl_iqos_op_config:3592] parse qos_conf error!!
Mar 19 00:00:37 kernel: ioctl_iqos_op_config() fail!
Mar 19 00:00:37 kernel: ERR[qos_start:3344] QoS is already started!
Mar 19 00:00:37 kernel: ioctl_iqos_op_switch(1) fail!
Mar 19 00:00:42 rc_service: udhcpc 22259:notify_rc start_firewall
Mar 19 00:00:43 nat: apply nat rules (/tmp/nat_rules_eth0_eth0)
Mar 19 00:00:44 custom_script: Running /jffs/scripts/firewall-start (args: eth0)
Mar 19 00:00:45 adaptive QOS: Delayed Start Cancelled
Mar 19 00:00:45 adaptive QOS: Delayed Start Triggered (5min)
Mar 19 00:01:10 kernel: htb: htb qdisc 12: is non-work-conserving?
Mar 19 00:01:33 kernel: htb: htb qdisc 12: is non-work-conserving?
Mar 19 00:04:52 kernel: htb: htb qdisc 14: is non-work-conserving?
Mar 19 00:05:50 adaptive QOS: Applying - Down Rules
Mar 19 00:05:50 adaptive QOS: Applying --- Up Rules
Mar 19 00:05:50 adaptive QOS: Modifying Class Rates
 
I see there's a little confusion going on.

In the beta all arguments DIDNT use the "-" prefix.

I decided I didn't like that so going forward all arguments now require the "-" prefix.

This was introduced starting starting with the front page releases (All beta's used non "-" prefix commands). I did update the install instructions to match.

I also updated the "help" statement to match, but looking back the changes are only present in the "compatible" version. The changes got lost in the "fast" versoin.
 
Last edited:
Still beg to differ...this is what happens with the '-'

Well! That's explicitly the opposite of what happens on my system. Maybe a busybox thing. Stand-by.
 
I see there's a little confusion going on.

In the beta all arguments DIDNT use the "-" prefix.

I decided I didn't like that so going forward all arguments now require the "-" prefix.

This was introduced starting starting with the front page releases (All beta's used non "-" prefix commands). I did update the install instructions to match.

I also updated the "help" statement to match, but looking back the changes are only present in the "compatible" version. The changes got lost in the "fast" versoin.

Groovy! All is explained! Glad I saw that before digging further...
 
I see there's a little confusion going on.

In the beta all arguments DIDNT use the "-" prefix.

I decided I didn't like that so going forward all arguments now require the "-" prefix.

This was change was started during the front page releases. I did update the install instructions to match.

I also updated the "help" statement to match, but looking back the changes are only present in the "compatible" version. The changes got lost in the "fast" versoin.

Ahh..:eek:

Perhaps you should add one line to your script (before the case statement) to automagically validate your expected args... :D
Code:
CMDLINE=$(getopt -s sh -n $0 -l init,start,install,uninstall,disable,custom_down_rules,custom_up_rules,rule22_up,rule22_down,custom_up_rules,rule23_up,rule23_down -a -o h -- "$@") && echo -en $cRESET || { echo -e ${cBRED}$aBLINK}"\a\n\tDumbAss invalid option!\n"; exit 1; }

e.g. then try....
Code:
./FreshJRQOS   -muppet

./FreshJRQOS   --muppet

or

Code:
./FreshJRQOS   --install

or

Code:
./FreshJRQOS   -install

etc.

P.S. To do 'getopt' arg validation properly you will need to use the 'shift' command in a case statement loop.;)
 
Last edited:

I kept typing in the wrong commands during initial testingo_O, so I decided they need "-" prefixes to follow the same syntax of every other shell command.

--

@andresmorago

Yes everything ran successfully.

Code:
Mar 19 00:00:09 adaptive QOS: Delayed Start Cancelled
Mar 19 00:00:09 adaptive QOS: Delayed Start Triggered (5min)
Mar 19 00:00:22 adaptive QOS: Delayed Start Cancelled
Mar 19 00:00:22 adaptive QOS: Delayed Start Triggered (5min)
Mar 19 00:00:45 adaptive QOS: Delayed Start Cancelled
Mar 19 00:00:45 adaptive QOS: Delayed Start Triggered (5min)
Mar 19 00:05:50 adaptive QOS: Applying - Down Rules
Mar 19 00:05:50 adaptive QOS: Applying --- Up Rules
Mar 19 00:05:50 adaptive QOS: Modifying Class Rates

The script was triggered a few times, but it only ran ONCE as intended.


These message were NOT caused by the script

Code:
Mar 19 00:00:34 kernel: ERR[parse_qos_conf:932] Can't set new QoS conf while QoS is started!
Mar 19 00:00:34 kernel: ERR[ioctl_iqos_op_config:3592] parse qos_conf error!!
Mar 19 00:00:34 kernel: ioctl_iqos_op_config() fail!
Mar 19 00:00:34 kernel: ERR[qos_start:3344] QoS is already started!
Mar 19 00:00:34 kernel: ioctl_iqos_op_switch(1) fail!
Mar 19 00:00:37 kernel: ERR[parse_qos_conf:932] Can't set new QoS conf while QoS is started!
Mar 19 00:00:37 kernel: ERR[ioctl_iqos_op_config:3592] parse qos_conf error!!
Mar 19 00:00:37 kernel: ioctl_iqos_op_config() fail!
Mar 19 00:00:37 kernel: ERR[qos_start:3344] QoS is already started!
Mar 19 00:00:37 kernel: ioctl_iqos_op_switch(1) fail!

It is just something that appears with ASUS's recent QOS checks.
The fast/experimental version has hacky workarounds to limit the occurrence of this message.
The compatible version does NOT as it is supposed to be really hands off from the deeper workings.

The message itself is not harmful.
 
Last edited:
Minor Update to fast version (V382 -> v384).
-syntax spelling within help command fixed
-comments within "user_variables" updated
-warning message introduced after receiving an improper argument
-backported compatibility improvements introduced in compat_v369 into fast version (The fast version should now, in theory, work with v380.69 -- this hasn't been tested).
-debug command introduced (will be useful if script breaks with a new FW releases)

Note: If updating then keep in mind that both FreshJR_QOS && fakeTC have to be updated!! (You cannot just update half the script).

Nothing has really changed in this release. If you already have the script installed, you can skip this update.

Kind of kicking myself in the head, since both the spelling errors & comment changes WERE noticed and adjusted before front post release! It seems at one point these changes got overwritten by an improper save and sneaked into the front page release.

--

Thx @Martineau for the "getopts" example for proper argument parsing .

I did not implement it with this update since I pass main program variables into scripts sub functions via a fixed position. I really did not want to have to perform retesting from argument parsing changes.

Instead, I simply trimmed any "-" characters present in the first argument so install, -install, --install should all work!

"getops" is slight overkill since I do not have multi-arguments compared to something professional like grep that extensively uses them, but thanks for the example.

I copied it into my personal syntax quick reference && best practices file, if I ever am tasked with making something again!

--

@vibroverbus

Introduced a warning message for improper command arguments.
 
Last edited:
Status
Not open for further replies.

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