changing channel width from terminal

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

Phil Moora

New Around Here
Hi all,

I use latest Asus-merlin image on rt-ac66u. Everything is running smoothly except that I have a specific requirement.

I want to change channel width from terminal for the eth2/5g/ac radio. I am testing some interference avoidance script where I want to change channel and channel width if there are too many packet losses (similar to what hostapd does on other drivers).

I can not change the channel width using "wl" command. I run "wl -i eth2 5g_rate -b 80", channel width still remains to be 20 in "wl -i eth2 status".

In asus-merlin WebGUI, It works fine if I change the channel width from the Web GUI, but I want to do this from terminal. I can not find how Web GUI changes the channel width internally. Does any one know how it works?

Thanks..
 

RMerlin

Asuswrt-Merlin dev
The channel is stored in wl0_chanspec (and wl1_chanspec for the 5 GHz band).

Best way is to change that nvram to whichever value you want, and then restart the wireless service.

Note that the format of that variable might be different for 2.4 GHz and 5 GHz. Check the current content to see how it looks like:

Code:
nvram get wl1_chanspec
nvram get wl0_chanspec

Change it, then restart the wireless service (this was untested):

Code:
nvram set "wl0_chanspec=1"
nvram set "wl1_chanspec=153/80"
nvram commit
service restart_wireless

By doing it this way, you will ensure that your settings won't be overwritten by the firmware.
 

Phil Moora

New Around Here
Thanks for your reply.

That indeed worked. Though I am facing one issue - the client gets disconnected when I run "service restart_wireless". This does not allow me to do anything in realtime. Any other way to do without it? or any other way of changing channel width?
 

RMerlin

Asuswrt-Merlin dev
Thanks for your reply.

That indeed worked. Though I am facing one issue - the client gets disconnected when I run "service restart_wireless". This does not allow me to do anything in realtime. Any other way to do without it? or any other way of changing channel width?

There is no way around it. If you do such radio changes, then the radio must restart to apply the changes.
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top