test OTA also (only Firmwares and not Filesystem!)

This commit is contained in:
richonguzman 2023-06-10 20:11:20 -04:00
parent 2d4b5c6758
commit 11b45a2345
4 changed files with 20 additions and 12 deletions

View file

@ -5,6 +5,11 @@
#include "lora_utils.h"
#include "display.h"
#include "utils.h"
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <AsyncElegantOTA.h>
AsyncWebServer server(80);
extern WiFiClient espClient;
extern Configuration Config;
@ -132,4 +137,15 @@ void typeOfPacket(String packet) {
}
}
void startOTAServer() {
if (stationMode==1 || stationMode==2) {
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send(200, "text/plain", "Hi This is your Richonguzman / CD2RXU LoRa iGate.\nIf you want tu update your firmware please go to: {iGate-IP-Adress}/update");
});
AsyncElegantOTA.begin(&server);
server.begin();
Serial.println("HTTP server started (OTA Firmware Updates)!\n");
}
}
}