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
268 stars 24 forks source link

Add remaining Asus Merlin fixes to installer #299

Closed lynxthecat closed 4 months ago

lynxthecat commented 4 months ago

@LiveWire1968 any chance you could test the latest code on this asus-merlin branch and we'll add any necessary remaining fixes?

I think(?) the installation instructions should be something like:

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

And then run:

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:

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)[/CODE]

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

Does it work?

LiveWire1968 commented 4 months ago

I added env > /tmp/cake-test to the top of cake-autorate.sh .. the script is trying to run admin@RT-AX86U-D7D0:/tmp# cat cake-test subnet=255.192.0.0 router=100.64.0.1 USER=root staticroutes=192.168.100.1/32 0.0.0.0 34.120.255.244/32 0.0.0.0 0.0.0.0/0 100.64.0.1 LD_LIBRARY_PATH=/lib:/usr/lib:/lib/aarch64 SHLVL=2 HOME=/ ENV=/etc/profile interface=eth0 siaddr=10.10.10.10 dns=1.1.1.1 8.8.8.8 serverid=100.64.0.1 TERM=vt100 mtu=1500 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/sbin:/opt/bin ip=100.74.88.2 SHELL=/bin/sh mask=10 lease=300 PWD=/tmp/bwdpi opt53=05 TZ=GMT5 TMOUT=0

LiveWire1968 commented 4 months ago

Not sure this helps, when i change the line in qos-start to /jffs/scripts/cake-autorate/cake-autorate.sh 2> /tmp/cak2-test I get admin@RT-AX86U-D7D0:/tmp# cat cak2-test /jffs/scripts/cake-autorate/cake-autorate.sh: line 35: syntax error: unexpected redirection

fyi, when i run ./qos-start after the router has booted, it works fine.....

rany2 commented 4 months ago

@LiveWire1968 might be a bug in AsusWRT, that suggests that the wrong shell is being used and the shebang is getting ignored

LiveWire1968 commented 4 months ago

@LiveWire1968 might be a bug in AsusWRT, that suggests that the wrong shell is being used and the shebang is getting ignored

I agree, I think that was the first error before the shebang stuff was changed. Even though its not the asus way, probably easiest to direct users to use entware's init.d... it works fine

lynxthecat commented 4 months ago

Would it be fixed by just prefixing full path to the appropriate shell inside qos-start?

LiveWire1968 commented 4 months ago

I just retested this, restarted router.. works fine. echo /jffs/scripts/cake-autorate/launcher.sh >/opt/etc/init.d/S99cake-autorate chmod +x /opt/etc/init.d/S99cake-autorate

lynxthecat commented 4 months ago

Since this seems to relate to a peculiarity or bug in Asus Merlin, hopefully @RMerl can advise.

LiveWire1968 commented 4 months ago

Since this seems to relate to a peculiarity or bug in Asus Merlin, hopefully @RMerl can advise.

Dave has moved over to openwrt, but @dave14305 was a scripting wizard on asuswrt.. Maybe he has some insight also.

rany2 commented 4 months ago

Since this seems to relate to a peculiarity or bug in Asus Merlin, hopefully @RMerl can advise.

He has moved over to openwrt, but @dave14305 was a scripting wizard on asuswrt.. Maybe he has some insight also.

If @RMerl abandoned asuswrt, then you really shouldn't be using it right now (I doubt that he did, seems he's still pushing out updates)

LiveWire1968 commented 4 months ago

Since this seems to relate to a peculiarity or bug in Asus Merlin, hopefully @RMerl can advise.

He has moved over to openwrt, but @dave14305 was a scripting wizard on asuswrt.. Maybe he has some insight also.

If @RMerl abandoned asuswrt, then you really shouldn't be using it right now (I doubt that he did, seems he's still pushing out updates)

@rany2 I meant dave14305 has moved to openwrt.....

lynxthecat commented 4 months ago

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

Looks like mktemp may not be available by default in Asus Merlin.

I wonder what would cause this line:

https://github.com/lynxthecat/cake-autorate/blob/4dea0575726fe85faf6065269f1343c9de42808c/cake-autorate.sh#L34

to throw:

/jffs/scripts/cake-autorate/cake-autorate.sh: line 34: syntax error: unexpected redirection

LiveWire1968 commented 4 months ago

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

Looks like mktemp may not be available by default in Asus Merlin.

I saw that post, I already had it installed via opkg for some reason.. So missed the requirement. But the person that posted must not have latest version also. He's getting the asus sh error...

rany2 commented 4 months ago

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

Looks like mktemp may not be available by default in Asus Merlin.

I wonder what would cause this line:

https://github.com/lynxthecat/cake-autorate/blob/4dea0575726fe85faf6065269f1343c9de42808c/cake-autorate.sh#L34

to throw:

/jffs/scripts/cake-autorate/cake-autorate.sh: line 34: syntax error: unexpected redirection

Obviously it's calling regular /bin/sh instead of bash.

rany2 commented 4 months ago

Btw the asuswrt-merlin branch no longer exists, why are you telling people on the forum to try to use it? Of course there won't be any output :)

LiveWire1968 commented 4 months ago

https://www.snbforums.com/threads/cake-autorate-adding-support-for-asus-merlin.89639/page-2 Looks like mktemp may not be available by default in Asus Merlin. I wonder what would cause this line: https://github.com/lynxthecat/cake-autorate/blob/4dea0575726fe85faf6065269f1343c9de42808c/cake-autorate.sh#L34

to throw: /jffs/scripts/cake-autorate/cake-autorate.sh: line 34: syntax error: unexpected redirection

Obviously it's calling regular /bin/sh instead of bash.

Agreed @rany2 so I think hes using the wrong version after all your fixes

lynxthecat commented 4 months ago

Just an old post @rany2. I’ve linked to the new installation instructions.

I’ll add the missing dependency when I get a chance.

dave14305 commented 4 months ago

@rany2 I meant dave14305 has moved to openwrt.....

I switch back and forth based on what interests me, usually when there’s an compelling update. Anything in particular you guys need advice on? I’m running a Merlin router this week. I was on vacation last week…

LiveWire1968 commented 4 months ago

@rany2 I meant dave14305 has moved to openwrt.....

I switch back and forth based on what interests me, usually when there’s an compelling update. Anything in particular you guys need advice on? I’m running a Merlin router this week. I was on vacation last week…

@dave14305 Im sure @rany2 will pop in. Been a issue with cake-autorate needing bash on asuswrt, been some asuswrt sh bugs(differences from openwrt) found. So it runs fine now, EXCEPT, it will not start from like qos-start,etc.. the sh bugs pop back up, like startup is ignoring the shebang. it will start fine from entware init.d...