#include <WiFiManager.h>
void setup() {
Serial.begin(115200);
WiFiManager wm;
// Uncomment the following line to reset settings for testing purposes
// wm.resetSettings();
// Try to connect to previously saved WiFi credentials.
if (!wm.autoConnect("Wokwi-Guest")) {
Serial.println("Failed to connect and hit timeout");
// Reset and try again, or maybe put it to deep sleep
ESP.restart();
} else {
// If connection successful
Serial.println("Connected to WiFi!");
}
}
void loop() {
// Your main code here
}