diff --git a/FeatureRequest.md b/FeatureRequest.md index 66f14d29..b3a389fa 100644 --- a/FeatureRequest.md +++ b/FeatureRequest.md @@ -11,6 +11,14 @@ ____ +#### #13 Manage non linear gauge without CNN re-training + +* https://github.com/jomjol/AI-on-the-edge-device/issues/443 + +* Implement a look up table for non linear analog meters + + + #### #12 Less reboots due to memory leakage * Issue: #414 & #425 #430 diff --git a/README.md b/README.md index 6411311a..3ec60b17 100644 --- a/README.md +++ b/README.md @@ -34,24 +34,33 @@ If you have any technical topics, you can file a issue in this repository. In other cases you can contact the developer via email: -## Change log +------ +## Coming next + +* Automated update of the neural network file (tflite) to make the learing of additional pictures much easier and automated (GitHub action) +* New "hyprid" neural network for digital numbers --> allowing the dedection of intermediate states ("ring between two numbers") as a subdigit + ------ - +## Change log ### Known Issues * slow response of web server during picture analysis * spontaneous reboots (mostly due to html access during image processing) - self recovery implemented ------- - **General remark:** Beside the `firmware.bin`, typically also the content of `/html` needs to be updated! -##### Rolling (2021-12-03) +------ -- Normalized Parameter ``MaxRateValue`` to change per minute +##### Rolling (2021-12-12) -- Moved Parameter ``CheckDigitIncreaseConsistency`` to expert mode (disabled in default config) +- Corrected error handling: in case of error (too high rating, negative rate, ...) value, rate, timestamp are not transmitted any more - only the error text itself is send + +- Improved HTML behavior (tabulator usage for input) - thx to **[mad2xlc](https://github.com/mad2xlc)** + +- Normalized Parameter ``MaxRateValue`` to "change per minute" + +- Moved Parameter ``CheckDigitIncreaseConsistency`` to expert mode (disabled in default configuration) diff --git a/code/components/jomjol_flowcontroll/ClassFlowControll.cpp b/code/components/jomjol_flowcontroll/ClassFlowControll.cpp index e0a59bfe..ce1b133c 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowControll.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowControll.cpp @@ -637,10 +637,17 @@ string ClassFlowControll::getJSON() { json += "\"" + (*NUMBERS)[i]->name + "\":\n"; json += " {\n"; - json += " \"value\": " + (*NUMBERS)[i]->ReturnValueNoError + ",\n"; + if ((*NUMBERS)[i]->ReturnValueNoError.length() > 0) + json += " \"value\": " + (*NUMBERS)[i]->ReturnValueNoError + ",\n"; + else + json += " \"value\": \"\",\n"; json += " \"raw\": \"" + (*NUMBERS)[i]->ReturnRawValue + "\",\n"; json += " \"error\": \"" + (*NUMBERS)[i]->ErrorMessageText + "\",\n"; - json += " \"rate\": " + std::to_string((*NUMBERS)[i]->FlowRateAct) + ",\n"; + if ((*NUMBERS)[i]->ReturnRateValue.length() > 0) + json += " \"rate\": " + (*NUMBERS)[i]->ReturnRateValue + ",\n"; + else + json += " \"rate\": \"\",\n"; + json += " \"timestamp\": \"" + (*NUMBERS)[i]->timeStamp + "\"\n"; if ((i+1) < (*NUMBERS).size()) json += " },\n"; diff --git a/code/components/jomjol_flowcontroll/ClassFlowDefineTypes.h b/code/components/jomjol_flowcontroll/ClassFlowDefineTypes.h index 6295502b..6c914c94 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowDefineTypes.h +++ b/code/components/jomjol_flowcontroll/ClassFlowDefineTypes.h @@ -29,6 +29,7 @@ struct NumberPost { float FlowRateAct; // m3 / min float PreValue; // letzter Wert, der gut ausgelesen wurde float Value; // letzer ausgelesener Wert, inkl. Korrekturen + string ReturnRateValue; // RückgabewertRate string ReturnRawValue; // Rohwert (mit N & führenden 0) string ReturnValue; // korrigierter Rückgabewert, ggf. mit Fehlermeldung string ReturnPreValue; // korrigierter Rückgabewert ohne Fehlermeldung diff --git a/code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp b/code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp index 9a918435..425b2c05 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp @@ -160,7 +160,7 @@ bool ClassFlowMQTT::doFlow(string zwtime) { result = (*NUMBERS)[i]->ReturnValueNoError; resulterror = (*NUMBERS)[i]->ErrorMessageText; - resultrate = std::to_string((*NUMBERS)[i]->FlowRateAct); + resultrate = (*NUMBERS)[i]->ReturnRateValue; resulttimestamp = (*NUMBERS)[i]->timeStamp; namenumber = (*NUMBERS)[i]->name; @@ -169,22 +169,29 @@ bool ClassFlowMQTT::doFlow(string zwtime) else namenumber = maintopic + "/" + namenumber + "/"; - zw = namenumber + "value"; - MQTTPublish(zw, result); + zw = namenumber + "value"; + if (result.length() > 0) + MQTTPublish(zw, result); - zw = namenumber + "error"; - MQTTPublish(zw, resulterror, 1); + zw = namenumber + "error"; + if (resulterror.length() > 0) + MQTTPublish(zw, resulterror, 1); - zw = namenumber + "rate"; - MQTTPublish(zw, resultrate); + zw = namenumber + "rate"; + if (resultrate.length() > 0) + MQTTPublish(zw, resultrate); zw = namenumber + "timestamp"; - MQTTPublish(zw, resulttimestamp); + if (resulttimestamp.length() > 0) + MQTTPublish(zw, resulttimestamp); std::string json="{\"value\":"+result; json += ",\"error\":\""+resulterror; - json += "\",\"rate\":"+resultrate; + if (resultrate.length() > 0) + json += "\",\"rate\":"+resultrate; + else + json += "\",\"rate\":\"\""; json += ",\"timestamp\":\""+resulttimestamp+"\"}"; zw = namenumber + "json"; diff --git a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp index c4b91b04..cea719c6 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp @@ -117,6 +117,7 @@ bool ClassFlowPostProcessing::LoadPreValue(void) else { NUMBERS[j]->PreValueOkay = true; +/* NUMBERS[j]->Value = NUMBERS[j]->PreValue; NUMBERS[j]->ReturnValue = to_string(NUMBERS[j]->Value); NUMBERS[j]->ReturnValueNoError = NUMBERS[j]->ReturnValue; @@ -126,6 +127,7 @@ bool ClassFlowPostProcessing::LoadPreValue(void) NUMBERS[j]->ReturnValue = RundeOutput(NUMBERS[j]->Value, NUMBERS[j]->Nachkomma + 1); // SIcherheitshalber 1 Stelle mehr, da ggf. Exgtended Resolution an ist (wird erst beim ersten Durchlauf gesetzt) NUMBERS[j]->ReturnValueNoError = NUMBERS[j]->ReturnValue; } +*/ } } @@ -659,6 +661,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) double difference = difftime(imagetime, NUMBERS[j]->lastvalue); // in Sekunden difference /= 60; // in Minuten NUMBERS[j]->FlowRateAct = (NUMBERS[j]->Value - NUMBERS[j]->PreValue) / difference; + NUMBERS[j]->ReturnRateValue = std::to_string(NUMBERS[j]->FlowRateAct); if (NUMBERS[j]->useMaxRateValue && (abs(NUMBERS[j]->FlowRateAct) > NUMBERS[j]->MaxRateValue)) { @@ -676,10 +679,20 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) { NUMBERS[j]->lastvalue = imagetime; NUMBERS[j]->PreValue = NUMBERS[j]->Value; + + NUMBERS[j]->ReturnValueNoError = NUMBERS[j]->ReturnValue; NUMBERS[j]->ReturnPreValue = RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma); NUMBERS[j]->ErrorMessageText = "no error"; UpdatePreValueINI = true; } + else + { + NUMBERS[j]->ReturnRateValue = ""; + NUMBERS[j]->ReturnValue = ""; + NUMBERS[j]->ReturnValueNoError = ""; + NUMBERS[j]->timeStamp = ""; + + } } string _zw = "PostProcessing - Raw: " + NUMBERS[j]->ReturnRawValue + " Value: " + NUMBERS[j]->ReturnValue + " Error: " + NUMBERS[j]->ErrorMessageText; LogFile.WriteToFile(_zw); diff --git a/code/main/version.cpp b/code/main/version.cpp index a5a09117..06caaa95 100644 --- a/code/main/version.cpp +++ b/code/main/version.cpp @@ -1,4 +1,4 @@ -const char* GIT_REV="e22b4b6"; +const char* GIT_REV="4136a7b"; const char* GIT_TAG=""; -const char* GIT_BRANCH="master"; -const char* BUILD_TIME="2021-12-02 21:53"; \ No newline at end of file +const char* GIT_BRANCH="rolling"; +const char* BUILD_TIME="2021-12-12 18:03"; \ No newline at end of file diff --git a/code/version.cpp b/code/version.cpp index a5a09117..06caaa95 100644 --- a/code/version.cpp +++ b/code/version.cpp @@ -1,4 +1,4 @@ -const char* GIT_REV="e22b4b6"; +const char* GIT_REV="4136a7b"; const char* GIT_TAG=""; -const char* GIT_BRANCH="master"; -const char* BUILD_TIME="2021-12-02 21:53"; \ No newline at end of file +const char* GIT_BRANCH="rolling"; +const char* BUILD_TIME="2021-12-12 18:03"; \ No newline at end of file diff --git a/firmware/bootloader.bin b/firmware/bootloader.bin index e098b648..8adbeb33 100644 Binary files a/firmware/bootloader.bin and b/firmware/bootloader.bin differ diff --git a/firmware/firmware.bin b/firmware/firmware.bin index 89cd9f0e..fe32ce5a 100644 Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ diff --git a/firmware/html.zip b/firmware/html.zip index d91d4013..9a9e9867 100644 Binary files a/firmware/html.zip and b/firmware/html.zip differ diff --git a/sd-card/html/version.txt b/sd-card/html/version.txt index db500e35..fcfed5b0 100644 --- a/sd-card/html/version.txt +++ b/sd-card/html/version.txt @@ -1 +1 @@ -11.2.0 \ No newline at end of file +11.3.0 \ No newline at end of file