diff --git a/data/igate_conf.json b/data/igate_conf.json index 30c4ec6..636bdf0 100644 --- a/data/igate_conf.json +++ b/data/igate_conf.json @@ -110,6 +110,7 @@ "rememberStationTime": 30, "backupDigiMode": false, "rebootMode": false, - "rebootModeTime": 6 + "rebootModeTime": 6, + "startupDelay": 0 } } \ No newline at end of file diff --git a/data_embed/index.html b/data_embed/index.html index 1fbdbcf..0db9e46 100644 --- a/data_embed/index.html +++ b/data_embed/index.html @@ -344,6 +344,24 @@ +
+ + +

diff --git a/data_embed/script.js b/data_embed/script.js index 1392ebb..fdced1c 100644 --- a/data_embed/script.js +++ b/data_embed/script.js @@ -95,6 +95,7 @@ function loadSettings(settings) { networksContainer.appendChild(networkElement); networkCount++; }); + document.getElementById("startupDelay").value = settings.startupDelay; // APRS-IS document.getElementById("aprs_is.active").checked = settings.aprs_is.active; diff --git a/include/configuration.h b/include/configuration.h index 4e6043a..e38b316 100644 --- a/include/configuration.h +++ b/include/configuration.h @@ -169,6 +169,7 @@ public: bool backupDigiMode; bool rebootMode; int rebootModeTime; + int startupDelay; String personalNote; String blacklist; std::vector wifiAPs; diff --git a/include/utils.h b/include/utils.h index 9b69cdb..a5a085a 100644 --- a/include/utils.h +++ b/include/utils.h @@ -46,6 +46,7 @@ namespace Utils { void checkRebootTime(); void checkSleepByLowBatteryVoltage(uint8_t mode); bool checkValidCallsign(const String& callsign); + void startupDelay(); } diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index abfd659..e6003ef 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -67,7 +67,7 @@ ___________________________________________________________________*/ #endif -String versionDate = "2025-10-11"; +String versionDate = "2025-10-12"; String versionNumber = "3.1.3"; Configuration Config; WiFiClient aprsIsClient; @@ -97,7 +97,6 @@ bool modemLoggedToAPRSIS = false; std::vector receivedPackets; String firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine; -//#define STARTUP_DELAY 5 //min void setup() { @@ -108,12 +107,7 @@ void setup() { Utils::validateFreqs(); GPS_Utils::setup(); STATION_Utils::loadBlacklistAndManagers(); - - #ifdef STARTUP_DELAY // (TEST) just to wait for WiFi init of Routers - displayShow("", " STARTUP DELAY ...", "", "", 0); - delay(STARTUP_DELAY * 60 * 1000); - #endif - + Utils::startupDelay(); SLEEP_Utils::setup(); WIFI_Utils::setup(); NTP_Utils::setup(); diff --git a/src/configuration.cpp b/src/configuration.cpp index c0b5d0c..9524bc8 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -45,6 +45,8 @@ bool Configuration::writeFile() { } } + data["other"]["startupDelay"] = startupDelay; + data["wifi"]["autoAP"]["password"] = wifiAutoAP.password; data["wifi"]["autoAP"]["timeout"] = wifiAutoAP.timeout; @@ -186,6 +188,9 @@ bool Configuration::readFile() { wifiAPs.push_back(wifiap); } + if (!data["other"].containsKey("startupDelay")) needsRewrite = true; + startupDelay = data["other"]["startupDelay"] | 0; + if (!data["wifi"]["autoAP"].containsKey("password") || !data["wifi"]["autoAP"].containsKey("timeout")) needsRewrite = true; wifiAutoAP.password = data["wifi"]["autoAP"]["password"] | "1234567890"; @@ -401,6 +406,8 @@ void Configuration::setDefaultValues() { wifiAPs.push_back(wifiap); + startupDelay = 0; + wifiAutoAP.password = "1234567890"; wifiAutoAP.timeout = 10; diff --git a/src/utils.cpp b/src/utils.cpp index 041a842..a556fba 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -436,4 +436,11 @@ namespace Utils { return true; } + void startupDelay() { + if (Config.startupDelay > 0) { + displayShow("", " STARTUP DELAY ...", "", "", 0); + delay(Config.startupDelay * 60 * 1000); + } + } + } \ No newline at end of file diff --git a/src/web_utils.cpp b/src/web_utils.cpp index 5283240..0d3a422 100644 --- a/src/web_utils.cpp +++ b/src/web_utils.cpp @@ -157,6 +157,8 @@ namespace WEB_Utils { Config.wifiAPs.push_back(wifiap); } + Config.startupDelay = getParamIntSafe("startupDelay", Config.startupDelay); + Config.callsign = getParamStringSafe("callsign", Config.callsign); Config.wifiAutoAP.password = getParamStringSafe("wifi.autoAP.password", Config.wifiAutoAP.password);