What's new

cake-autorate: adding support for Asus 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!

@rlj2 can advise there concerning his fork. It'll be very simple.

The installer we're working on for the main code has an associated uninstaller with code to handle the Asus Merlin instance.


We really should get any issues with the main code base installer sorted out to ensure Asus Merlin users can all benefit from this code.
Thanks for the feedback…

I am not a programmer, more of a tech enthusiast, but I am willing to try…

My main and only internet is 5G, and the download and upload speed is variable during the day…

I will wait for an Alpha, so I can try in my setup.
 
Yes, ideally. I think you'd just enable CAKE on the Asus Merlin router.

Make sure these are installed: entware; bash; iputils-ping; and fping.

And then run:
Code:
wget https://raw.githubusercontent.com/lynxthecat/cake-autorate/asus-merlin/setup.sh
chmod +x ./setup.sh
./setup.sh lynxthecat/cake-autorate asus-merlin

And then edit the config file to specify the correct interfaces:
Code:
dl_if=ifb4eth0 # download interface
ul_if=eth0     # upload interface

and bandwidths (change according to your connection specifics):
Code:
min_dl_shaper_rate_kbps=5000   # minimum bandwidth for download (Kbit/s)
base_dl_shaper_rate_kbps=60000 # steady state bandwidth for download (Kbit/s)
max_dl_shaper_rate_kbps=100000 # maximum bandwidth for download (Kbit/s)

min_ul_shaper_rate_kbps=20000  # minimum bandwidth for upload (Kbit/s)
base_ul_shaper_rate_kbps=30000 # steady state bandwidth for upload (KBit/s)
max_ul_shaper_rate_kbps=35000  # maximum bandwidth for upload (Kbit/s)

And also enable logging:
Code:
output_summary_stats=1    # enable (1) or disable (0) output monitoring lines showing summary stats

And then try running manually:
Code:
./cake-autorate.sh
 
Last edited:
./setup.sh lynxthecat/cake-autorate asus-merlin
Above command doesn't work on my router, no output, no errors, nothing. What do you suggest?
 
Above command doesn't work on my router, no output, no errors, nothing. What do you suggest?
Please can you try running with:
Code:
sh ./setup.sh lynxthecat/cake-autorate asus-merlin
 
Please can you try running with:
Code:
sh ./setup.sh lynxthecat/cake-autorate asus-merlin
Still the same.
If there is a way that I can provide feedback, such as sharing logs or system information, please let me know with a DM.
 
- mktemp is not installed by default on Asuswrt-Merlin, so you need to include coreutils-mktemp in the list of required packages. Otherwise setup.sh can't continue.
- After the installation and editing defaults, running cake-autorate.sh throws a syntax error as follows:
Code:
/jffs/scripts/cake-autorate/cake-autorate.sh: line 34: syntax error: unexpected redirection
 
- mktemp is not installed by default on Asuswrt-Merlin, so you need to include coreutils-mktemp in the list of required packages. Otherwise setup.sh can't continue.
- After the installation and editing defaults, running cake-autorate.sh throws a syntax error as follows:
Code:
/jffs/scripts/cake-autorate/cake-autorate.sh: line 34: syntax error: unexpected redirection
sure you have the latest cake-autorate stuff?
 
@rlj2 is mktemp not available by default in Asus Merlin? Looks like there may still be a couple of issues needing ironed out.
 
@rlj2 is mktemp not available by default in Asus Merlin? Looks like there may still be a couple of issues needing ironed out.
Responded to github, apparently not, and for some reason I had it installed. So missed the requirement. But his syntax error seems to be from the older versions before bash(shebang) was fixed.
 
- mktemp is not installed by default on Asuswrt-Merlin, so you need to include coreutils-mktemp in the list of required packages. Otherwise setup.sh can't continue.
Many thanks for this information @underdose. I've just added a dependency check for mktemp and mention in the documentation to install coreutils-mktemp.
- After the installation and editing defaults, running cake-autorate.sh throws a syntax error as follows:
Code:
/jffs/scripts/cake-autorate/cake-autorate.sh: line 34: syntax error: unexpected redirection
The temporary asus-merlin branch was deleted as the changes were pulled into the master branch.
Please use the instructions as outlined here:
 
Last edited:
Responded to github, apparently not, and for some reason I had it installed. So missed the requirement. But his syntax error seems to be from the older versions before bash(shebang) was fixed.
This is with the latest version. See the full process here:

Code:
baris@RT-AX58U-34C8:/tmp/home/root# wget -O /tmp/cake-autorate_setup.sh https://raw.githubusercontent.com/lynxthecat/
cake-autorate/master/setup.sh
Will not apply HSTS. The HSTS database must be a regular and non-world-writable file.
ERROR: could not open HSTS store at '/root/.wget-hsts'. HSTS will be disabled.
--2024-05-05 12:00:58--  https://raw.githubusercontent.com/lynxthecat/cake-autorate/master/setup.sh
Resolving raw.githubusercontent.com... 2606:50c0:8000::154, 2606:50c0:8001::154, 2606:50c0:8003::154, ...
Connecting to raw.githubusercontent.com|2606:50c0:8000::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8476 (8.3K) [text/plain]
Saving to: '/tmp/cake-autorate_setup.sh'

/tmp/cake-autorate_setup.sh   100%[==============================================>]   8.28K  --.-KB/s    in 0.001s

2024-05-05 12:00:58 (6.41 MB/s) - '/tmp/cake-autorate_setup.sh' saved [8476/8476]
baris@RT-AX58U-34C8:/tmp/home/root# sh /tmp/cake-autorate_setup.sh
Detected Operating System: asuswrt
Installation directories for detected Operating System:
  - Script prefix: /jffs/scripts/cake-autorate
  - Config prefix: /jffs/configs/cake-autorate
Continue with installation? [Y/n] Y
Installing cake-autorate using /jffs/scripts/cake-autorate (script) and /jffs/configs/cake-autorate (config) directories...

Now edit the config.primary.sh file as described in:
   https://github.com/lynxthecat/cake-autorate/tree/master#installation-on-openwrt

3.2.0-PRERELEASE successfully installed, but not yet running

Start the software manually with:
   cd /jffs/scripts/cake-autorate; ./cake-autorate.sh
Launch script on boot with:
   echo /jffs/scripts/cake-autorate/launcher.sh >> /jffs/scripts/qos-start

baris@RT-AX58U-34C8:/tmp/home/root# cd /jffs/scripts/cake-autorate/
baris@RT-AX58U-34C8:/jffs/scripts/cake-autorate# ./cake-autorate.sh
./cake-autorate.sh: line 34: syntax error: unexpected redirection
baris@RT-AX58U-34C8:/jffs/scripts/cake-autorate#

cc: @Lynx
 
This is with the latest version. See the full process here:

Code:
baris@RT-AX58U-34C8:/tmp/home/root# wget -O /tmp/cake-autorate_setup.sh https://raw.githubusercontent.com/lynxthecat/
cake-autorate/master/setup.sh
Will not apply HSTS. The HSTS database must be a regular and non-world-writable file.
ERROR: could not open HSTS store at '/root/.wget-hsts'. HSTS will be disabled.
--2024-05-05 12:00:58--  https://raw.githubusercontent.com/lynxthecat/cake-autorate/master/setup.sh
Resolving raw.githubusercontent.com... 2606:50c0:8000::154, 2606:50c0:8001::154, 2606:50c0:8003::154, ...
Connecting to raw.githubusercontent.com|2606:50c0:8000::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8476 (8.3K) [text/plain]
Saving to: '/tmp/cake-autorate_setup.sh'

/tmp/cake-autorate_setup.sh   100%[==============================================>]   8.28K  --.-KB/s    in 0.001s

2024-05-05 12:00:58 (6.41 MB/s) - '/tmp/cake-autorate_setup.sh' saved [8476/8476]
baris@RT-AX58U-34C8:/tmp/home/root# sh /tmp/cake-autorate_setup.sh
Detected Operating System: asuswrt
Installation directories for detected Operating System:
  - Script prefix: /jffs/scripts/cake-autorate
  - Config prefix: /jffs/configs/cake-autorate
Continue with installation? [Y/n] Y
Installing cake-autorate using /jffs/scripts/cake-autorate (script) and /jffs/configs/cake-autorate (config) directories...

Now edit the config.primary.sh file as described in:
   https://github.com/lynxthecat/cake-autorate/tree/master#installation-on-openwrt

3.2.0-PRERELEASE successfully installed, but not yet running

Start the software manually with:
   cd /jffs/scripts/cake-autorate; ./cake-autorate.sh
Launch script on boot with:
   echo /jffs/scripts/cake-autorate/launcher.sh >> /jffs/scripts/qos-start

baris@RT-AX58U-34C8:/tmp/home/root# cd /jffs/scripts/cake-autorate/
baris@RT-AX58U-34C8:/jffs/scripts/cake-autorate# ./cake-autorate.sh
./cake-autorate.sh: line 34: syntax error: unexpected redirection
baris@RT-AX58U-34C8:/jffs/scripts/cake-autorate#

cc: @Lynx
what happens when you do opkg install bash iputils-ping fping before doing the steps you did above?
 
What happens if you try to launch using:
Code:
bash ./cake-autorate.sh
I did a new install again this morning, worked fine (besides the qos-start thing). So not sure why he is getting sh/bash errors
 
what happens when you do opkg install bash iputils-ping fping before doing the steps you did above?
Entware bash is installed and that did the trick, I guess? I'm now able to run cake-autorate. Thanks!
 
Entware bash is installed and that did the trick, I guess? I'm now able to run cake-autorate. Thanks!
Excellent news! What does total CPU usage look like for cake-autorate on your device? You can check with ‘atop 2’, then tap ‘p’ to collate the processes, and observe the total CPU percentage for 'bash'.
 
Last edited:

Similar threads

Latest threads

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!

Members online

Top