diff --git a/data_embed/bootstrap.css.gz b/data_embed/bootstrap.css.gz index a259a6e..ab1a2e6 100644 Binary files a/data_embed/bootstrap.css.gz and b/data_embed/bootstrap.css.gz differ diff --git a/data_embed/bootstrap.js.gz b/data_embed/bootstrap.js.gz index 502fa3d..28396ba 100644 Binary files a/data_embed/bootstrap.js.gz and b/data_embed/bootstrap.js.gz differ diff --git a/data_embed/favicon.png.gz b/data_embed/favicon.png.gz index 25ac4a8..3b7d577 100644 Binary files a/data_embed/favicon.png.gz and b/data_embed/favicon.png.gz differ diff --git a/data_embed/index.html.gz b/data_embed/index.html.gz index 858a514..fc8be65 100644 Binary files a/data_embed/index.html.gz and b/data_embed/index.html.gz differ diff --git a/data_embed/script.js.gz b/data_embed/script.js.gz index 9addd24..367768b 100644 Binary files a/data_embed/script.js.gz and b/data_embed/script.js.gz differ diff --git a/data_embed/style.css.gz b/data_embed/style.css.gz index 6b6da1c..9ecf866 100644 Binary files a/data_embed/style.css.gz and b/data_embed/style.css.gz differ diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 584bacd..7f49d56 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -49,7 +49,7 @@ TinyGPSPlus gps; OneButton userButton = OneButton(BUTTON_PIN, true, true); #endif -String versionDate = "2024.09.30"; +String versionDate = "2024.10.01"; uint8_t myBeaconsIndex = 0; int myBeaconsSize = Config.beacons.size(); @@ -116,21 +116,7 @@ void setup() { STATION_Utils::nearTrackerInit(); startupScreen(loraIndex, versionDate); - if (Config.wifiAP.active){ - displayShow(" LoRa APRS", " ** WEB-CONF **","", "WiFiAP:LoRaTracker-AP", "IP : 192.168.4.1",""); - logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "Main", "WebConfiguration Started!"); - WIFI_Utils::startAutoAP(); - WEB_Utils::setup(); - - while (true) { // comienza web config - // algo - } - - } else { - WiFi.mode(WIFI_OFF); - logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, "Main", "WiFi controller stopped"); - } - + WIFI_Utils::checkIfWiFiAP(); MSG_Utils::loadNumMessages(); GPS_Utils::setup(); diff --git a/src/web_utils.cpp b/src/web_utils.cpp index 2fc8838..4ccbd8d 100644 --- a/src/web_utils.cpp +++ b/src/web_utils.cpp @@ -188,7 +188,7 @@ namespace WEB_Utils { // WiFi AP Config.wifiAP.password = request->getParam("wifiAP.password", true)->value(); - //Config.wifiAP.active = false; // when Configuration is finished Tracker returns to normal mode. + Config.wifiAP.active = false; // when Configuration is finished Tracker returns to normal mode. Config.writeFile(); diff --git a/src/wifi_utils.cpp b/src/wifi_utils.cpp index b39f8c4..e0412b2 100644 --- a/src/wifi_utils.cpp +++ b/src/wifi_utils.cpp @@ -1,7 +1,12 @@ +#include #include #include "configuration.h" +#include "web_utils.h" +#include "display.h" + extern Configuration Config; +extern logging::Logger logger; //uint32_t WiFiAutoAPTime = millis(); @@ -15,28 +20,16 @@ namespace WIFI_Utils { //WiFiAutoAPTime = millis(); } - /*void killAutoAP() { - WiFi.disconnect(); - WiFi.mode(WIFI_OFF); - }*/ - - /*void checkIfAutoAPShouldPowerOff() { - if (WiFiAutoAPStarted && Config.wifiAutoAP.powerOff > 0) { - if (WiFi.softAPgetStationNum() > 0) { - WiFiAutoAPTime = 0; - } else { - if (WiFiAutoAPTime == 0) { - WiFiAutoAPTime = millis(); - } else if ((millis() - WiFiAutoAPTime) > Config.wifiAutoAP.powerOff * 60 * 1000) { - Serial.println("Stopping auto AP"); - - WiFiAutoAPStarted = false; - WiFi.softAPdisconnect(true); - - Serial.println("Auto AP stopped (timeout)"); - } - } + void checkIfWiFiAP() { + if (Config.wifiAP.active || Config.beacons[0].callsign == "NOCALL-7"){ + displayShow(" LoRa APRS", " ** WEB-CONF **","", "WiFiAP:LoRaTracker-AP", "IP : 192.168.4.1",""); + logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "Main", "WebConfiguration Started!"); + startAutoAP(); + WEB_Utils::setup(); + while (true) {} + } else { + WiFi.mode(WIFI_OFF); + logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, "Main", "WiFi controller stopped"); } - }*/ - + } } \ No newline at end of file diff --git a/src/wifi_utils.h b/src/wifi_utils.h index 931ae3d..4970887 100644 --- a/src/wifi_utils.h +++ b/src/wifi_utils.h @@ -7,6 +7,7 @@ namespace WIFI_Utils { void startAutoAP(); + void checkIfWiFiAP(); }