Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scan fails in AP mode (wpa_supplicant) [closed]

I'm using 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 Access point, i'm 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 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;
    }

So the problem is that if the wifi is in HOSTAP, the scan is not allowed. Any solution?

like image 200
Kotik_o Avatar asked Feb 21 '17 12:02

Kotik_o


People also ask

Is wpa_supplicant needed?

wpa_supplicant is necessary to connect to a protected WPA* wifi. iwd (iNet wireless daemon) is an alternative to wpasupplicant.

What is wpa_supplicant in Linux?

wpa_supplicant is a free software implementation of an IEEE 802.11i supplicant for Linux, FreeBSD, NetBSD, QNX, AROS, Microsoft Windows, Solaris, OS/2 (including ArcaOS and eComStation) and Haiku. In addition to being a WPA3 and WPA2 supplicant, it also implements WPA and older wireless LAN security protocols.

How do I enable WPA supplicant?

To do it you need to edit the configuration file /etc/wpa_supplicant. conf, commenting your current lines and adding the following lines, then run: wpa_supplicant -c /etc/wpa_supplicant. conf -i wlp3s0 and then dhclient wlp3s0. NOTE: Replace PutEssidHere and PasswordHere with your essid and password.

How does WPA supplicant work?

wpa_supplicant is an implementation of the WPA Supplicant component, i.e., the part that runs in the client stations. It implements WPA key negotiation with a WPA Authenticator and EAP authentication with Authentication Server.


Video Answer


1 Answers

Does ap-force no longer work?

iw dev wlan0 scan ap-force
like image 129
dafky2000 Avatar answered Oct 03 '22 11:10

dafky2000