This commit is contained in:
richonguzman 2023-08-28 23:21:20 -04:00
parent 1b28beb3f4
commit 0870ae39d8
6 changed files with 45 additions and 15 deletions

View file

@ -262,7 +262,7 @@ void typeOfPacket(String packet, String packetType) {
}
}
void startOTAServer() {
void startServer() {
if (stationMode==1 || stationMode==2 || (stationMode==5 && WiFi.status() == WL_CONNECTED)) {
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send(200, "text/plain", "Hi " + Config.callsign + ", \n\nthis is your (Richonguzman/CD2RXU) LoRa iGate , version " + versionDate + ".\n\nTo update your firmware or filesystem go to: http://" + getLocalIP().substring(getLocalIP().indexOf(":")+3) + "/update\n\n\n73!");
@ -276,6 +276,10 @@ void startOTAServer() {
request->send(LittleFS, "/index2.html", "text/html");
});
server.on("/testx", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send(LittleFS, "/testx.html", "text/html");//"application/json");
});
if (Config.ota.username != "" && Config.ota.password != "") {
AsyncElegantOTA.begin(&server, Config.ota.username.c_str(), Config.ota.password.c_str());
} else {