7

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?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Kotik_o
  • 295
  • 6
  • 19

2 Answers2

1

Does ap-force no longer work?

iw dev wlan0 scan ap-force
dafky2000
  • 74
  • 10
0

Been a while since I did just this sort of thing and ran into this same problem. I seem to recall though that it was one or the other (the hardware I was using could scan or be in AP mode but not both at the same time). I.e. switch out of AP mode to do your scan. Go back to AP mode when you're not doing the scan. Seems like that's what your wl_cfg80211.c device driver software says too. Apologies if my memory of this has failed me.

Louis Langholtz
  • 2,913
  • 3
  • 17
  • 40