init_wifi.ino
void init_wifi() {
wifi.init();
wifi.on_connecting([&](const void* message)
{
Serial.print("Connecting to ");
Serial.println(wifi.get("ssid") + ", " + wifi.get("password"));
delay(200);
});
wifi.on_connected([&](const void* message)
{
// Print the IP address
Serial.print("WIFI CONNECTED => ");
Serial.println(WiFi.localIP());
init_webserver();
server.begin();
Serial.println("SERVER Started.");
});
wifi.on_disconnected([&](const void* message) {
server.close();
});
}