diff --git a/README.md b/README.md index f0993b88..1bf03a67 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,11 @@ In other cases you can contact the developer via email: name == name) { - NUMBERS[j]->PreValue = stof(zwvalue.c_str()); + NUMBERS[j]->PreValue = stod(zwvalue.c_str()); NUMBERS[j]->ReturnPreValue = RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma + 1); // SIcherheitshalber 1 Stelle mehr, da ggf. Exgtended Resolution an ist (wird erst beim ersten Durchlauf gesetzt) time_t tStart; @@ -178,7 +178,7 @@ bool ClassFlowPostProcessing::LoadPreValue(void) fclose(pFile); printf("%s", zw); zwvalue = trim(std::string(zw)); - NUMBERS[0]->PreValue = stof(zwvalue.c_str()); + NUMBERS[0]->PreValue = stod(zwvalue.c_str()); time_t tStart; int yy, month, dd, hh, mm, ss; @@ -711,15 +711,26 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) #ifdef SERIAL_DEBUG printf("After removeLeadingZeros: ReturnValue %s\n", NUMBERS[j]->ReturnRawValue.c_str()); #endif - NUMBERS[j]->Value = std::stof(NUMBERS[j]->ReturnValue); + NUMBERS[j]->Value = std::stod(NUMBERS[j]->ReturnValue); #ifdef SERIAL_DEBUG printf("After setting the Value: Value %f and as double is %f\n", NUMBERS[j]->Value, std::stod(NUMBERS[j]->ReturnValue)); #endif if (NUMBERS[j]->checkDigitIncreaseConsistency) { - NUMBERS[j]->Value = checkDigitConsistency(NUMBERS[j]->Value, NUMBERS[j]->DecimalShift, NUMBERS[j]->analog_roi != NULL, NUMBERS[j]->PreValue); + if (flowDigit) + { + if (flowDigit->getCNNType() != Digital) + printf("checkDigitIncreaseConsistency = true - ignored due to wrong CNN-Type (not Digital Classification)\n"); + else + NUMBERS[j]->Value = checkDigitConsistency(NUMBERS[j]->Value, NUMBERS[j]->DecimalShift, NUMBERS[j]->analog_roi != NULL, NUMBERS[j]->PreValue); + } + else + { + printf("checkDigitIncreaseConsistency = true - no digital numbers defined!\n"); + } } + #ifdef SERIAL_DEBUG printf("After checkDigitIncreaseConsistency: Value %f\n", NUMBERS[j]->Value); #endif @@ -745,7 +756,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) if (NUMBERS[j]->useMaxRateValue && PreValueUse && NUMBERS[j]->PreValueOkay) { - float _ratedifference; + double _ratedifference; if (NUMBERS[j]->RateType == RateChange) _ratedifference = NUMBERS[j]->FlowRateAct; else @@ -840,7 +851,7 @@ string ClassFlowPostProcessing::getReadoutParam(bool _rawValue, bool _noerror, i return NUMBERS[_number]->ReturnValue; } -string ClassFlowPostProcessing::RundeOutput(float _in, int _anzNachkomma){ +string ClassFlowPostProcessing::RundeOutput(double _in, int _anzNachkomma){ std::stringstream stream; int _zw = _in; // printf("AnzNachkomma: %d\n", _anzNachkomma); @@ -864,7 +875,7 @@ string ClassFlowPostProcessing::RundeOutput(float _in, int _anzNachkomma){ } -string ClassFlowPostProcessing::ErsetzteN(string input, float _prevalue) +string ClassFlowPostProcessing::ErsetzteN(string input, double _prevalue) { int posN, posPunkt; int pot, ziffer; @@ -895,7 +906,7 @@ string ClassFlowPostProcessing::ErsetzteN(string input, float _prevalue) return input; } -float ClassFlowPostProcessing::checkDigitConsistency(float input, int _decilamshift, bool _isanalog, float _preValue){ +float ClassFlowPostProcessing::checkDigitConsistency(double input, int _decilamshift, bool _isanalog, double _preValue){ int aktdigit, olddigit; int aktdigit_before, olddigit_before; int pot, pot_max; diff --git a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h index 34b2309c..0d99958d 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h +++ b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h @@ -32,9 +32,9 @@ protected: bool LoadPreValue(void); string ShiftDecimal(string in, int _decShift); - string ErsetzteN(string, float _prevalue); - float checkDigitConsistency(float input, int _decilamshift, bool _isanalog, float _preValue); - string RundeOutput(float _in, int _anzNachkomma); + string ErsetzteN(string, double _prevalue); + float checkDigitConsistency(double input, int _decilamshift, bool _isanalog, double _preValue); + string RundeOutput(double _in, int _anzNachkomma); void InitNUMBERS(); void handleDecimalSeparator(string _decsep, string _value); @@ -58,7 +58,7 @@ public: string getReadoutTimeStamp(int _number = 0); void SavePreValue(); string GetPreValue(std::string _number = ""); - void SetPreValue(float zw, string _numbers, bool _extern = false); + void SetPreValue(double zw, string _numbers, bool _extern = false); std::string GetJSON(std::string _id = "", std::string _mac = "", std::string _lineend = "\n"); diff --git a/code/components/jomjol_tfliteclass/server_tflite.cpp b/code/components/jomjol_tfliteclass/server_tflite.cpp index 4e25dada..903cc6f4 100644 --- a/code/components/jomjol_tfliteclass/server_tflite.cpp +++ b/code/components/jomjol_tfliteclass/server_tflite.cpp @@ -831,6 +831,11 @@ void register_server_tflite_uri(httpd_handle_t server) camuri.user_ctx = (void*) "EditFlow"; httpd_register_uri_handler(server, &camuri); + camuri.uri = "/value.html"; + camuri.handler = handler_wasserzaehler; + camuri.user_ctx = (void*) "Value"; + httpd_register_uri_handler(server, &camuri); + camuri.uri = "/wasserzaehler.html"; camuri.handler = handler_wasserzaehler; camuri.user_ctx = (void*) "Wasserzaehler"; diff --git a/code/main/version.cpp b/code/main/version.cpp index b3344b25..3cf86297 100644 --- a/code/main/version.cpp +++ b/code/main/version.cpp @@ -1,4 +1,4 @@ const char* GIT_REV="N/A"; const char* GIT_TAG="N/A"; const char* GIT_BRANCH="N/A"; -const char* BUILD_TIME="2022-09-10 23:06"; \ No newline at end of file +const char* BUILD_TIME="2022-09-16 17:31"; \ No newline at end of file diff --git a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp index c763da00..ae4c360f 100644 --- a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp +++ b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp @@ -198,7 +198,7 @@ void test_doFlow() { digits = { 3.0, 2.0, 2.0, 8.0, 9.0, 4.0, 1.7, 9.8}; // falscher Wert 32290.420 analogs = { }; expected = "32289.420"; - expected_extended= "32289.4199"; + expected_extended= "32289.4198"; // FALSCH! wegen ungenügender Präzision von NUMBERS->Value // expected_extended= "32289.4198"; @@ -251,9 +251,8 @@ void test_doFlow() { // checkConsistency=true - // checkConsistency NOT working correctly - //result = process_doFlow(analogs, digits, Digital100, true, false); - //TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + result = process_doFlow(analogs, digits, Digital100, true, false); + TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); // extendResolution=true result = process_doFlow(analogs, digits, Digital100, false, true); @@ -265,7 +264,7 @@ void test_doFlow() { analogs = { }; expected = "3249.469"; expected_extended= "3249.4692"; - + // checkConsistency=true result = process_doFlow(analogs, digits, Digital100, false, false, -3); TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); @@ -285,10 +284,10 @@ void test_doFlow() { digits = { 0.0, 2.0, 6.1, 9.2}; // 259.9227 als falsches Ergebnis analogs = { 9.0, 2.5, 2.9, 7.2}; expected = "269.9227"; - expected_extended= "269.92273"; + expected_extended= "269.92272"; // Float Value reduziert die Genauigkeit hier. Korrekt wäre // expected_extended= "269.92272"; - + // checkConsistency=true result = process_doFlow(analogs, digits, Digital100, false, false); TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); @@ -299,13 +298,11 @@ void test_doFlow() { //result = process_doFlow(analogs, digits, Digital100, true, false, -3); //TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); - // extendResolution=true + + // checkConsistency=true und extendResolution=true result = process_doFlow(analogs, digits, Digital100, false, true); TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); - - - } diff --git a/code/version.cpp b/code/version.cpp index b3344b25..3cf86297 100644 --- a/code/version.cpp +++ b/code/version.cpp @@ -1,4 +1,4 @@ const char* GIT_REV="N/A"; const char* GIT_TAG="N/A"; const char* GIT_BRANCH="N/A"; -const char* BUILD_TIME="2022-09-10 23:06"; \ No newline at end of file +const char* BUILD_TIME="2022-09-16 17:31"; \ No newline at end of file diff --git a/firmware/bootloader.bin b/firmware/bootloader.bin index ab2c3edb..24a13660 100644 Binary files a/firmware/bootloader.bin and b/firmware/bootloader.bin differ diff --git a/firmware/firmware.bin b/firmware/firmware.bin index ba347797..678d134f 100644 Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ diff --git a/firmware/html.zip b/firmware/html.zip index 764810d4..88ae4e6d 100644 Binary files a/firmware/html.zip and b/firmware/html.zip differ diff --git a/sd-card/html/gethost.js b/sd-card/html/gethost.js index 751e4b11..d838b629 100644 --- a/sd-card/html/gethost.js +++ b/sd-card/html/gethost.js @@ -13,14 +13,14 @@ function getbasepath(){ { // host = "http://192.168.2.219"; // jomjol interner test // host = "http://192.168.178.46"; // jomjol interner test - host = "http://192.168.178.62"; // jomjol interner Real + host = "http://192.168.178.44"; // jomjol interner Real // host = "http://192.168.43.191"; // host = "."; // jomjol interner localhost } else { - host = "http://" + host; + host = window.location.protocol + "//" + host; if (window.location.port != "") { host = host + ":" + window.location.port; } diff --git a/sd-card/html/ota_page_new.html b/sd-card/html/ota_page_new.html new file mode 100644 index 00000000..5a226bf0 --- /dev/null +++ b/sd-card/html/ota_page_new.html @@ -0,0 +1,207 @@ + + + + +OTA Update + + + + + + + +Check at https://github.com/jomjol/AI-on-the-edge-device/releases to see if there is an update available. +

It is strongly recommended to update firmware and web interface (stored separately in the html directory on SD-card) at the same time!

+
+

Update

+ + + + +
+ + + + + + + + + + + +
+ + + + + +
+ + + + + +
+
+

Reboot

+ +
+ + + + + + +