Rolling 20211212

This commit is contained in:
jomjol
2021-12-12 19:30:07 +01:00
parent 4136a7b372
commit 61bf536207
12 changed files with 70 additions and 25 deletions

View File

@@ -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

View File

@@ -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: <img src="https://raw.githubusercontent.com/jomjol/AI-on-the-edge-device/master/images/mail.jpg" height="25">
## 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)

View File

@@ -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";

View File

@@ -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

View File

@@ -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";

View File

@@ -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);

View File

@@ -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";
const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2021-12-12 18:03";

View File

@@ -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";
const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2021-12-12 18:03";

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
11.2.0
11.3.0