What's new

changing channel width from terminal

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

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..
 
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.
 
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?
 
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.
 

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