not ready
This commit is contained in:
parent
01df1d5ae6
commit
6b6ae70826
|
|
@ -21,7 +21,7 @@ lib_deps =
|
|||
adafruit/Adafruit GFX Library @ 1.11.5
|
||||
adafruit/Adafruit SSD1306 @ 2.5.7
|
||||
ayushsharma82/ElegantOTA@^3.1.0
|
||||
ottowinter/ESPAsyncWebServer-esphome@^3.0.0
|
||||
ottowinter/ESPAsyncWebServer-esphome@^3.1.0
|
||||
esphome/AsyncTCP-esphome@^2.0.0
|
||||
mikalhart/TinyGPSPlus @ 1.0.3
|
||||
adafruit/Adafruit Unified Sensor@^1.1.9
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include <ElegantOTA.h>
|
||||
//#include <ElegantOTA.h>
|
||||
#include <Arduino.h>
|
||||
#include <LoRa.h>
|
||||
#include <WiFi.h>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
Configuration Config;
|
||||
WiFiClient espClient;
|
||||
|
||||
String versionDate = "2023.12.07";
|
||||
String versionDate = "2023.12.19";
|
||||
int myWiFiAPIndex = 0;
|
||||
int myWiFiAPSize = Config.wifiAPs.size();
|
||||
WiFi_AP *currentWiFi = &Config.wifiAPs[myWiFiAPIndex];
|
||||
|
|
@ -90,5 +90,5 @@ void loop() {
|
|||
DIGI_Utils::loop();
|
||||
}
|
||||
}
|
||||
ElegantOTA.loop();
|
||||
//ElegantOTA.loop();
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
#include <WiFi.h>
|
||||
//#include <ElegantOTA.h>
|
||||
#include "configuration.h"
|
||||
#include "aprs_is_utils.h"
|
||||
#include "station_utils.h"
|
||||
|
|
@ -220,6 +221,7 @@ namespace APRS_IS_Utils {
|
|||
processAPRSISPacket(aprsisPacket);
|
||||
}
|
||||
}
|
||||
//ElegantOTA.loop();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -314,10 +314,14 @@ namespace Utils {
|
|||
|
||||
void onOTAStart() {
|
||||
Serial.println("OTA update started!");
|
||||
show_display("", "", " OTA update started!", "", "", "", "", 100);
|
||||
display_toggle(true);
|
||||
lastScreenOn = millis();
|
||||
show_display("", "***** *", "", " OTA update started!", "", "", "", 1000);
|
||||
}
|
||||
|
||||
void onOTAEnd(bool success) {
|
||||
display_toggle(true);
|
||||
lastScreenOn = millis();
|
||||
if (success) {
|
||||
Serial.println("OTA update finished successfully!");
|
||||
show_display("", "", " OTA update success!", "", " Rebooting ...", "", "", 2000);
|
||||
|
|
@ -330,7 +334,7 @@ namespace Utils {
|
|||
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/CA2RXU) 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/CA2RXU) 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("/test", HTTP_GET, [](AsyncWebServerRequest *request) {
|
||||
|
|
@ -349,7 +353,7 @@ namespace Utils {
|
|||
//
|
||||
ElegantOTA.onStart(onOTAStart);
|
||||
//ElegantOTA.onProgress(onOTAProgress);
|
||||
ElegantOTA.onEnd(onOTAEnd);
|
||||
//ElegantOTA.onEnd(onOTAEnd);
|
||||
//
|
||||
|
||||
server.on("/process_form.php", HTTP_POST, [](AsyncWebServerRequest *request){
|
||||
|
|
@ -375,6 +379,7 @@ namespace Utils {
|
|||
|
||||
server.begin();
|
||||
Serial.println("init : OTA Server ... done!");
|
||||
ElegantOTA.loop();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
22
src/utils.h
22
src/utils.h
|
|
@ -5,16 +5,18 @@
|
|||
|
||||
namespace Utils {
|
||||
|
||||
void processStatus();
|
||||
String getLocalIP();
|
||||
void setupDisplay();
|
||||
void activeStations();
|
||||
void checkBeaconInterval();
|
||||
void checkDisplayInterval();
|
||||
void checkWiFiInterval();
|
||||
void validateDigiFreqs();
|
||||
void typeOfPacket(String packet, String packetType);
|
||||
void startServer();
|
||||
void processStatus();
|
||||
String getLocalIP();
|
||||
void setupDisplay();
|
||||
void activeStations();
|
||||
void checkBeaconInterval();
|
||||
void checkDisplayInterval();
|
||||
void checkWiFiInterval();
|
||||
void validateDigiFreqs();
|
||||
void typeOfPacket(String packet, String packetType);
|
||||
void onOTAStart();
|
||||
void onOTAEnd(bool success);
|
||||
void startServer();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue