(solved) esp_event_loop_create_default() returned ESP_ERR_INVALID_STATE
Posted: Fri Oct 29, 2021 4:20 am
Hi all -
Trying to write an initialization routine...starts like this:
And the call to esp_event_loop_create_default() returns ESP_ERR_INVALID_STATE.
What state is the error message referring to? And, what could be causing this so early in the routine?
Thanks...
Trying to write an initialization routine...starts like this:
Code: Select all
esp_err_t wifiInit(wifi_mode_t mode) {
esp_err_t err = ESP_OK;
do {
// step 1 in https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/wifi.html:
// Wifi/LwIP Init.
// step 1.1: call esp_netif_init()
err = esp_netif_init();
if (err != ESP_OK) {
ESP_LOGE(TAG, "wifiInit(): esp_netif_init() returned \"%s\".", esp_err_to_name(err));
continue;
}
// step 1.2
// identify the event handler.
err = esp_event_loop_create_default();
if (err != ESP_OK) {
ESP_LOGE(TAG, "wifiInit(): esp_event_loop_create_default() returned \"%s\".", esp_err_to_name(err));
continue;
}
What state is the error message referring to? And, what could be causing this so early in the routine?
Thanks...