first test

This commit is contained in:
richonguzman 2023-08-27 08:47:39 -04:00
parent 8dd01f799e
commit 44c94d454b
2 changed files with 16 additions and 2 deletions

View file

@ -20,7 +20,7 @@
Configuration Config;
WiFiClient espClient;
String versionDate = "2023.08.19";
String versionDate = "2023.08.27";
int myWiFiAPIndex = 0;
int myWiFiAPSize = Config.wifiAPs.size();
WiFi_AP *currentWiFi = &Config.wifiAPs[myWiFiAPIndex];

View file

@ -44,6 +44,11 @@ extern String versionDate;
extern uint32_t lastWiFiCheck;
extern bool WiFiConnect;
//
const char* htmlPage1 = "<html><body><h1>Page 1</h1></body></html>";
const char* htmlPage2 = "<html><body><h1>Page 2</h1></body></html>";
//
namespace Utils {
void processStatus() {
@ -264,8 +269,17 @@ void typeOfPacket(String packet, String packetType) {
void startOTAServer() {
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!");
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!");
});
server.on("/test1", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send(200, "text/plain", htmlPage1 );
});
server.on("/test2", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send(200, "text/plain", htmlPage2 );
});
AsyncElegantOTA.begin(&server);
server.begin();
Serial.println("init : OTA Server ... done!");