not ready

This commit is contained in:
richonguzman 2023-12-19 08:09:20 -03:00
parent 01df1d5ae6
commit 6b6ae70826
5 changed files with 26 additions and 17 deletions

View File

@ -21,7 +21,7 @@ lib_deps =
adafruit/Adafruit GFX Library @ 1.11.5 adafruit/Adafruit GFX Library @ 1.11.5
adafruit/Adafruit SSD1306 @ 2.5.7 adafruit/Adafruit SSD1306 @ 2.5.7
ayushsharma82/ElegantOTA@^3.1.0 ayushsharma82/ElegantOTA@^3.1.0
ottowinter/ESPAsyncWebServer-esphome@^3.0.0 ottowinter/ESPAsyncWebServer-esphome@^3.1.0
esphome/AsyncTCP-esphome@^2.0.0 esphome/AsyncTCP-esphome@^2.0.0
mikalhart/TinyGPSPlus @ 1.0.3 mikalhart/TinyGPSPlus @ 1.0.3
adafruit/Adafruit Unified Sensor@^1.1.9 adafruit/Adafruit Unified Sensor@^1.1.9

View File

@ -1,4 +1,4 @@
#include <ElegantOTA.h> //#include <ElegantOTA.h>
#include <Arduino.h> #include <Arduino.h>
#include <LoRa.h> #include <LoRa.h>
#include <WiFi.h> #include <WiFi.h>
@ -21,7 +21,7 @@
Configuration Config; Configuration Config;
WiFiClient espClient; WiFiClient espClient;
String versionDate = "2023.12.07"; String versionDate = "2023.12.19";
int myWiFiAPIndex = 0; int myWiFiAPIndex = 0;
int myWiFiAPSize = Config.wifiAPs.size(); int myWiFiAPSize = Config.wifiAPs.size();
WiFi_AP *currentWiFi = &Config.wifiAPs[myWiFiAPIndex]; WiFi_AP *currentWiFi = &Config.wifiAPs[myWiFiAPIndex];
@ -90,5 +90,5 @@ void loop() {
DIGI_Utils::loop(); DIGI_Utils::loop();
} }
} }
ElegantOTA.loop(); //ElegantOTA.loop();
} }

View File

@ -1,4 +1,5 @@
#include <WiFi.h> #include <WiFi.h>
//#include <ElegantOTA.h>
#include "configuration.h" #include "configuration.h"
#include "aprs_is_utils.h" #include "aprs_is_utils.h"
#include "station_utils.h" #include "station_utils.h"
@ -220,6 +221,7 @@ namespace APRS_IS_Utils {
processAPRSISPacket(aprsisPacket); processAPRSISPacket(aprsisPacket);
} }
} }
//ElegantOTA.loop();
} }
} }

View File

@ -314,10 +314,14 @@ namespace Utils {
void onOTAStart() { void onOTAStart() {
Serial.println("OTA update started!"); 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) { void onOTAEnd(bool success) {
display_toggle(true);
lastScreenOn = millis();
if (success) { if (success) {
Serial.println("OTA update finished successfully!"); Serial.println("OTA update finished successfully!");
show_display("", "", " OTA update success!", "", " Rebooting ...", "", "", 2000); show_display("", "", " OTA update success!", "", " Rebooting ...", "", "", 2000);
@ -330,7 +334,7 @@ namespace Utils {
void startServer() { void startServer() {
if (stationMode==1 || stationMode==2 || (stationMode==5 && WiFi.status()==WL_CONNECTED)) { if (stationMode==1 || stationMode==2 || (stationMode==5 && WiFi.status()==WL_CONNECTED)) {
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) { 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) { server.on("/test", HTTP_GET, [](AsyncWebServerRequest *request) {
@ -349,7 +353,7 @@ namespace Utils {
// //
ElegantOTA.onStart(onOTAStart); ElegantOTA.onStart(onOTAStart);
//ElegantOTA.onProgress(onOTAProgress); //ElegantOTA.onProgress(onOTAProgress);
ElegantOTA.onEnd(onOTAEnd); //ElegantOTA.onEnd(onOTAEnd);
// //
server.on("/process_form.php", HTTP_POST, [](AsyncWebServerRequest *request){ server.on("/process_form.php", HTTP_POST, [](AsyncWebServerRequest *request){
@ -375,6 +379,7 @@ namespace Utils {
server.begin(); server.begin();
Serial.println("init : OTA Server ... done!"); Serial.println("init : OTA Server ... done!");
ElegantOTA.loop();
} }
} }

View File

@ -5,16 +5,18 @@
namespace Utils { namespace Utils {
void processStatus(); void processStatus();
String getLocalIP(); String getLocalIP();
void setupDisplay(); void setupDisplay();
void activeStations(); void activeStations();
void checkBeaconInterval(); void checkBeaconInterval();
void checkDisplayInterval(); void checkDisplayInterval();
void checkWiFiInterval(); void checkWiFiInterval();
void validateDigiFreqs(); void validateDigiFreqs();
void typeOfPacket(String packet, String packetType); void typeOfPacket(String packet, String packetType);
void startServer(); void onOTAStart();
void onOTAEnd(bool success);
void startServer();
} }