How to trigger ACS manually with CLI


When my AP boots I see in the logs that ACS starts as expected given my channel selection is set to "auto", and this seems to work very well.

Tue Mar  8 07:31:00 2022 daemon.notice hostapd: ACS: Automatic channel selection started, this may take a bit
Tue Mar  8 07:31:00 2022 daemon.notice hostapd: wlan0: interface state COUNTRY_UPDATE->ACS
Tue Mar  8 07:31:00 2022 daemon.notice hostapd: wlan0: ACS-STARTED
Tue Mar  8 07:31:13 2022 daemon.notice hostapd: wlan0: ACS-COMPLETED freq=5580 channel=116
Tue Mar  8 07:31:13 2022 daemon.notice hostapd: wlan0: interface state ACS->HT_SCAN

What I would like to know is if there is a way to manually trigger ACS directly through CLI, besides having to reboot the entire device or down/up the wifi interface.

I had a look through the hostapd, iw and wifi commands but did not spot anything.

Any help would be much appreciated.

To be clear, you want the AP to pick a second channel, after it already auto selected the first time?

Yes, I would like to be able to trigger an ACS programmatically/on-demand via CLI, possibly periodically via cron.

Thank you for this, this may solve my problem, although I would prefer to not have to introduce more dependancies/code in order to achieve what I want.

Being able to manually re-trigger ACS would still be ideal for me vs this script in that its less dependancies/code, as well as that ACS respects a few other useful hostapd settings like channel filtering and bias etc. (See channels option here for example:

Something that I am wondering now is whether assuming there was such a command to trigger ACS manually without restarting/up/downing the interfaces/radios, whether performing a channel scan would interrupt clients or not.

I'll try find out what that iwchan script does, and whether it kicks clients or not.

@anon89577378 do you perhaps have any insight on this? Or would you be able to point me in the right direction?

Scan or changing the channel?

Scanning or changing channel.

Im reading more about what hostapd is and how it works now trying to figure out if what I’m trying to do is possible, so far it doesn’t look like it’s possible to change channel without restarting hostapd and therefore dropping clients.

Ping @vgaetera

He's the author of the script.

1 Like