lynxthecat / cake-autorate

Eliminate the excess latency and jitter terrorizing your 4G, 5G, LTE, Starlink or other variable rate connection!
https://www.bufferbloat.net
GNU General Public License v2.0
263 stars 24 forks source link

Add ASUSWrt-Merlin support and don't hardcode /root/cake-autorate #292

Closed rany2 closed 4 months ago

rany2 commented 4 months ago

This allows the user to override the default /root/cake-autorate path and should clear the path for a more standard installation.

rany2 commented 4 months ago

@LiveWire1968 Please test this on your ASUSWrt router.

LiveWire1968 commented 4 months ago

@rany2 im in Vegas until next week.

rany2 commented 4 months ago

@LiveWire1968 No rush, thanks for confirming you're still around :)

lynxthecat commented 4 months ago

For the Asus Merlin users out there, what should they run to test this out?

Something like this?

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

And then run:

wget https://raw.githubusercontent.com/lynxthecat/cake-autorate/master/setup.sh
chmod +x ./setup.sh
./setup.sh lynxthecat/cake-autorate asuswrt

And then edit the config file to specify the correct interfaces:

dl_if=ifb4eth0 # download interface
ul_if=eth0     # upload interface

And bandwidths (change according to your connection specifics):

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:

output_summary_stats=1    # enable (1) or disable (0) output monitoring lines showing summary stats

And then try running manually:

./cake-autorate.sh
rany2 commented 4 months ago

@lynxthecat I don't know how similar ASUSWRT is to OpenWRT so I have no idea how much of this is going to work

lynxthecat commented 4 months ago

Also based on: https://github.com/LiveWire1968/Asus-cake-autorate

Do we need to advise about something like:

echo /jffs/scripts/launcher.sh >> /jffs/scripts/post-mount

rather than service enable start (which is OpenWrt specific).

rany2 commented 4 months ago

I don't know but maybe we could make the init.d script work on both OpenWRT and ASUSWRT.

lynxthecat commented 4 months ago

Sounds good. Hopefully we'll get a tester soon enough.

https://www.snbforums.com/threads/cake-autorate-adding-support-for-asus-merlin.89639

rany2 commented 4 months ago

@lynxthecat YOUR INSTRUCTIONS ARE WRONG!

wget https://raw.githubusercontent.com/lynxthecat/cake-autorate/master/setup.sh

from asuswrt branch not master...

rany2 commented 4 months ago

I'm thinking we could merge this and fix the setup.sh script as we go.

lynxthecat commented 4 months ago

@lynxthecat YOUR INSTRUCTIONS ARE WRONG!

wget https://raw.githubusercontent.com/lynxthecat/cake-autorate/master/setup.sh

from asuswrt branch not master...

Fixed!

LiveWire1968 commented 4 months ago

@rany2 @lynxthecat setup.sh needs the shebang to point to /opt/bin/bash, asuswrt sh is not showing any output with printf in the script The script then says jsonfilter and uclient-fetch are needed. uclient-fetch is not available on asuswrt.

rany2 commented 4 months ago

@LiveWire1968 Does wget work and could you install jsonfitler?

rany2 commented 4 months ago

Also could you use /usr/bin/env sh. I'm not going to change the shebang to something not standard just for ASUSWrt.

LiveWire1968 commented 4 months ago

@rany2 sh does not show any output, only way to get output is "bash +x setup.sh", or change the shebang manually. Then it shows the needed dependencies Was able to install jsonfilter, and wget does work.

rany2 commented 4 months ago

@LiveWire1968 is it just because of the printfs?

LiveWire1968 commented 4 months ago

Even if I change printf to echo just to test, it doesnt show output with sh here. for dep in ${DEPENDENCIES} do if ! type "${dep}" >/dev/null 2>&1; then echo "%s is required, please install it and rerun the script!\n" "${dep}" exit_now=1 fi

rany2 commented 4 months ago

Can you show me the sh -x setup.sh output?

LiveWire1968 commented 4 months ago

admin@RT-AX86U-D7D0:/jffs# sh -x setup.sh

LiveWire1968 commented 4 months ago

WITH bash admin@RT-AX86U-D7D0:/jffs# bash -x setup.sh

rany2 commented 4 months ago

@LiveWire1968 Does AsusWRT actually not have a /bin/sh?

rany2 commented 4 months ago

Do you have some kind of IRC? I need to ask you some questions about ASUSWrt's /bin/sh

LiveWire1968 commented 4 months ago

@rany2 there is a sh busybox symlink in /bin admin@RT-AX86U-D7D0:/bin# ls -l /bin/sh lrwxrwxrwx 1 admin root 7 Mar 16 12:08 /bin/sh -> busybox

LiveWire1968 commented 4 months ago

@rany2 #asuswrt , Rmerlin hangs in there

rany2 commented 4 months ago

@LiveWire1968 If you could join IRC, I'm on Libera or OFTC my username is rany

LiveWire1968 commented 4 months ago

@rany2 per our irc convo about init.d Create file in /opt/etc/init.d/S99cake-autorate with the contents of `#!/bin/sh

/jffs/scripts/cake-autorate/cake-autorate.sh` chmod +x S99cake-autorate