diff --git a/src/WiFiConfig.cpp b/src/WiFiConfig.cpp index 51ccfa5..e97e20f 100644 --- a/src/WiFiConfig.cpp +++ b/src/WiFiConfig.cpp @@ -11,6 +11,9 @@ # include # include #endif +#ifdef USE_WIFICONFIG_ARDUINO_OTA +# include +#endif #if defined(ESP8266) // ESP8266 @@ -628,6 +631,9 @@ wificonfigresult_t WiFiConfig::_setupAP(wificonfig_cb cb) yield(); }); #endif +#ifdef USE_WIFICONFIG_ARDUINO_OTA + ArduinoOTA.begin(); +#endif #ifdef USE_WIFICONFIG_FSEDITOR #if 0 #if defined(ESP8266) @@ -661,6 +667,9 @@ wificonfigresult_t WiFiConfig::_setupAP(wificonfig_cb cb) if (cb) cb(WCS_CONFIGWAIT); // volame uzivatelsky callback (napr. signalizace) dnsServer->processNextRequest(); +#ifdef USE_WIFICONFIG_ARDUINO_OTA + ArduinoOTA.handle(); +#endif yield(); // procesy uvnitr systemu ESP potrebuji take svuj cas if (_timeout) { if (millis() > _time) { @@ -674,6 +683,9 @@ wificonfigresult_t WiFiConfig::_setupAP(wificonfig_cb cb) // tady by asi melo byt zastaveni weboveho a dns serveru... dnsServer->stop(); server->end(); +#ifdef USE_WIFICONFIG_ARDUINO_OTA + ArduinoOTA.end(); +#endif return WCR_TIMEOUT; // nepripojeno, vyprsel timeout konfiguracniho AP }