diff --git a/lib/IotWebConf/src/IotWebConf.cpp b/lib/IotWebConf/src/IotWebConf.cpp index 528614d..5c486f9 100644 --- a/lib/IotWebConf/src/IotWebConf.cpp +++ b/lib/IotWebConf/src/IotWebConf.cpp @@ -160,7 +160,11 @@ boolean IotWebConf::init() MDNS.begin(this->_thingName); MDNS.addService("http", "tcp", 80); #endif - +#ifdef USE_ESPASYNCWEBSERVER + // This is required to init wifi already within setup + // (Otherwise AsyncWebserver will crash on begin) + doLoop(); +#endif return validConfig; } diff --git a/src/main.cpp b/src/main.cpp index 0ccdd99..1c4f2ee 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -173,7 +173,6 @@ void setup() mqttUserNameValue[0] = '\0'; mqttUserPasswordValue[0] = '\0'; } - iotWebConf.doLoop(); // Init WebServer rootHandler = new AsyncCallbackWebHandler();