From b41d70993d1b0c8979592143af1f04407c2e7a3c Mon Sep 17 00:00:00 2001 From: sparker <54767129+sparkertim@users.noreply.github.com> Date: Mon, 11 Dec 2023 17:02:57 +0800 Subject: [PATCH] fix dpp init error fix dpp init error, set wifi mode before call esp_supp_dpp_init --- .../wifi_easy_connect/dpp-enrollee/main/dpp_enrollee_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/wifi/wifi_easy_connect/dpp-enrollee/main/dpp_enrollee_main.c b/examples/wifi/wifi_easy_connect/dpp-enrollee/main/dpp_enrollee_main.c index 76a8fee4079..166d66a591c 100644 --- a/examples/wifi/wifi_easy_connect/dpp-enrollee/main/dpp_enrollee_main.c +++ b/examples/wifi/wifi_easy_connect/dpp-enrollee/main/dpp_enrollee_main.c @@ -155,9 +155,9 @@ void dpp_enrollee_init(void) wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_ERROR_CHECK(esp_supp_dpp_init(dpp_enrollee_event_cb)); ESP_ERROR_CHECK(dpp_enrollee_bootstrap()); - ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_ERROR_CHECK(esp_wifi_start()); /* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum