WiFi scan while connected

Does the NCS stack + nRF7002 support scanning while connected? I would expect it could, to support handoff, but getting errors.

Using nRF7002-DK and NCS 2.8.0.

Compile the wifi/shell example for nrf7002dk/nrf5340/cpuapp, no other changes.

*** Booting nRF Connect SDK v2.8.0-a2386bfc8401 ***
*** Using Zephyr OS v3.7.99-0bc3393fb112 ***
Starting nrf7002dk with CPU frequency: 128 MHz
[00:00:00.532,226] <inf> wifi_supplicant: wpa_supplicant initialized


uart:~$ wifi connect -s Hizzulon <my AP credentials>
Connection requested
Connected
[00:00:19.725,433] <inf> wpa_supp: MBO: Disable MBO/OCE due to misbehaving AP not having enabled PMF
[00:00:19.726,226] <inf> wpa_supp: wlan0: SME: Trying to authenticate with fc:34:97:af:71:54 (SSID='Hizzulon' freq=5220 MHz)
[00:00:20.086,120] <inf> wpa_supp: wlan0: Trying to associate with fc:34:97:af:71:54 (SSID='Hizzulon' freq=5220 MHz)
[00:00:20.102,874] <inf> wpa_supp: wlan0: Associated with fc:34:97:af:71:54
[00:00:20.103,027] <inf> wpa_supp: MBO: Disable MBO/OCE due to misbehaving AP not having enabled PMF
[00:00:20.103,118] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
[00:00:20.122,253] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with fc:34:97:af:71:54 [PTK=CCMP GTK=CCMP]
[00:00:20.122,467] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to fc:34:97:af:71:54 completed [id=0 id_str=]
[00:00:20.137,420] <inf> net_dhcpv4: Received: 192.168.1.203


uart:~$ wifi status
Status: successful
==================
State: COMPLETED
Interface Mode: STATION
Link Mode: WIFI 6 (802.11ax/HE)
SSID: Hizzulon
BSSID: FC:34:97:AF:71:54
Band: 5GHz
Channel: 44
Security: WPA2-PSK
MFP: Optional
RSSI: -34
Beacon Interval: 100
DTIM: 1
TWT: Supported
Current PHY rate : 26000


uart:~$ wifi scan
Scan requested

[wait ~30 seconds]


Scan request failed (-116)

[wait another ~30 seconds]


[00:01:33.363,311] <err> wifi_nrf: nrf_wifi_fmac_chg_vif_state: RPU is unresponsive for 10 sec
[00:01:33.363,342] <err> wifi_nrf: nrf_wifi_if_stop_zep: nrf_wifi_fmac_chg_vif_state failed
[00:01:33.364,013] <inf> wifi_supplicant: Network interface 1 (0x200013c0) down
[00:01:33.375,396] <inf> wpa_supp: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
[00:01:33.375,854] <inf> wpa_supp: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
[00:01:35.533,050] <inf> wifi_supplicant: Network interface 1 (0x200013c0) up
uart:~$ wifi status
Status: successful
==================
State: DISCONNECTED
uart:~$ 

So the scan fails, but later there's another error that looks like the low-level nRF7002 driver failing and recovering (CONFIG_NRF_WIFI_RPU_RECOVERY is enabled by default).

If scan while connected isn't a supported feature, I would expect it to error immediately, not get into a state where it drops the connection?

A probably related issue: if I issue "wifi connect" with invalid credentials, wifi status is "SCANNING" forever (certainly much longer than the 30 second scan timeout), and later connect requests fail with:

uart:~$ wifi connect <credentials>
Connection requested
[00:01:58.298,828] <inf> wpa_supp: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
[00:01:58.302,124] <inf> wpa_supp: wlan0: Reject scan trigger since one is already pending
[00:01:58.302,246] <wrn> wpa_supp: wlan0: Failed to initiate AP scan
[00:01:58.304,992] <inf> wpa_supp: wlan0: Reject scan trigger since one is already pending
[00:01:58.305,114] <wrn> wpa_supp: wlan0: Failed to initiate AP scan

I need to explicitly do "wifi disconnect" before it will stop scanning and allow another connection. Normally, issuing a connect command while already connected disconnects automatically then initiates the new connection.

Parents Reply Children
  • Here are the logs:

    [00:00:00.516,052] <inf> fs_nvs: 2 Sectors of 4096 bytes
    [00:00:00.516,082] <inf> fs_nvs: alloc wra: 0, fe8
    [00:00:00.516,082] <inf> fs_nvs: data wra: 0, 0
    *** Booting nRF Connect SDK v2.8.0-1d192a274cd7 ***
    *** Using Zephyr OS v3.7.99-cbd75f256cc9 ***
    Starting nrf7002dk with CPU frequency: 128 MHz
    [00:00:00.518,066] <inf> wifi_supplicant: wpa_supplicant initialized
    
    uart:~$ wifi scan
    Scan requested
    uart:~$ debug event 00001122  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000001  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000002  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000003  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000004  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000005  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000006  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000007  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000008  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000009  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000000a  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000000b  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000000c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000000d  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000000e  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00001124  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00113000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00113001  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00001122  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000024  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000028  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000002c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000030  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000034  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000038  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000003c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000040  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000064  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000068  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000006c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000070  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000074  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000078  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000007c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000080  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000084  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000088  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000008c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000090  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000095  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000099  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000009d  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  000000a1  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  000000a5  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  000000a9  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  000000ad  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  000000b1  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00001124  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00113000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00113001  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    
    Num  | SSID                             (len) | Chan (Band)   | RSSI | Security        | BSSID             | MFP
    1    | Hizzulon2                        9     | 7    (2.4GHz) | -51  | WPA2-PSK        | FC:34:97:AF:71:30 | Disable
    2    | Hizzulon                         8     | 48   (5GHz  ) | -62  | WPA2-PSK        | FC:34:97:AF:71:34 | Disable
    3    |                                  0     | 161  (5GHz  ) | -66  | WPA2-PSK        | BA:34:97:AF:71:3D | Disable
    4    |                                  0     | 161  (5GHz  ) | -66  | WPA2-PSK        | FC:34:97:AF:71:38 | Disable
    5    |                                  0     | 48   (5GHz  ) | -82  | WPA2-PSK        | 22:EF:BD:34:5E:DF | Disable
    6    | ATT5cs7fRv_Guest                 16    | 10   (2.4GHz) | -82  | WPA2-PSK        | C2:BD:13:3B:A3:2A | Optional
    7    | CocktailClub                     12    | 10   (2.4GHz) | -84  | WPA2-PSK        | A0:2D:13:3B:A3:29 | Disable
    8    |                                  0     | 149  (5GHz  ) | -86  | WPA2-PSK        | BC:9A:8E:33:9A:7F | Optional
    9    | Padres19                         8     | 149  (5GHz  ) | -86  | WPA2-PSK        | BC:9A:8E:33:9A:7C | Optional
    10   | MySpectrumWiFiD9-2G              19    | 11   (2.4GHz) | -86  | WPA2-PSK        | C8:B4:22:2A:13:D7 | Disable
    11   |                                  0     | 1    (2.4GHz) | -87  | WPA2-PSK        | 7A:83:C2:03:48:A8 | Disable
    12   | CocktailClub                     12    | 11   (2.4GHz) | -89  | WPA2-PSK        | A0:2D:13:64:CC:E5 | Disable
    13   | c67a96cd                         8     | 1    (2.4GHz) | -91  | WPA2-PSK        | 50:2C:C6:7A:96:CD | Disable
    Scan request done
    
    uart:~$ wifi connect -s Hizzulon <credentials>
    debug event 00001122  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000001  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    Connection requested
    uart:~$ debug event 00112700  00000000  00000002  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000003  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000004  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000005  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000006  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000007  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000008  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000009  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000000a  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000000b  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000000c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000000d  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000000e  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00001124  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00113000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00113001  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00001122  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000024  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000028  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000002c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000030  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000034  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000038  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000003c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000040  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000064  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000068  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000006c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000070  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000074  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000078  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000007c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000080  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000084  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000088  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000008c  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000090  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000095  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  00000099  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  0000009d  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  000000a1  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  000000a5  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  000000a9  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  000000ad  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00112700  00000000  000000b1  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00001124  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00113000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00113001  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00214002  00000008  00000020  00400000  0000034f  00000008  00000000  00000000  00000002  00000003
    Connected
    [00:00:26.614,074] <inf> wpa_supp: wlan0: SME: Trying to authenticate with fc:34:97:af:71:34 (SSID='Hizzulon' freq=5240 MHz)
    [00:00:26.974,029] <inf> wpa_supp: wlan0: Trying to associate with fc:34:97:af:71:34 (SSID='Hizzulon' freq=5240 MHz)
    [00:00:26.990,783] <inf> wpa_supp: wlan0: Associated with fc:34:97:af:71:34
    [00:00:26.990,966] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
    [00:00:27.018,798] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with fc:34:97:af:71:34 [PTK=CCMP GTK=CCMP]
    [00:00:27.019,012] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to fc:34:97:af:71:34 completed [id=0 id_str=]
    [00:00:27.032,592] <inf> net_dhcpv4: Received: 192.168.1.203
    uart:~$ debug event 00214002  00000008  00000020  00400000  0000000c  00000000  00000000  00000000  00000002  800402e8
    
    uart:~$ wifi status
    Status: successful
    ==================
    State: COMPLETED
    Interface Mode: STATION
    Link Mode: WIFI 6 (802.11ax/HE)
    SSID: Hizzulon
    BSSID: FC:34:97:AF:71:34
    Band: 5GHz
    Channel: 48
    Security: WPA2-PSK
    MFP: Optional
    RSSI: -59
    Beacon Interval: 100
    DTIM: 1
    TWT: Supported
    Current PHY rate : 0
    
    uart:~$ wifi scan -b 5 -c 5:48
    Scan requested
    uart:~$ debug event 00001122  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00001124  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00113000  00000000  00000000  00000000  00000000  00000000  ffffffff  00000005  00000000  00000000
    debug event 00113001  00000000  00000000  00000000  00000000  00000000  ffffffff  00000005  00000000  00000000
    
    Num  | SSID                             (len) | Chan (Band)   | RSSI | Security        | BSSID             | MFP
    1    | Hizzulon                         8     | 48   (5GHz  ) | -58  | WPA2-PSK        | FC:34:97:AF:71:34 | Disable
    Scan request done
    
    uart:~$ wifi scan -b 5 -c 5:44
    Scan requested
    uart:~$ debug event 00001122  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00001124  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00113000  00000000  00000000  00000000  00000000  00000000  ffffffff  00000005  00000000  00000000
    debug event 00113001  00000000  00000000  00000000  00000000  00000000  ffffffff  00000005  00000000  00000000
    Scan request done
    
    uart:~$ wifi scan -b 5 -c 5:165
    Scan requested
    uart:~$ debug event 00001122  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00001124  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    debug event 00113000  00000000  00000000  00000000  00000000  00000000  ffffffff  00000005  00000000  00000000
    debug event 00214002  00000008  00000004  00400040  00000006  00000000  00000000  00000000  00000000  00000000
    debug event 00214002  00000008  00000004  00400040  00000006  00000000  00000000  00000000  00000000  00000000
    ... many repeats of last line
    [00:01:16.191,864] <err> wifi_nrf: zep_shim_llist_node_alloc: Unable to allocate memory for linked list node
    [00:01:16.191,894] <err> wifi_nrf: nrf_wifi_utils_list_add_tail: Unable to allocate list node
    [00:01:16.191,925] <err> wifi_nrf: hal_rpu_event_get: Unable to queue event
    [00:01:16.191,955] <err> wifi_nrf: hal_rpu_event_get_all: Failed to queue event
    uart:~$ debug event 00214002  00000008  00000004  00400040  00000006  00000000  00000000  00000000  00000000  00000000
    debug event 00214002  00000008  00000004  00400040  00000006  00000000  00000000  00000000  00000000  00000000
    ... last line repeats forever (more than 30 seconds)
    

    The "unable to allocate" messages in the bad scan are new. I also sometimes see 

    [00:01:27.330,322] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (84 bytes)

    Those may be due to the new logging.

    I have two nRF7002-DK boards, both marked PCA10143 1.0.2 2023.25. Both have the same behavior. Our own board using nRF7002 also behaves the same.

    I connected to the Asus AP, a Pixel8, and an iPhone SE. All show the same scan failure on channel 165. Disabled the other APs so they wouldn't interfere. I don't have a Faraday cage, but I used some metal to isolate to just the DK and a phone hotspot to eliminate the possibility that farther APs were interfering, same result.

Related