Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

allow channel of 0 or acs_survey for automatic channel selection #435

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dlenski
Copy link

@dlenski dlenski commented Mar 26, 2020

This might be useful for some users. hostapd's “ACS survey mode” allows it to automatically select a channel based on WiFi interference:

https://wireless.wiki.kernel.org/en/users/documentation/acs

@dlenski dlenski mentioned this pull request Apr 5, 2020
@TZubiri
Copy link

TZubiri commented Apr 11, 2020

Thank you! I just tried this on an old release and it didn't work. Good to know I'm not the only one, I'll pull this branch and update.

Would it be reasonable to change the default to acs instead of channel 1?
I changed it from 1 to 11 because it was interfering with my neighboor, but later they switched to 11 as well. I doubt they have the knowledge to change or set channels, so their router probably defaulted to acs.

Dynamic frequency selection seems to be a more standard name for this feature, I would recommend anyone to use it, it looks like a tragedy of the commons scenario.

If we are going to build a layer on top of hostapd, we might as well provide opinionated defaults. But it's best to deploy it as an option first, and once it's well tested, push it as a default.

Regards.

@TZubiri
Copy link

TZubiri commented Apr 11, 2020

root@devuan:~# pkill create_ap && /root/create_ap_acs/create_ap --country AR -c acs_survey --daemon --logfile /var/log/create_ap_acs wlan0 eth0 ssid password

This fails, the ap isn't created. If I change to the master branch and recompile with channel 11 instead of acs_survey it works correctly.

This are the logs:

root@devuan:~# cat /var/log/create_ap_acs
WARN: brmfmac driver doesn't work properly with virtual interfaces and
      it can cause kernel panic. For this reason we disallow virtual
      interfaces for your adapter.
      For more info: https://github.com/oblique/create_ap/issues/203
WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt
Config dir: /tmp/create_ap.wlan0.conf.qG7UVJni
PID: 2874
Sharing Internet using method: nat
hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.qG7UVJni/hostapd_ctrl
Configuration file: /tmp/create_ap.wlan0.conf.qG7UVJni/hostapd.conf
Failed to create interface mon.wlan0: -95 (Operation not supported)
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
ACS: Automatic channel selection started, this may take a bit
wlan0: interface state COUNTRY_UPDATE->ACS
wlan0: ACS-STARTED 
ACS: Unable to collect survey data
ACS: All study options have failed
Interface initialization failed
wlan0: interface state ACS->DISABLED
wlan0: AP-DISABLED 
ACS: Possibly channel configuration is invalid, please report this along with your config file.
ACS: Failed to start
wlan0: AP-DISABLED 
hostapd_free_hapd_data: Interface wlan0 wasn't started
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: interface state DISABLED->DISABLED
wlan0: interface state DISABLED->DISABLED
wlan0: AP-DISABLED 
hostapd_free_hapd_data: Interface wlan0 wasn't started

Doing cleanup.. done

The relevant lines start with "ACS: Automatic channel selection started" the lines above are standard and expected in my setup.

Any idea what might have went wrong?

@dlenski
Copy link
Author

dlenski commented Apr 11, 2020

ACS: Unable to collect survey data

It appears that your WiFi adapter simply doesn't support ACS… would be nice to be able to catch this and fallback automatically to CHANNEL=default.

@TZubiri
Copy link

TZubiri commented Apr 11, 2020

Oh, I thought dfs was a purely logical routine? What kind of hardware support does it need? .

@dlenski
Copy link
Author

dlenski commented Apr 12, 2020

I actually don't know :frown:. I found that I have the same error on another system with a standard nl80211 wifi driver.

I can't find much information on this error or whether it requires specific hardware support, or

https://unix.stackexchange.com/questions/350333/starting-hostapd-fails-acs-unable-to-collect-survey-data

@TZubiri
Copy link

TZubiri commented Apr 13, 2020

I actually don't know :frown:. I found that I have the same error on another system with a standard nl80211 wifi driver.

I can't find much information on this error or whether it requires specific hardware support, or

https://unix.stackexchange.com/questions/350333/starting-hostapd-fails-acs-unable-to-collect-survey-data

The electrical and network stackexchanges seem more appropriate.
https://electronics.stackexchange.com/questions/492694/can-all-wifi-emitters-dynamically-select-frequencies-or-is-specific-hardware-su

@dlenski
Copy link
Author

dlenski commented Apr 13, 2020

The electrical and network stackexchanges seem more appropriate.
https://electronics.stackexchange.com/questions/492694/can-all-wifi-emitters-dynamically-select-frequencies-or-is-specific-hardware-su

That question/questioner is quite confused, probably because the name is confusing.

DFS has little-to-nothing to do with selecting an optimal frequency for running your WiFi network. It's something that WiFi hardware has to do to avoid interfering with radar, because it's required by regulatory agencies, and it only applies to the 5 GHz band. A WiFi device can "comply" with DFS by switching to any ol' random non-DFS channel when it detects radar, or by completely powering down. Most hardware doesn't make much more effort than that, as far as I know. 🤷‍♂️

ACS survey is a completely different process that's actually focused on finding the channel with least interference for WiFi communication.

I thought it was a purely software-driven process that relies on the hardware only for accurately detecting other networks, but perhaps that's not the case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants