mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-08-07 09:22:57 +02:00
test OTA also (only Firmwares and not Filesystem!)
This commit is contained in:
+2
-11
@@ -13,15 +13,11 @@
|
||||
#include "gps_utils.h"
|
||||
#include "display.h"
|
||||
#include "utils.h"
|
||||
/*#include <AsyncTCP.h>
|
||||
#include <ESPAsyncWebServer.h>
|
||||
#include <AsyncElegantOTA.h>*/
|
||||
|
||||
Configuration Config;
|
||||
WiFiClient espClient;
|
||||
//AsyncWebServer server(80);
|
||||
|
||||
String versionDate = "2023.06.09";
|
||||
String versionDate = "2023.06.10";
|
||||
int myWiFiAPIndex = 0;
|
||||
int myWiFiAPSize = Config.wifiAPs.size();
|
||||
WiFi_AP *currentWiFi = &Config.wifiAPs[myWiFiAPIndex];
|
||||
@@ -49,12 +45,7 @@ void setup() {
|
||||
LoRa_Utils::setup();
|
||||
utils::validateDigiFreqs();
|
||||
iGateBeaconPacket = GPS_Utils::generateBeacon();
|
||||
/*server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
|
||||
request->send(200, "text/plain", "Hi! I am ESP32.");
|
||||
});
|
||||
AsyncElegantOTA.begin(&server); // Start ElegantOTA
|
||||
server.begin();
|
||||
Serial.println("HTTP server started");*/
|
||||
utils::startOTAServer();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ void setup() {
|
||||
LoRa.setCodingRate4(Config.loramodule.codingRate4);
|
||||
LoRa.enableCrc();
|
||||
LoRa.setTxPower(Config.loramodule.power);
|
||||
Serial.println("LoRa init done!\n");
|
||||
Serial.println("LoRa init done!");
|
||||
}
|
||||
|
||||
void sendNewPacket(const String &typeOfMessage, const String &newPacket) {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ void checkBeaconInterval();
|
||||
void checkDisplayInterval();
|
||||
void validateDigiFreqs();
|
||||
void typeOfPacket(String packet);
|
||||
void startOTAServer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user