Wifi – Hostapd with ACS not working due to not collecting survey data

hostapdlinux-networkingwifi

I'm trying to use hostapd in version 2.5 with ACS. In order to do that, I have used the following config file:

interface=wlp2s0
driver=nl80211
ssid=ap-example
hw_mode=g
channel=acs_survey
macaddr_acl=0
ignore_broadcast_ssid=0
auth_algs=1
wpa=3
wpa_passphrase=ap-example
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

I have built hostapd with CONFIG_ACS=y flag but when I try to start service I get the following errors:

$ ./hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
ACS: Automatic channel selection started, this may take a bit
wlp2s0: interface state UNINITIALIZED->ACS
wlp2s0: ACS-STARTED
ACS: Unable to collect survey data
ACS: All study options have failed
Interface initialization failed
wlp2s0: interface state ACS->DISABLED
wlp2s0: AP-DISABLED
ACS: Possibly channel configuration is invalid, please report this along with your config file.
ACS: Failed to start
wlp2s0: AP-DISABLED
hostapd_free_hapd_data: Interface wlp2s0 wasn't started
nl80211: deinit ifname=wlp2s0 disabled_11b_rates=0
wlp2s0: interface state DISABLED->DISABLED
wlp2s0: interface state DISABLED->DISABLED
wlp2s0: AP-DISABLED
hostapd_free_hapd_data: Interface wlp2s0 wasn't started

Of course, I'm running this with root privileges. I have seen in defconfig file in hostapd package that only some drivers are supported to do Automatic Channel Subscription.

Anyone have idea about what happening with my config?
Exists any relation of supported drivers in hostapd project wiki or something like that?

Best Answer

After a few hours of fiddling, I gave up on trying to get hostapd's ACS option working on my RPi4 and instead wrote a short script (requires NodeJS) to call iwlist wlan0 scan, parse the output, and pick the quietest channel in the range 1-11. In case it's helpful, I posted a gist of it here: https://gist.github.com/jacobq/ea044bfbf00dd88ed6e3d42cb1fee392