diff --git a/main/wifi.c b/main/wifi.c --- a/main/wifi.c +++ b/main/wifi.c @@ -34,7 +34,7 @@ static void __event_handler(void* arg, e esp_wifi_connect(); s_retry_num++; ESP_LOGI(TAG, "retry to connect to the AP"); - display_update_text("AP Connect Retry"); + //display_update_text("AP Connect Retry"); } else @@ -42,16 +42,18 @@ static void __event_handler(void* arg, e xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT); } ESP_LOGI(TAG,"connect to the AP fail"); - display_update_text("AP Connect Fail"); + //display_update_text("AP Connect Fail"); } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data; - ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip)); + ESP_LOGI(TAG, "WIFI OK, IP: " IPSTR, IP2STR(&event->ip_info.ip)); char out[128] = {0}; - snprintf(out, 128, "Got IP " IPSTR, IP2STR(&event->ip_info.ip)); + snprintf(out, 128, "WIFI OK, IP: " IPSTR, IP2STR(&event->ip_info.ip)); display_update_text(out); + + s_retry_num = 0; xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT); }