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
  • Hi again Remi

    Enjoy your vacation then!

    When you get back, please confirm which AP model you're using. Unfortunately the log you've provided doesn't have enough debugging to narrow down what exactly is wrong, but here is a .hex file you can use with some more debugging options enabled you can run on a DK and test when you get back: 5270.zephyr.hex

    For reference, we also tested using a Pixel 7 on our end, but were not able to reproduce with that.

    Best regards,

    Simon

  • Here are the results with the 5270.zephyr.hex test image:

    [00:00:00.616,210] <inf> fs_nvs: 2 Sectors of 4096 bytes
    [00:00:00.616,241] <inf> fs_nvs: alloc wra: 0, fe8
    [00:00:00.616,241] <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.618,194] <inf> wifi_supplicant: wpa_supplicant initialized


    uart:~$ wifi scan -b 5
    Scan requested
    uart:~$ debug event 1122 0000 0000
    debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 113001 0000 0000

    Num | SSID (len) | Chan (Band) | RSSI | Security | BSSID | MFP
    1 | 0 | 161 (5GHz ) | -58 | WPA2-PSK | BA:34:97:AF:71:3D | Disable
    2 | 0 | 161 (5GHz ) | -58 | WPA2-PSK | FC:34:97:AF:71:38 | Disable
    3 | Hizzulon 8 | 48 (5GHz ) | -63 | WPA2-PSK | FC:34:97:AF:71:34 | Disable
    4 | 0 | 48 (5GHz ) | -80 | WPA2-PSK | 22:EF:BD:34:5E:DF | Disable
    Scan request done


    uart:~$ wifi connect -s Hizzulon <credentials>
    debug event 1122 0000 0000
    Connection requested
    uart:~$ debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 113001 0000 0000
    debug event 1122 0000 0000
    debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 113001 0000 0000
    Connected
    [00:01:30.862,121] <inf> wpa_supp: wlan0: SME: Trying to authenticate with fc:34:97:af:71:34 (SSID='Hizzulon' freq=5240 MHz)
    [00:01:31.221,954] <inf> wpa_supp: wlan0: Trying to associate with fc:34:97:af:71:34 (SSID='Hizzulon' freq=5240 MHz)
    [00:01:31.238,494] <inf> wpa_supp: wlan0: Associated with fc:34:97:af:71:34
    [00:01:31.238,677] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
    [00:01:31.257,659] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with fc:34:97:af:71:34 [PTK=CCMP GTK=CCMP]
    [00:01:31.257,873] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to fc:34:97:af:71:34 completed [id=0 id_str=]
    [00:01:31.269,042] <inf> net_dhcpv4: Received: 192.168.1.237
    uart:~$ debug event 114000 0000 0020

    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: -61
    Beacon Interval: 100
    DTIM: 1
    TWT: Supported
    Current PHY rate : 34400
    uart:~$


    uart:~$ wifi scan -b 5 -c 5:48
    Scan requested
    uart:~$ debug event 1122 0000 0000
    debug event 112500 0000 0000
    debug event 112501 0000 0000
    debug event 112502 0000 0000
    debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 113001 0000 0000

    Num | SSID (len) | Chan (Band) | RSSI | Security | BSSID | MFP
    1 | 0 | 48 (5GHz ) | -81 | WPA2-PSK | 22:EF:BD:34:5E:DF | Disable
    Scan request done


    uart:~$ wifi scan -b 5 -c 5:48
    Scan requested
    uart:~$ debug event 1122 0000 0000
    debug event 112500 0000 0000
    debug event 112501 0000 0000
    debug event 112502 0000 0000
    debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 113001 0000 0000

    Num | SSID (len) | Chan (Band) | RSSI | Security | BSSID | MFP
    1 | Hizzulon 8 | 48 (5GHz ) | -61 | WPA2-PSK | FC:34:97:AF:71:34 | Disable
    Scan request done


    uart:~$ wifi scan -b 5 -c 5:165
    Scan requested
    uart:~$ debug event 1122 0000 0000
    debug event 112500 0000 0000
    debug event 112501 0000 0000
    debug event 112502 0000 0000
    debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 114000 0008 0004

    ... repeats "debug event 114000 0008 0004" forever

    Note that there are two devices on channel 48 in the initial scan - the "Hizzulon" AP, and a device with BSSID 22:EF:BD:34:5E:DF at low RSSI (a Roku). The above log shows that the first scan on channel 48 after connecting showed only the second device, not the AP. Doing another scan immediately afterward found the AP. That behavior isn't consistent - it may find one or both. Just including it in the log as it seems unexpected that the scan wouldn't always show the much stronger AP.

Reply
  • Here are the results with the 5270.zephyr.hex test image:

    [00:00:00.616,210] <inf> fs_nvs: 2 Sectors of 4096 bytes
    [00:00:00.616,241] <inf> fs_nvs: alloc wra: 0, fe8
    [00:00:00.616,241] <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.618,194] <inf> wifi_supplicant: wpa_supplicant initialized


    uart:~$ wifi scan -b 5
    Scan requested
    uart:~$ debug event 1122 0000 0000
    debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 113001 0000 0000

    Num | SSID (len) | Chan (Band) | RSSI | Security | BSSID | MFP
    1 | 0 | 161 (5GHz ) | -58 | WPA2-PSK | BA:34:97:AF:71:3D | Disable
    2 | 0 | 161 (5GHz ) | -58 | WPA2-PSK | FC:34:97:AF:71:38 | Disable
    3 | Hizzulon 8 | 48 (5GHz ) | -63 | WPA2-PSK | FC:34:97:AF:71:34 | Disable
    4 | 0 | 48 (5GHz ) | -80 | WPA2-PSK | 22:EF:BD:34:5E:DF | Disable
    Scan request done


    uart:~$ wifi connect -s Hizzulon <credentials>
    debug event 1122 0000 0000
    Connection requested
    uart:~$ debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 113001 0000 0000
    debug event 1122 0000 0000
    debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 113001 0000 0000
    Connected
    [00:01:30.862,121] <inf> wpa_supp: wlan0: SME: Trying to authenticate with fc:34:97:af:71:34 (SSID='Hizzulon' freq=5240 MHz)
    [00:01:31.221,954] <inf> wpa_supp: wlan0: Trying to associate with fc:34:97:af:71:34 (SSID='Hizzulon' freq=5240 MHz)
    [00:01:31.238,494] <inf> wpa_supp: wlan0: Associated with fc:34:97:af:71:34
    [00:01:31.238,677] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
    [00:01:31.257,659] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with fc:34:97:af:71:34 [PTK=CCMP GTK=CCMP]
    [00:01:31.257,873] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to fc:34:97:af:71:34 completed [id=0 id_str=]
    [00:01:31.269,042] <inf> net_dhcpv4: Received: 192.168.1.237
    uart:~$ debug event 114000 0000 0020

    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: -61
    Beacon Interval: 100
    DTIM: 1
    TWT: Supported
    Current PHY rate : 34400
    uart:~$


    uart:~$ wifi scan -b 5 -c 5:48
    Scan requested
    uart:~$ debug event 1122 0000 0000
    debug event 112500 0000 0000
    debug event 112501 0000 0000
    debug event 112502 0000 0000
    debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 113001 0000 0000

    Num | SSID (len) | Chan (Band) | RSSI | Security | BSSID | MFP
    1 | 0 | 48 (5GHz ) | -81 | WPA2-PSK | 22:EF:BD:34:5E:DF | Disable
    Scan request done


    uart:~$ wifi scan -b 5 -c 5:48
    Scan requested
    uart:~$ debug event 1122 0000 0000
    debug event 112500 0000 0000
    debug event 112501 0000 0000
    debug event 112502 0000 0000
    debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 113001 0000 0000

    Num | SSID (len) | Chan (Band) | RSSI | Security | BSSID | MFP
    1 | Hizzulon 8 | 48 (5GHz ) | -61 | WPA2-PSK | FC:34:97:AF:71:34 | Disable
    Scan request done


    uart:~$ wifi scan -b 5 -c 5:165
    Scan requested
    uart:~$ debug event 1122 0000 0000
    debug event 112500 0000 0000
    debug event 112501 0000 0000
    debug event 112502 0000 0000
    debug event 1124 0000 0000
    debug event 113000 0000 0000
    debug event 114000 0008 0004

    ... repeats "debug event 114000 0008 0004" forever

    Note that there are two devices on channel 48 in the initial scan - the "Hizzulon" AP, and a device with BSSID 22:EF:BD:34:5E:DF at low RSSI (a Roku). The above log shows that the first scan on channel 48 after connecting showed only the second device, not the AP. Doing another scan immediately afterward found the AP. That behavior isn't consistent - it may find one or both. Just including it in the log as it seems unexpected that the scan wouldn't always show the much stronger AP.

Children
No Data
Related