Skip to content

Commit

Permalink
ready for test
Browse files Browse the repository at this point in the history
  • Loading branch information
richonguzman committed Oct 1, 2024
1 parent 982d8de commit 20a2ad0
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 40 deletions.
Binary file modified data_embed/bootstrap.css.gz
Binary file not shown.
Binary file modified data_embed/bootstrap.js.gz
Binary file not shown.
Binary file modified data_embed/favicon.png.gz
Binary file not shown.
Binary file modified data_embed/index.html.gz
Binary file not shown.
Binary file modified data_embed/script.js.gz
Binary file not shown.
Binary file modified data_embed/style.css.gz
Binary file not shown.
18 changes: 2 additions & 16 deletions src/LoRa_APRS_Tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/web_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
39 changes: 16 additions & 23 deletions src/wifi_utils.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#include <logger.h>
#include <WiFi.h>
#include "configuration.h"
#include "web_utils.h"
#include "display.h"


extern Configuration Config;
extern logging::Logger logger;

//uint32_t WiFiAutoAPTime = millis();

Expand All @@ -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");
}
}*/

}
}
1 change: 1 addition & 0 deletions src/wifi_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace WIFI_Utils {

void startAutoAP();
void checkIfWiFiAP();

}

Expand Down

0 comments on commit 20a2ad0

Please sign in to comment.