There is no fun in IoT without a network connection. Lets connect our ESP32 to a WiFi access point.
In this post we will connect to given SSID and print the IP of the ESP32
The WiFi Driver provided in ESP-IDF , communicates to the user code through events and callbacks. When ever there is change in the WiFi state , the WiFi driver will call the event handler ( that was added using esp_event_loop_init ) with the specific event , we can write a switch to find the event that is occured take appropriate action.