What's new

CakeQOS CakeQOS-Merlin

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

Version 1.0.0 launched!!
Please uninstall current version FIRST and then install v1.0.0 with:

Code:
mkdir -p /jffs/addons/cake-qos && /usr/sbin/curl -s "https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/master/cake-qos.sh" -o "/jffs/addons/cake-qos/cake-qos" && chmod 755 /jffs/addons/cake-qos/cake-qos && sh /jffs/addons/cake-qos/cake-qos install
Ok, did that, but I get package install errors on libnl-tiny

Code:
Installing tc-adv (4.16.0-git-20191110) to root...
Installing libnl-tiny (2019-10-29-0219008c-1) to root...
Downloading http://bin.entware.net/aarch64-k3.10/libnl-tiny_2019-10-29-0219008c-1_aarch64-3.10.ipk
Collected errors:
 * opkg_install_pkg: Package size mismatch: libnl-tiny is 18666 bytes, expecting 18679 bytes
 * opkg_install_cmd: Cannot install package tc-adv.

What's going on there?
 
Version 1.0.0 launched!!
Please uninstall current version FIRST and then install v1.0.0 with:
THANK YOU for all the hard work of a great team. It's incredible to watch as a bystander.

Just one quick note which may not cause an issue - when I uninstalled v0.1.0 using "cake-qos uninstall" it left the services-stop entry to stop cake-qos.

Right, onwards to install v1.0.0 now :D
 
My sincere opinion: I have always been suspicious of QoS solutions, whether by software or hardware. Old dragon technologies. I usually value kernel optimizations. To my surprise, Cake-QOS behaved excellently. It is not surprising, it is a Bufferbloat project. It promises a lot.
 
Oh wait.

Code:
opkg update
:oops:
Still a trap for others perhaps!

Thanks, pushed a hotfix for those with outdated entware package lists.
 
Awesome chaps - just need to OP to update the 1st post in this thread. @ttgapers
:D.
 
Install went without a problem - many thanks again.

I have one minor feature request - could we get more detailed status information added to the menus as extra options. I'm thinking the
Code:
tc qdisc
tc qdisc show | grep root
tc -s qdisc show dev eth0 # for upload
tc -s qdisc show dev ifb9eth0 # for download

Commands from the GitHub page
 
Excellent update! Nice work!:)
 
I am still doubtful the effectiveness of Cake. According to https://www.bufferbloat.net/projects/codel/wiki/CakeTechnical/ the article state for differserv*:
"Most traffic falls into the Best Effort class. VoIP, NTP and gaming traffic should be directed to the Voice class, BitTorrent should be directed to the Bulk class, and the Video class is available for any bulk traffic that requires elevated priority."

I have only had seen a few bytes here and there going to Voice and 99.9% has all been going through Best Effort. While we have kids constantly on the Xbox gaming+chatting in game, in-laws streaming from my Plex Server(they are off-site) and gazillion bittorrent traffic. So far, it looks great for controlling bufferbloating, but it hasn't don't much traffic shaping.
 
Last edited:
Version 1.0.0 launched!!
Please uninstall current version FIRST and then install v1.0.0 with:

Code:
mkdir -p /jffs/addons/cake-qos && /usr/sbin/curl -s "https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/master/cake-qos.sh" -o "/jffs/addons/cake-qos/cake-qos" && chmod 755 /jffs/addons/cake-qos/cake-qos && sh /jffs/addons/cake-qos/cake-qos install

Changelog:

It would be so much extensive to write everything, so the only possible changelog is...
Script completely reworked. Thanks masters @Jack Yaz and @Adamm for their MARVELOUS work!


The install script is pretty straight-forward, so after running the above code, you only have to follow the instructions.

Then, to access menu, use cake-qos to enter menu. Everything's there.

Rest assured this have been tested. However, some bugs may exist, so please feel free to use the issue tracker on github or report it here.
This is being a pleasure, as a newbie "guy which throws some code lines" and a still-learning github guy, to see this script being developed by such a great team. Let's call it the "Diabetes team" :p

Just one note: this isn't meant to make competition with FreshJR, FlexQoS. I personally don't like it and I don't want it to.
This is meant to be an alternative (more alternatives, better!). In fact, cake support is very limited for now (only two HND models), so I still call this an alpha thingy.

Feel free to use, test and abuse :)

After uninstalling cake and attempting to install v1.0.0 I get error:
CakeQOS-Merlin - v1.0.0: Cake binaries missing - Exiting

I uninstalled/reinstalled but get same result. Here's script debug output:
Code:
# mkdir -p /jffs/addons/cake-qos && /usr/sbin/curl -s "https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/master/cake-qos.sh" -
o "/jffs/addons/cake-qos/cake-qos" && chmod 755 /jffs/addons/cake-qos/cake-qos && sh -x /jffs/addons/cake-qos/cake-qos install
+ readonly SCRIPT_VERSION=v1.0.0
+ readonly SCRIPT_NAME=cake-qos
+ readonly SCRIPT_NAME_FANCY=CakeQOS-Merlin
+ readonly SCRIPT_BRANCH=master
+ readonly SCRIPT_DIR=/jffs/addons/cake-qos
+ readonly SCRIPT_CFG=/jffs/addons/cake-qos/cake-qos.cfg
+ readonly CRIT=\e[41m
+ readonly ERR=\e[31m
+ readonly WARN=\e[33m
+ readonly PASS=\e[32m
+ nvram get odmpid
+ [ -z  ]
+ nvram get productid
+ RMODEL=RT-AC86U
+ [ -f /jffs/addons/cake-qos/cake-qos.cfg ]
+ [ -z install ]
+ [ -n  ]
+ nvram get jffs2_scripts
+ [ 1 != 1 ]
+ cake_download
+ [ ! -L /opt/bin/cake-qos ]
+ rm -rf /opt/bin/cake-qos
+ ln -s /jffs/addons/cake-qos/cake-qos /opt/bin/cake-qos
+ /usr/sbin/curl -fsL --retry 3 --connect-timeout 3 https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/master/versions.txt
+ VERSIONS_ONLINE=
+ [ -n  ]
+ [  = update ]
+ [ -z  ]
+ true
+ echo

+ echo Please enter your download speed:
Please enter your download speed:
+ printf [Mbit]:
[Mbit]: + read -r dlspeed
95
+ echo

+ Validate_Bandwidth 95
+ echo 95
+ /bin/grep -oq ^[1-9][0-9]*\.\?[0-9]*$
+ return 0
+ break
+ [ -z  ]
+ true
+ echo

+ echo Please enter your upload speed:
Please enter your upload speed:
+ printf [Mbit]:
[Mbit]: + read -r upspeed
8.5
+ echo

+ Validate_Bandwidth 8.5
+ echo+ /bin/grep -oq ^[1-9][0-9]*\.\?[0-9]*$
 8.5
+ return 0
+ break
+ [ -z  ]
+ true
+ echo

+ echo Select Queue Prioity Type:
Select Queue Prioity Type:
+ echo [1]  --> besteffort (default)
[1]  --> besteffort (default)
+ echo [2]  --> diffserv3
[2]  --> diffserv3
+ echo [3]  --> diffserv4
[3]  --> diffserv4
+ echo [4]  --> diffserv8
[4]  --> diffserv8
+ echo

+ printf [1-4]:
[1-4]: + read -r menu3
1
+ echo

+ queueprio=besteffort
+ break
+ [ -z  ]
+ echo

+ echo Please enter your extra options:
Please enter your extra options:
+ printf [Options]:
[Options]: + read -r extraoptions
docsis ack-filter
+ echo

+ Write_Config
+ printf %s\n ##############################################
+ printf %s\n ## Generated By Cake - Do Not Manually Edit ##
+ date +%b %d %T
+ printf %-43s %s\n ## Jun 25 13:52:54 ##
+ printf %s\n\n ##############################################
+ printf %s\n ## Installer ##
+ printf %s="%s"\n dlspeed 95
+ printf %s="%s"\n upspeed 8.5
+ printf %s="%s"\n queueprio besteffort
+ printf %s="%s"\n extraoptions docsis ack-filter
+ printf \n%s\n ##############################################
+ cake_start
+ [ -z 95 ]
+ [ -z 8.5 ]
+ [ -z besteffort ]
+ rm -rf /jffs/addons/cake-qos.d
+ sed -i \~# cake-qos~d /jffs/scripts/firewall-start /jffs/scripts/services-start
+ [ ! -f /jffs/scripts/nat-start ]
+ [ -f /jffs/scripts/nat-start ]
+ head+ grep -qE ^#!/bin/sh
 -1 /jffs/scripts/nat-start
+ grep -qF /jffs/addons/cake-qos/cake-qos start & # CakeQOS-Merlin /jffs/scripts/nat-start
+ sed -i \~# CakeQOS-Merlin~d /jffs/scripts/nat-start
+ echo /jffs/addons/cake-qos/cake-qos start & # CakeQOS-Merlin
+ chmod 0755 /jffs/scripts/nat-start
+ [ ! -f /jffs/scripts/services-stop ]
+ [ -f /jffs/scripts/services-stop ]
+ head -1 /jffs/scripts/services-stop
+ grep -qE ^#!/bin/sh
+ grep -qF # CakeQOS-Merlin /jffs/scripts/services-stop
+ echo /jffs/addons/cake-qos/cake-qos stop # CakeQOS-Merlin
+ chmod 0755 /jffs/scripts/services-stop
+ nvram get qos_enable
+ [ 0 = 1 ]
+ entwaretimer=0
+ [ ! -f /opt/bin/sh ]
+ [ 0 -ge 100 ]
+ cake_stop
+ cake_check
+ tc+ grep -E ^qdisc cake .* dev eth0 root
 qdisc
+ STATUS_UPLOAD=
+ tc+ grep -E ^qdisc cake .* dev ifb9eth0 root
 qdisc
+ STATUS_DOWNLOAD=
+ [ -n  ]
+ return 1
+ [ ! -f /opt/lib/modules/sch_cake.ko ]
+ Print_Output true Cake binaries missing - Exiting \e[41m
+ [ true = true ]
+ logger -t CakeQOS-Merlin Cake binaries missing - Exiting
+ printf \e[1m\e[41m%s: Cake binaries missing - Exiting\e[0m\n CakeQOS-Merlin - v1.0.0
CakeQOS-Merlin - v1.0.0: Cake binaries missing - Exiting
+ exit 1

Any suggestions/ideas why it's failing?
 
/opt/lib/modules/sch_cake.ko is missing as per;

Code:
+ [ ! -f /opt/lib/modules/sch_cake.ko ]
+ Print_Output true Cake binaries missing - Exiting \e[41m

It may have not installed correctly or it could be an entware thing, try run the uninstall command followed once again by the install procedure.
 
/opt/lib/modules/sch_cake.ko is missing as per;

Code:
+ [ ! -f /opt/lib/modules/sch_cake.ko ]
+ Print_Output true Cake binaries missing - Exiting \e[41m

It may have not installed correctly or it could be an entware thing, try run the uninstall command followed once again by the install procedure.

yep, that was the first thing I tried. Is the script downloading and installing ipk files from ttgapers github, or is this part doing something else?
Code:
FILE1="sched-cake-oot_${VERSION_ONLINE_CAKE}-${FILE1_TYPE}_${VERSION_ONLINE_SUFFIX}.ipk"
                        FILE2="tc-adv_${VERSION_ONLINE_TC}_${VERSION_ONLINE_SUFFIX}.ipk"
                        FILE1_OUT="sched-cake-oot.ipk"
                        FILE2_OUT="tc-adv.ipk"
                        /usr/sbin/curl -fsL --retry 3 --connect-timeout 3 "https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/${SCRIPT_BRANCH}/${FILE1}" -o "/opt/tmp/${FILE1_OUT}"
                        /usr/sbin/curl -fsL --retry 3 --connect-timeout 3 "https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/${SCRIPT_BRANCH}/${FILE2}" -o "/opt/tmp/${FILE2_OUT}"
                        if [ -f "/opt/tmp/$FILE1_OUT" ] && [ -f "/opt/tmp/$FILE2_OUT" ]; then
                                if [ "$1" = "update" ]; then
                                        opkg --autoremove remove sched-cake-oot
                                        opkg --autoremove remove tc-adv
                                fi
                                opkg update
                                /opt/bin/opkg install "/opt/tmp/$FILE1_OUT"
                                /opt/bin/opkg install "/opt/tmp/$FILE2_OUT"
                                rm "/opt/tmp/$FILE1_OUT" "/opt/tmp/$FILE2_OUT"

when I search entware repository I don't see these, e.g.
Code:
# opkg list |egrep -i 'tc-adv|cake'
#
 
Is the script downloading and installing ipk files from ttgapers github

Correct. Although I can't reproduce this issue on my end. Are there any errors when the script attempts to download/install these files? That part was missing from your original post
 
Correct. Although I can't reproduce this issue on my end. Are there any errors when the script attempts to download/install these files? That part was missing from your original post
/opt/lib/modules/sch_cake.ko is missing as per;

Code:
+ [ ! -f /opt/lib/modules/sch_cake.ko ]
+ Print_Output true Cake binaries missing - Exiting \e[41m

It may have not installed correctly or it could be an entware thing, try run the uninstall command followed once again by the install procedure.

output in previous post was everything from command below
Code:
sh -x /jffs/addons/cake-qos/cake-qos install

is there something else I can try; I could manually download and install the ipks?
 
output in previous post was everything from command below
Code:
sh -x /jffs/addons/cake-qos/cake-qos install

is there something else I can try; I could manually download and install the ipks?

Had a closer look, the following command is whats causing you issues;

Code:
/usr/sbin/curl -fsL --retry 3 --connect-timeout 3 https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/master/versions.txt

This should return the contents of the text file;

Code:
skynet@RT-AX88U-DC28:/tmp/home/root# /usr/sbin/curl -fsL --retry 3 --connect-timeout 3 https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/master/versions.txt
2020-05-28-a5dccfd8|4.16.0-git-20191110|aarch64-3.10

In your case it returned nothing. What happens when you issue that command manually? (if it fails again, run it without the fs flags in the curl command)
 
Had a closer look, the following command is whats causing you issues;

Code:
/usr/sbin/curl -fsL --retry 3 --connect-timeout 3 https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/master/versions.txt

This should return the contents of the text file;

Code:
skynet@RT-AX88U-DC28:/tmp/home/root# /usr/sbin/curl -fsL --retry 3 --connect-timeout 3 https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/master/versions.txt
2020-05-28-a5dccfd8|4.16.0-git-20191110|aarch64-3.10

In your case it returned nothing. What happens when you issue that command manually? (if it fails again, run it without the fs flags in the curl command)

hmm, seems like I have a name resolution issue with curl, but not with dig?
Code:
ac86u@RT-AC86U-D318:/tmp/home/root# /usr/sbin/curl -fsL --retry 3 --connect-timeout 3 https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/master/versions.txt

ac86u@RT-AC86U-D318:/tmp/home/root# /usr/sbin/curl -L --retry 3 --connect-timeout 3 https://raw.githubusercontent.com/ttgapers/cakeqos-merlin/master/versions.txt
curl: (6) name lookup timed out
Warning: Transient problem: timeout Will retry in 1 seconds. 3 retries left.
curl: (6) name lookup timed out
Warning: Transient problem: timeout Will retry in 2 seconds. 2 retries left.
curl: (6) name lookup timed out
Warning: Transient problem: timeout Will retry in 4 seconds. 1 retries left.
curl: (6) name lookup timed out

ac86u@RT-AC86U-D318:/tmp/home/root# dig raw.githubusercontent.com
; <<>> DiG 9.16.3 <<>> raw.githubusercontent.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15319
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 5
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: ea3ff97f35f3ea6bb8344a275ef4a92bc80dd44afd461c57 (good)
;; QUESTION SECTION:
;raw.githubusercontent.com.     IN      A
;; ANSWER SECTION:
raw.githubusercontent.com. 30   IN      CNAME   github.map.fastly.net.
github.map.fastly.net.  30      IN      A       151.101.16.133

panic over, tracked it down to my primary WAN dns server 139.162.234.16
swapped it for the secondary 104.238.186.189 and the install completed as expected

Thanks @Adamm for your assistance tracking down the issue
 
Last edited:
Hmm ... seems I’ve got an issue.
Install went OK and it ran up and I checked Status and ran speed tests and buffer bloat tests etc, all looking good I thought - but after a reboot it wasn’t running!
I can manually start it using the cake-QoS menu, but what is missing?

I uninstalled/reinstalled but same result.

Is there supposed to be a line in services-start because if so I don’t have one it seems!
What is the line meant to be and where?

Any suggestions how to get it to auto-start on reboot please?
 
Hmm ... seems I’ve got an issue.
Install went OK and it ran up and I checked Status and ran speed tests and buffer bloat tests etc, all looking good I thought - but after a reboot it wasn’t running!
I can manually start it using the cake-QoS menu, but what is missing?

I uninstalled/reinstalled but same result.

Is there supposed to be a line in services-start because if so I don’t have one it seems!
What is the line meant to be and where?

Any suggestions how to get it to auto-start on reboot please?

do you have a /jffs/scripts/nat-start
with entry below:
/jffs/addons/cake-qos/cake-qos start & # CakeQOS-Merlin
 

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