diff --git a/main/wifi.c b/main/wifi.c --- a/main/wifi.c +++ b/main/wifi.c @@ -8,6 +8,7 @@ #include "esp_log.h" #include "lwip/err.h" #include "lwip/sys.h" +#include "display.h" // Private variables @@ -31,17 +32,24 @@ 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"); + } else { xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT); } ESP_LOGI(TAG,"connect to the AP 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)); + char out[128] = {0}; + snprintf(out, 128, "Got IP " IPSTR, IP2STR(&event->ip_info.ip)); + display_update_text(out); s_retry_num = 0; xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT); }