Can I use the shutdown function in AP or STA mode?

uart:~$ ITS RX: cmd=0x08, len=1, data: 00
[00:00:48.651,428] <inf> app_bluetooth: Wi-Fi: shutdown via wifi_cli_do_shutdown()
[00:00:48.651,458] <err> wpa_supp: Interface nordic_wlan0 is not in STA mode
[00:00:48.651,519] <err> wpa_supp: Disconnect failed: Device or resource busy
[00:00:48.789,245] <inf> wpa_supp: nordic_wlan0: interface state ENABLED->DISABLED
[00:00:48.789,489] <inf> wpa_supp: nordic_wlan0: AP-STA-DISCONNECTED 3a:f3:79:34:da:ef
[00:00:48.789,642] <err> wpa_supp: wpa_drv_zep_sta_set_flags: sta_set_flags op failed: -1

ITS RX: cmd=0x08, len=1, data:00:00:48.789,703] <err> wpa_supp: wpa_drv_zep_sta_remove: sta_remove op failed: -1

32m 00
[00:00:48.651,428] <inf> app_bluetooth: Wi-Fi: shutdown via wifi_cli_do_shutdown()
[00:00:48.789,916] <err> wpa_supp: wpa_drv_zep_set_ap: change_beacon op failed: -1

[00:00:48.651,458] <err> wpa_supp: Interface nordic_wlan0 is not in STA mode
[00:00:48.651,519] <err> wpa_supp: Disconnect failed: Device or resource busy
00:00:48.789,947] <err> wpa_supp: Failed to set beacon parameters
[00:00:48.790,161] <err> wpa_supp: wpa_drv_zep_send_mlme: send_mlme op failed: -1

;32m[00:00:48.789,245] <inf> wpa_supp: nordic_wlan0: interface state ENABLED->DISABLED
00:00:48.790,222] <inf> wpa_supp: nordic_wlan0: AP-DISABLED 
m[00:00:48.789,489] <inf> wpa_supp: nordic_wlan0: AP-STA-DISCONNECTED 3a:f3:79:34:da:ef
00:00:48.790,710] <err> wpa_supp: wpa_drv_zep_deinit_ap: deinit_ap op failed: -1

2m[00:00:48.789,642] <err> wpa_supp: wpa_drv_zep_sta_set_flags: sta_set_flags op failed: -1

00:00:48.790,832] <inf> wpa_supp: nordic_wlan0: CTRL-EVENT-DISCONNECTED bssid=f4:ce:36:00:14:54 reason=3 locally_generated=1
2m[00:00:48.789,703] <err> wpa_supp: wpa_drv_zep_sta_remove: sta_remove op failed: -1

[00:00:48.789,916] <err> wpa_supp: wpa_drv_zep_set_ap: change_beacon op failed: -1

[00:00:48.789,947] <err> wpa_supp: Failed to set beacon parameters
00:00:48.791,595] <inf> wifi_ctrl: Wi-Fi down.
[00:00:48.800,872] <inf> wpa_supp: nordic_wlan0: CTRL-EVENT-DSCP-POLICY clear_all
[00:00:48.801,208] <inf> wpa_supp: nordic_wlan0: CTRL-EVENT-DSCP-POLICY clear_all
1;32m[00:00:48.790,161] <err> wpa_supp: wpa_drv_zep_send_mlme: send_mlme op failed: -1

00:00:48.802,001] <inf> wifi_softap_mode: Station disconnected: 3A:F3:79:34:DA:EF
[00:00:48.802,001] <inf> wifi_softap_mode: AP stations:
1;32m[00:00:48.790,222] <inf> wpa_supp: nordic_wlan0: AP-DISABLED 
00:00:48.802,001] <inf> wifi_softap_mode: ============
[00:00:48.802,001] <inf> wifi_softap_mode: No stations connected
[00:00:48.802,032] <inf> wifi_softap_mode: 
Wi-Fi Camera SofAP is disconnected. Ready for new Wi-Fi connection.

1;32m[00:00:48.790,710] <err> wpa_supp: wpa_drv_zep_deinit_ap: deinit_ap op failed: -1

00:00:48.802,032] <inf> wifi_softap_mode: 

Running on WiFi SoftAP mode.
Please connect PC WiFi network to SSID 'WiFi_Cam_Demo_AP' and password 'nRF7002DK'.

When I tried the official sample: nrf 70-wifi-ble-image-transfer-demo, and tried to apply the shutdown operation to it, I found that there would be many problems with the AP mode shutdown. One of them was: after the shutdown, it was immediately restarted and displayed as successfully started, but there was no WiFi signal.
i use "net_if *iface","wifi_softap_mode_ready();" these kinds of code included in the official code.

  • After many tests, I found that the problem may be that the buffer of nrf7002dk is insufficient. In my experiment, if I want to shutdown the wifi, if I turn on the wifi, I can't turn on the streaming transmission, otherwise the buffer will be insufficient.

  • Hello,

    Which SDK version are you using? Could you check the Wi-Fi shutdown sample and compare your sequence to the sample’s flow/order? Also, the logs indicate the device is not in STA mode, are you attempting an STA disconnect while in SoftAP?

    Kind regards,
    Abhijith

  • using 2.7.0 SDK and toolchain, i tried wifi shutdown sample and knew the official recommended version is 3.0 above, but  my "nrf 70-wifi-ble-image-transfer-demo" should use  version 2.7.0. And after your reply, I tried to startup Softap mode while in Softap mode , it seems like buffer is too small for Spftap and other operations ,like DHCP. 
    Regarding the buffer issue, I've already set the buffer to its maximum value in the prj. Since we have other tasks, such as Bluetooth connections, the buffer allocated to the network is limited. I'm wondering if SoftAP can actually be started? What's the correct process?


    Is there a command to clear the network stack? We need to use Wi-Fi to transfer images before shutting down. I think these image transfers occupy the network stack, for example:
    CONFIG_NET_MGMT_EVENT_STACK_SIZE
    CONFIG_NET_BUF_DATA_SIZE
    CONFIG_HEAP_MEM_POOL_SIZE



    edited:I solved the problem. I must close the socket push stream before shutdown.
    Thank u very much!

    [00:00:53.281,799] <err> wpa_supp: Failed to open monitor connection: Not enough space 
    [00:00:53.282,135] <inf> wpa_supp: Failed to initialize control interface: nordic_wlan0: -1 
    [00:00:53.282,165] <err> wpa_supp: Failed to initialize control interface 
    [00:00:53.282,470] <err> wifi_nrf: nrf_wifi_reg_domain: WPA supplicant initialization not complete yet 
    [00:00:53.282,501] <err> wifi_softap_mode: Cannot SET Regulatory domain: -1
    [00:00:53.282,714] <err> wifi_softap_mode: AP mode enable failed: Not supported 
    [00:00:53.282,745] <err> wifi_softap_mode: Status request failed

Related