WiFiAP stops after 1min no cliente connected
This commit is contained in:
parent
3317e33346
commit
8cbc232fd9
|
|
@ -53,6 +53,7 @@ ____________________________________________________
|
||||||
____________________________________________________
|
____________________________________________________
|
||||||
## Timeline (Versions):
|
## Timeline (Versions):
|
||||||
|
|
||||||
|
- 2024.10.10 Configuration WiFiAP stops after 1 minute of no-client connected.
|
||||||
- 2024.10.09 WEB INSTALLER/FLASHER.
|
- 2024.10.09 WEB INSTALLER/FLASHER.
|
||||||
- 2024.10.07 Battery Monitor process added (Voltage Sleep to protect Battery).
|
- 2024.10.07 Battery Monitor process added (Voltage Sleep to protect Battery).
|
||||||
- 2024.09.17 Battery Voltage now as Encoded Telemetry in GPS Beacon.
|
- 2024.09.17 Battery Voltage now as Encoded Telemetry in GPS Beacon.
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ TinyGPSPlus gps;
|
||||||
OneButton userButton = OneButton(BUTTON_PIN, true, true);
|
OneButton userButton = OneButton(BUTTON_PIN, true, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
String versionDate = "2024.10.07";
|
String versionDate = "2024.10.10";
|
||||||
|
|
||||||
uint8_t myBeaconsIndex = 0;
|
uint8_t myBeaconsIndex = 0;
|
||||||
int myBeaconsSize = Config.beacons.size();
|
int myBeaconsSize = Config.beacons.size();
|
||||||
|
|
|
||||||
|
|
@ -486,7 +486,7 @@ namespace KEYBOARD_Utils {
|
||||||
displayShow("", "", " STARTING WiFi AP", 2000);
|
displayShow("", "", " STARTING WiFi AP", 2000);
|
||||||
Config.wifiAP.active = true;
|
Config.wifiAP.active = true;
|
||||||
Config.writeFile();
|
Config.writeFile();
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -195,16 +195,19 @@ namespace STATION_Utils {
|
||||||
|
|
||||||
String tempPacket = basePacket;
|
String tempPacket = basePacket;
|
||||||
tempPacket += "EQNS.0,0.01,0";
|
tempPacket += "EQNS.0,0.01,0";
|
||||||
|
displayShow("<<< TX >>>", "Telemetry Packet:", "Equation Coefficients",100);
|
||||||
LoRa_Utils::sendNewPacket(tempPacket);
|
LoRa_Utils::sendNewPacket(tempPacket);
|
||||||
delay(3000);
|
delay(3000);
|
||||||
|
|
||||||
tempPacket = basePacket;
|
tempPacket = basePacket;
|
||||||
tempPacket += "UNIT.VDC";
|
tempPacket += "UNIT.VDC";
|
||||||
|
displayShow("<<< TX >>>", "Telemetry Packet:", "Unit/Label",100);
|
||||||
LoRa_Utils::sendNewPacket(tempPacket);
|
LoRa_Utils::sendNewPacket(tempPacket);
|
||||||
delay(3000);
|
delay(3000);
|
||||||
|
|
||||||
tempPacket = basePacket;
|
tempPacket = basePacket;
|
||||||
tempPacket += "PARM.V_Batt";
|
tempPacket += "PARM.V_Batt";
|
||||||
|
displayShow("<<< TX >>>", "Telemetry Packet:", "Parameter Name",100);
|
||||||
LoRa_Utils::sendNewPacket(tempPacket);
|
LoRa_Utils::sendNewPacket(tempPacket);
|
||||||
delay(3000);
|
delay(3000);
|
||||||
sendStartTelemetry = false;
|
sendStartTelemetry = false;
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
|
||||||
|
|
||||||
extern Configuration Config;
|
extern Configuration Config;
|
||||||
extern logging::Logger logger;
|
extern logging::Logger logger;
|
||||||
|
|
||||||
//uint32_t WiFiAutoAPTime = millis();
|
uint32_t noClientsTime = 0;
|
||||||
|
|
||||||
|
|
||||||
namespace WIFI_Utils {
|
namespace WIFI_Utils {
|
||||||
|
|
@ -17,7 +17,6 @@ namespace WIFI_Utils {
|
||||||
WiFi.mode(WIFI_MODE_NULL);
|
WiFi.mode(WIFI_MODE_NULL);
|
||||||
WiFi.mode(WIFI_AP);
|
WiFi.mode(WIFI_AP);
|
||||||
WiFi.softAP("LoRaTracker-AP", Config.wifiAP.password);
|
WiFi.softAP("LoRaTracker-AP", Config.wifiAP.password);
|
||||||
//WiFiAutoAPTime = millis();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkIfWiFiAP() {
|
void checkIfWiFiAP() {
|
||||||
|
|
@ -26,7 +25,22 @@ namespace WIFI_Utils {
|
||||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "Main", "WebConfiguration Started!");
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "Main", "WebConfiguration Started!");
|
||||||
startAutoAP();
|
startAutoAP();
|
||||||
WEB_Utils::setup();
|
WEB_Utils::setup();
|
||||||
while (true) {}
|
while (true) {
|
||||||
|
if (WiFi.softAPgetStationNum() > 0) {
|
||||||
|
noClientsTime = 0;
|
||||||
|
} else {
|
||||||
|
if (noClientsTime == 0) {
|
||||||
|
noClientsTime = millis();
|
||||||
|
} else if ((millis() - noClientsTime) > 60 * 1000) {
|
||||||
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "Main", "WebConfiguration Stopped!");
|
||||||
|
displayShow("", "", " STOPPING WiFi AP", 2000);
|
||||||
|
Config.wifiAP.active = false;
|
||||||
|
Config.writeFile();
|
||||||
|
WiFi.softAPdisconnect(true);
|
||||||
|
ESP.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
WiFi.mode(WIFI_OFF);
|
WiFi.mode(WIFI_OFF);
|
||||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, "Main", "WiFi controller stopped");
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, "Main", "WiFi controller stopped");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue