diff --git a/code/components/jomjol_flowcontroll/ClassFlowControll.cpp b/code/components/jomjol_flowcontroll/ClassFlowControll.cpp index 474a86ec8..b14cfa8ae 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowControll.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowControll.cpp @@ -196,7 +196,7 @@ bool ClassFlowControll::StartMQTTService() void ClassFlowControll::SetInitialParameter(void) { - AutoStart = false; + AutoStart = true; SetupModeActive = false; AutoInterval = 10; // Minutes flowdigit = NULL; @@ -210,7 +210,8 @@ void ClassFlowControll::SetInitialParameter(void) bool ClassFlowControll::getIsAutoStart(void) { - return AutoStart; + //return AutoStart; + return true; // Flow must always be enabled, else the manual trigger (REST, MQTT) will not work! } @@ -557,10 +558,6 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph) while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph)) { splitted = ZerlegeZeile(aktparamgraph, " ="); - - if ((toUpper(splitted[0]) == "AUTOSTART") && (splitted.size() > 1)) { - AutoStart = alphanumericToBoolean(splitted[1]); - } if ((toUpper(splitted[0]) == "INTERVAL") && (splitted.size() > 1)) { if (isStringNumeric(splitted[1])) diff --git a/code/components/jomjol_flowcontroll/MainFlowControl.cpp b/code/components/jomjol_flowcontroll/MainFlowControl.cpp index a71c7e663..8a98010c7 100644 --- a/code/components/jomjol_flowcontroll/MainFlowControl.cpp +++ b/code/components/jomjol_flowcontroll/MainFlowControl.cpp @@ -422,8 +422,7 @@ esp_err_t handler_flow_start(httpd_req_t *req) else { LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Flow start triggered by REST API, but flow is not active!"); - const char *resp_str = "WARNING: Flow start triggered by REST API, but flow is not active"; - httpd_resp_send(req, resp_str, HTTPD_RESP_USE_STRLEN); + httpd_resp_send_err(req, HTTPD_403_FORBIDDEN, "Flow start triggered by REST API, but flow is not active"); } #ifdef DEBUG_DETAIL_ON diff --git a/code/main/main.cpp b/code/main/main.cpp index 36e40d207..d1e14ebd8 100644 --- a/code/main/main.cpp +++ b/code/main/main.cpp @@ -727,8 +727,7 @@ void migrateConfiguration(void) { } else if (section == "[AutoTimer]") { migrated = migrated | replaceString(configLines[i], "Intervall", "Interval"); - migrated = migrated | replaceString(configLines[i], ";AutoStart = true", ";AutoStart = false"); // Set it to its default value - migrated = migrated | replaceString(configLines[i], ";AutoStart", "AutoStart"); // Enable it + migrated = migrated | replaceString(configLines[i], "Autostart", ";UNUSED_PARAMETER"); // This parameter is no longer used } else if (section == "[Debug]") { migrated = migrated | replaceString(configLines[i], "Logfile ", "LogLevel "); // Whitespace needed so it does not match `LogfileRetentionInDays` @@ -741,7 +740,7 @@ void migrateConfiguration(void) { else if (section == "[System]") { migrated = migrated | replaceString(configLines[i], "RSSIThreashold", "RSSIThreshold"); migrated = migrated | replaceString(configLines[i], "AutoAdjustSummertime", ";UNUSED_PARAMETER"); // This parameter is no longer used - + migrated = migrated | replaceString(configLines[i], ";SetupMode = true", ";SetupMode = false"); // Set it to its default value migrated = migrated | replaceString(configLines[i], ";SetupMode", "SetupMode"); // Enable it } diff --git a/param-docs/parameter-pages/AutoTimer/AutoStart.md b/param-docs/parameter-pages/AutoTimer/AutoStart.md index 94a93133e..d63809591 100644 --- a/param-docs/parameter-pages/AutoTimer/AutoStart.md +++ b/param-docs/parameter-pages/AutoTimer/AutoStart.md @@ -2,11 +2,4 @@ Default Value: `true` !!! Warning - This is an **Expert Parameter**! Only change it if you understand what it does! - -Automatically start the Flow (Digitization Rounds) immediately after power up. - -!!! Note - Typically this is set to `true`. - The main reasons to set it to `false` is when you want to trigger it manually using the - [REST API](../REST-API) or [MQTT-API](../MQTT-API) or for debugging. \ No newline at end of file +This parameter is no longer available. The flow is now always enabled. If you want it to be disabled, set an interval which is high enough (eg. 1440 = 24h). \ No newline at end of file diff --git a/param-docs/parameter-pages/AutoTimer/Interval.md b/param-docs/parameter-pages/AutoTimer/Interval.md index e0e58ebbf..76fde177f 100644 --- a/param-docs/parameter-pages/AutoTimer/Interval.md +++ b/param-docs/parameter-pages/AutoTimer/Interval.md @@ -4,4 +4,8 @@ Default Value: `5` Unit: Minutes Interval in which the Flow (Digitization Round) is run. +It will run immediately on startup and then the next time after the given interval. If a round takes longer than this interval, the next round gets postponed until the current round completes. + +!!! Note +If you want the flow to be disabled, set an interval which is high enough (eg. 1440 = 24h). diff --git a/sd-card/config/config.ini b/sd-card/config/config.ini index 860521491..851c96bf3 100644 --- a/sd-card/config/config.ini +++ b/sd-card/config/config.ini @@ -124,7 +124,6 @@ LEDNumbers = 2 LEDColor = 150 150 150 [AutoTimer] -AutoStart = true Interval = 5 [DataLogging] diff --git a/sd-card/demo/config.ini b/sd-card/demo/config.ini index 0973caa04..ea317a918 100644 --- a/sd-card/demo/config.ini +++ b/sd-card/demo/config.ini @@ -115,7 +115,6 @@ LEDNumbers = 2 LEDColor = 150 150 150 [AutoTimer] -AutoStart = true Interval = 1 [DataLogging] diff --git a/sd-card/html/edit_config_template.html b/sd-card/html/edit_config_template.html index f670772d4..535717d6e 100644 --- a/sd-card/html/edit_config_template.html +++ b/sd-card/html/edit_config_template.html @@ -1920,6 +1920,7 @@

$TOOLTIP_AutoTimer_AutoStart + --> @@ -2381,7 +2383,7 @@

An ESP32 all inclusive neural network recognition system for meter Digitizat @@ -170,6 +170,7 @@

An ESP32 all inclusive neural network recognition system for meter Digitizat Loading version... +