AP Mode Scan Failure (wpa_supplicant)

I use wpa_supplicant to create an access point:

wpa_supplicant -D nl80211 -i wlan0 -c /etc/wpa_supplicant_ap.conf 

The problem is that when the device is configured in the access point, I am not allowed to scan networks:

 iw dev wlan0 scan command failed: Invalid argument (-22) 

or in wpa_cli:

 > scan OK <3>CTRL-EVENT-SCAN-FAILED ret=-22 

In dmesg:

 [85769.193376] CFG80211-ERROR) __wl_cfg80211_scan : Invalid Scan Command at SoftAP mode [85769.200133] CFG80211-ERROR) wl_cfg80211_scan : scan error (-22) 

and it seems that inside wl_cfg80211.c:

 if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE) { WL_ERR(("Invalid Scan Command at SoftAP mode\n")); return -EINVAL; } 

Thus, the problem is that if wifi is in HOSTAP, scanning is not allowed. Any solution?

+5
source share
2 answers

Does ap-force no longer work?

 iw dev wlan0 scan ap-force 
0
source

Some time has passed since I did just that and ran into this problem. I seem to remember that it was one or the other (the hardware that I used could scan or be in AP mode, but not at the same time). That is, switch from AP mode to perform a scan. Return to AP mode if you are not scanning. Looks like what your wl_cfg80211.c device driver software wl_cfg80211.c . I apologize if my memory of this failed me.

0
source

Source: https://habr.com/ru/post/1264512/


All Articles