From f335c17f0daefffb0604fb3ae7cd74031bdcfbe3 Mon Sep 17 00:00:00 2001 From: CaCO3 Date: Thu, 29 Sep 2022 19:21:23 +0200 Subject: [PATCH 01/25] Update build.yaml --- .github/workflows/build.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 880cc674..a0fc41c4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -189,6 +189,11 @@ jobs: ./sd-card/html/version.txt key: ${{ github.run_number }} + - name: Set Variables + id: vars + run: | + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + - name: Prepare artifacts for release run: | mkdir -p firmware From c9435108286753d485de7f93f857a49a5f95b93f Mon Sep 17 00:00:00 2001 From: jomjol <30766535+jomjol@users.noreply.github.com> Date: Fri, 30 Sep 2022 07:23:46 +0200 Subject: [PATCH 02/25] Rolling 20220930 --- Changelog.md | 20 +++++++++++++++++++ .../jomjol_flowcontroll/ClassFlowControll.cpp | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index bfcd9b56..a3e9232b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,26 @@ ## [Unreleased] + + +### Added + +- n.a. + +### Changed + +- n.a. + +### Fixed + +- [#1116](https://github.com/jomjol/AI-on-the-edge-device/issues/1116) precision problem at setting prevalue + +### Removed + +- n.a. + + + ## [12.0.1] - 2022-09-29 Improve **u**ser e**x**perience diff --git a/code/components/jomjol_flowcontroll/ClassFlowControll.cpp b/code/components/jomjol_flowcontroll/ClassFlowControll.cpp index db72aedf..615795c9 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowControll.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowControll.cpp @@ -404,7 +404,7 @@ string ClassFlowControll::GetPrevalue(std::string _number) std::string ClassFlowControll::UpdatePrevalue(std::string _newvalue, std::string _numbers, bool _extern) { - float zw; + double zw; char* p; _newvalue = trim(_newvalue); @@ -416,7 +416,7 @@ std::string ClassFlowControll::UpdatePrevalue(std::string _newvalue, std::string } else { - zw = strtof(_newvalue.c_str(), &p); + zw = strtod(_newvalue.c_str(), &p); if (zw == 0) return "- Error in String to Value Conversion!!! Must be of format value=123.456"; } From 6b329aaa580fcdede4b44d8ef3b802956317ae1a Mon Sep 17 00:00:00 2001 From: jomjol <30766535+jomjol@users.noreply.github.com> Date: Fri, 30 Sep 2022 07:48:33 +0200 Subject: [PATCH 03/25] Rolling 20220930 --- Changelog.md | 2 +- code/components/jomjol_fileserver_ota/server_file.cpp | 2 +- code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index a3e9232b..cb2e850d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -15,7 +15,7 @@ ### Fixed - [#1116](https://github.com/jomjol/AI-on-the-edge-device/issues/1116) precision problem at setting prevalue - +- [#1119](https://github.com/jomjol/AI-on-the-edge-device/issues/1119) renamed `firmware.bin` not working in OTA ### Removed - n.a. diff --git a/code/components/jomjol_fileserver_ota/server_file.cpp b/code/components/jomjol_fileserver_ota/server_file.cpp index 5bdd89c2..6b54f531 100644 --- a/code/components/jomjol_fileserver_ota/server_file.cpp +++ b/code/components/jomjol_fileserver_ota/server_file.cpp @@ -769,7 +769,7 @@ std::string unzip_new(std::string _in_zip_file, std::string _target_zip, std::st zw = std::string(archive_filename); printf("Rohfilename: %s\n", zw.c_str()); - if (toUpper(zw) == "FIRMWARE.BIN") + if (getFileType(zw) == "BIN") { zw = _target_bin + zw; ret = zw; diff --git a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp index 178d209f..94fd0b78 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp @@ -78,7 +78,7 @@ void ClassFlowPostProcessing::SetPreValue(double zw, string _numbers, bool _exte if (NUMBERS[j]->name == _numbers) { NUMBERS[j]->PreValue = zw; - NUMBERS[j]->ReturnPreValue = std::to_string(zw); + NUMBERS[j]->ReturnPreValue = RundeOutput(zw, NUMBERS[j]->Nachkomma); NUMBERS[j]->PreValueOkay = true; if (_extern) { From 9a7c9604fec74b79d68ce2bb5b2c386650a46880 Mon Sep 17 00:00:00 2001 From: cristianmitran <36613624+cristianmitran@users.noreply.github.com> Date: Sun, 2 Oct 2022 08:35:53 +0200 Subject: [PATCH 04/25] Support meter clock over --- FeatureRequest.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/FeatureRequest.md b/FeatureRequest.md index a9c84319..32082977 100644 --- a/FeatureRequest.md +++ b/FeatureRequest.md @@ -11,6 +11,12 @@ ____ +#### #30 Support meter clock over + +* In case of meter clocking over, that is, reaching its max. value and starting over from 0, + accept the new value and calculate correctly the difference. + (see line 739 onwards in ClassFlowPostProcessing.cpp) + #### ~~#29 Add favicon and use the hostname for the website~~- implemented v11.3.1 ~~* https://github.com/jomjol/AI-on-the-edge-device/issues/927~~ From 858d0b33618b57287134e69287cc7094ec2132c7 Mon Sep 17 00:00:00 2001 From: jomjol <30766535+jomjol@users.noreply.github.com> Date: Mon, 3 Oct 2022 09:00:24 +0200 Subject: [PATCH 05/25] Update FeatureRequest.md --- FeatureRequest.md | 200 ++++++++++++++++++++++++++-------------------- 1 file changed, 115 insertions(+), 85 deletions(-) diff --git a/FeatureRequest.md b/FeatureRequest.md index a9c84319..2693aee7 100644 --- a/FeatureRequest.md +++ b/FeatureRequest.md @@ -11,9 +11,9 @@ ____ -#### ~~#29 Add favicon and use the hostname for the website~~- implemented v11.3.1 +# Open + -~~* https://github.com/jomjol/AI-on-the-edge-device/issues/927~~ #### #28 Improved error handling for ROIs @@ -47,13 +47,7 @@ ____ * Show the CPU Temp directly in Webpage. Also add the value to MQTT sending - - -#### ~~#22 Direct hint to the different neural network files in the other repositories~~- implemented >v11.3.1 - -~~* https://github.com/jomjol/AI-on-the-edge-device/issues/644~~ - - + #### #21 Extended "CheckDigitalConsistency" Logik @@ -61,40 +55,21 @@ ____ -#### #20 Deep sleep and push mode - -* Let the device be normally in deep sleep state, and wake it up periodically to collect data and push it via MQTT or HTTP post. -* Support ESP-NOW to reduce the overhead of connecting to wifi and mqtt -* the above should enable battery powered applications - -* An other way to set deep sleep would be to enable it in a specific period (at night). - - -#### #19 Extended log informations - -* https://github.com/jomjol/AI-on-the-edge-device/issues/580 - - - -#### ~~#18 Document WLAN-strength in web page~~ - -* ~~https://github.com/jomjol/AI-on-the-edge-device/issues/563~~ - - - -#### ~~#17 Direct InfluxDB connection~~ - -* ~~Done in v10.6.0~~ - #### #16 Serial Communication * https://github.com/jomjol/AI-on-the-edge-device/issues/512 + * Send the readout value via RX/TX interface with a dedicated TAG + * Make dedicated communication FlowModule + * Modification of RX/TX communication + * Configuration interfache + + #### #15 Calibration for FishEye image @@ -108,16 +83,6 @@ ____ -#### ~~#14 Backup and restore option for configuration~~- implemented v11.3.1 - -* ~~https://github.com/jomjol/AI-on-the-edge-device/issues/459~~ - -* ~~Implement a zip file compression for store and restore~~ - -* ~~Update the html to handle it~~ - - - #### #13 Manage non linear gauge without CNN re-training * https://github.com/jomjol/AI-on-the-edge-device/issues/443 @@ -126,12 +91,6 @@ ____ -#### ~~#12 Less reboots due to memory leakage~~ - -* ~~Issue: #414 & #425 #430~~ - - - #### #11 MQTT - configurable payload * https://github.com/jomjol/AI-on-the-edge-device/issues/344 @@ -144,18 +103,14 @@ ____ -#### #9 Basic auth for the UI - -* https://github.com/jomjol/AI-on-the-edge-device/issues/283 - -* Implementation of an authentication mechanism. - #### #8 MQTT configurable readout intervall Make the readout intervall configurable via MQTT. * Change the mqtt part to receive and process input and not only sending + + #### #7 Extended Error Handling Check different types of error (e.g. tflite not availabe) and generate an error on the html page. @@ -166,15 +121,7 @@ To do: * Implement a checking algo * Extend the firmware and html page for the error handling -#### ~~#6 Check for double ROI names~~ - implemented v8.0.0 -~~Check during configuration, that ROI names are unique.~~ - -~~To do:~~ - -* ~~Implementation of ROI name checking in html code before saving analog or digital ROIs~~ - - #### #5 Configurable decimal separator (point or comma) @@ -188,6 +135,107 @@ To do: +#### #2 MQTT-controll with callback +* https://github.com/jomjol/AI-on-the-edge-device/issues/105 + +Extend the MQTT client to also enable callbacks for configuration setting + +To do: + +* implement callback for receiving information and override `config.ini` settings + +* change configuration management to handle online updates (currently changes need a restart) + +* think about the startup, as there the default config is loaded + + + +____ + + + +# Refused + +#### #9 Basic auth for the UI + +* https://github.com/jomjol/AI-on-the-edge-device/issues/283 + +* Implementation of an authentication mechanism. + +This will not be part of the free version + + + +#### #20 Deep sleep and push mode + +* Let the device be normally in deep sleep state, and wake it up periodically to collect data and push it via MQTT or HTTP post. +* Support ESP-NOW to reduce the overhead of connecting to wifi and mqtt +* the above should enable battery powered applications + +* An other way to set deep sleep would be to enable it in a specific period (at night). + +Technically not possible, as the limiting factor for the power consumption is not the esp32, but the electrical curcuit on the ESP32CAM board, which consumes a lot already in deep sleep mode. + + + +# Closed + +#### ~~#19 Extended log informations~~ + +~~* https://github.com/jomjol/AI-on-the-edge-device/issues/580~~ + + + +#### ~~#29 Add favicon and use the hostname for the website~~- implemented v11.3.1 + +~~* https://github.com/jomjol/AI-on-the-edge-device/issues/927~~ + + + +#### ~~#22 Direct hint to the different neural network files in the other repositories~~- implemented >v11.3.1 + +~~* https://github.com/jomjol/AI-on-the-edge-device/issues/644~~ + + + +#### ~~#18 Document WLAN-strength in web page~~ + +* ~~https://github.com/jomjol/AI-on-the-edge-device/issues/563~~ + + + +#### ~~#17 Direct InfluxDB connection~~ + +* ~~Done in v10.6.0~~ + + + +#### ~~#14 Backup and restore option for configuration~~- implemented v11.3.1 + +* ~~https://github.com/jomjol/AI-on-the-edge-device/issues/459~~ + +* ~~Implement a zip file compression for store and restore~~ + +* ~~Update the html to handle it~~ + + + +#### ~~#12 Less reboots due to memory leakage~~ + +* ~~Issue: #414 & #425 #430~~ + + + +#### ~~#6 Check for double ROI names~~ - implemented v8.0.0 + +~~Check during configuration, that ROI names are unique.~~ + +~~To do:~~ + +* ~~Implementation of ROI name checking in html code before saving analog or digital ROIs~~ + + + #### ~~#4 Initial Shifting and Rotation~~ - implemented v7.0.0 * ~~https://github.com/jomjol/AI-on-the-edge-device/issues/123~~ @@ -214,27 +262,6 @@ To do: - - -____ - -#### #2 MQTT-controll with callback -* https://github.com/jomjol/AI-on-the-edge-device/issues/105 - -Extend the MQTT client to also enable callbacks for configuration setting - -To do: - -* implement callback for receiving information and override `config.ini` settings - -* change configuration management to handle online updates (currently changes need a restart) - -* think about the startup, as there the default config is loaded - - - -____ - #### ~~#1 Optional GPIO for external flash/lighting~~ - implemented (v8.0.0) * ~~https://github.com/jomjol/AI-on-the-edge-device/issues/133~~ @@ -248,3 +275,6 @@ ____ * ~~Implementation of a software module for external light source (e.g. WS8132 LED controller, ...)~~ * ~~Update of the camera module to use the external light instead of the internal flash light~~ * ~~Adopt the configuration algorithm with a configurable light source~~ + + + From 16bb6e90a9f7e1b9128c2ffd60fb79ecee1914ca Mon Sep 17 00:00:00 2001 From: jomjol <30766535+jomjol@users.noreply.github.com> Date: Mon, 3 Oct 2022 09:07:03 +0200 Subject: [PATCH 06/25] Update FeatureRequest.md --- FeatureRequest.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/FeatureRequest.md b/FeatureRequest.md index a0e1dd66..2020fb78 100644 --- a/FeatureRequest.md +++ b/FeatureRequest.md @@ -17,8 +17,6 @@ ____ accept the new value and calculate correctly the difference. (see line 739 onwards in ClassFlowPostProcessing.cpp) -#### ~~#29 Add favicon and use the hostname for the website~~- implemented v11.3.1 - * In case of meter clocking over, that is, reaching its max. value and starting over from 0, accept the new value and calculate correctly the difference. (see line 739 onwards in ClassFlowPostProcessing.cpp) @@ -190,8 +188,12 @@ Technically not possible, as the limiting factor for the power consumption is no # Closed + + #### ~~#29 Add favicon and use the hostname for the website~~- implemented v11.3.1 + + #### ~~#19 Extended log informations~~ ~~* https://github.com/jomjol/AI-on-the-edge-device/issues/580~~ From 6c85796abece76a6f48f6e7412e44a5169a0aa57 Mon Sep 17 00:00:00 2001 From: George Ruinelli Date: Fri, 7 Oct 2022 16:56:35 +0200 Subject: [PATCH 07/25] . --- sd-card/html/edit_config_param.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index b84e4ae1..9276dbd6 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -79,7 +79,7 @@ textarea { -

MakeImage

+

TakeImage

From f80509c8867acb5b59a43763f0c1868a6f3298e6 Mon Sep 17 00:00:00 2001 From: George Ruinelli Date: Fri, 7 Oct 2022 16:59:23 +0200 Subject: [PATCH 08/25] . --- sd-card/html/edit_config_param.html | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index 9276dbd6..5fb3d321 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -41,6 +41,25 @@ textarea { .hidden { display: none; } + + +.red { + color: red; +} + +.gray { + background-color: Lightgray; +} + + +/*th { + text-align: left; +} + +tbody tr:nth-child(odd) { + background-color: Lightgray; +}*/ + @@ -817,8 +836,8 @@ textarea { GPIO 0 Usable with restrictions.
- Must be disabled when camera is used.
- Pin is used to activate flash mode and must therefore be HIGH when booting. + Must be disabled when camera is used.
+ Pin is used to activate flash mode and must therefore be HIGH when booting. @@ -1099,7 +1118,7 @@ textarea { GPIO 4 Usable with restrictions.
- Pin is used for build-in flash light. + Pin is used for build-in flash light. From d2721cbd4b56d119dc1a14fcce23b23f592ee9b4 Mon Sep 17 00:00:00 2001 From: George Ruinelli Date: Fri, 7 Oct 2022 18:18:21 +0200 Subject: [PATCH 09/25] . --- sd-card/html/edit_config_param.html | 582 +++++++++++----------------- 1 file changed, 225 insertions(+), 357 deletions(-) diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index 5fb3d321..95773cb6 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -51,6 +51,10 @@ textarea { background-color: Lightgray; } +.expert { + background-color: lightcoral; +} + /*th { text-align: left; @@ -83,10 +87,10 @@ tbody tr:nth-child(odd) { - - + - - - - - - - + - - - - + @@ -300,13 +296,13 @@ tbody tr:nth-child(odd) { - + - - - - - - - - - - + - - + - - - - - + @@ -412,7 +405,7 @@ tbody tr:nth-child(odd) { - + - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - + - - - - - - - - - - - + - - - - - - - + - - + - - + - + - - + - + - - + - + - - + @@ -913,91 +848,79 @@ tbody tr:nth-child(odd) { - - + + - + - - + - + - - + - + - - + - + - - + @@ -1006,91 +929,79 @@ tbody tr:nth-child(odd) { - + - + + - + - - + - + - - + - + - - + - + - - + @@ -1099,22 +1010,20 @@ tbody tr:nth-child(odd) { - + - + + - + - - + - + - - + - + - - + - + - - + @@ -1194,92 +1093,80 @@ tbody tr:nth-child(odd) { - + - + + - + - - + - + - - + - + - - + - + - - + @@ -1305,7 +1192,7 @@ tbody tr:nth-child(odd) { - - - - + - - + - - + - + - - + - + - - + - + - - + @@ -1430,14 +1305,12 @@ tbody tr:nth-child(odd) { - + - - - - - - + - - + @@ -1482,9 +1352,8 @@ tbody tr:nth-child(odd) { - - + @@ -1496,9 +1365,8 @@ tbody tr:nth-child(odd) { - - + From 17090c177e136ad52f99a9e6463448b2ed276899 Mon Sep 17 00:00:00 2001 From: George Ruinelli Date: Fri, 7 Oct 2022 18:40:26 +0200 Subject: [PATCH 10/25] . --- sd-card/html/edit_config_param.html | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index 95773cb6..84c46b74 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -90,7 +90,7 @@ tbody tr:nth-child(odd) { - - + - + @@ -1325,7 +1335,7 @@ tbody tr:nth-child(odd) { - - - - - - - - - - - - - - - - - - - - - - @@ -823,8 +810,7 @@ tbody tr:nth-child(odd) { - - @@ -833,8 +819,7 @@ tbody tr:nth-child(odd) { - - @@ -843,8 +828,7 @@ tbody tr:nth-child(odd) { - - @@ -858,9 +842,7 @@ tbody tr:nth-child(odd) { - - - - - @@ -904,8 +884,7 @@ tbody tr:nth-child(odd) { - - @@ -914,8 +893,7 @@ tbody tr:nth-child(odd) { - - @@ -924,8 +902,7 @@ tbody tr:nth-child(odd) { - - @@ -939,9 +916,7 @@ tbody tr:nth-child(odd) { - - - - - @@ -985,8 +958,7 @@ tbody tr:nth-child(odd) { - - @@ -995,8 +967,7 @@ tbody tr:nth-child(odd) { - - @@ -1005,8 +976,7 @@ tbody tr:nth-child(odd) { - - @@ -1037,8 +1007,7 @@ tbody tr:nth-child(odd) { - - - - @@ -1066,8 +1034,7 @@ tbody tr:nth-child(odd) { - - @@ -1076,8 +1043,7 @@ tbody tr:nth-child(odd) { - - @@ -1086,8 +1052,7 @@ tbody tr:nth-child(odd) { - - @@ -1117,8 +1082,7 @@ tbody tr:nth-child(odd) { - - - - @@ -1146,8 +1109,7 @@ tbody tr:nth-child(odd) { - - @@ -1156,8 +1118,7 @@ tbody tr:nth-child(odd) { - - @@ -1166,8 +1127,7 @@ tbody tr:nth-child(odd) { - - @@ -1225,9 +1185,7 @@ tbody tr:nth-child(odd) { - - - - - @@ -1271,8 +1227,7 @@ tbody tr:nth-child(odd) { - - @@ -1281,8 +1236,7 @@ tbody tr:nth-child(odd) { - - @@ -1291,8 +1245,7 @@ tbody tr:nth-child(odd) { - - @@ -1350,9 +1303,8 @@ tbody tr:nth-child(odd) { - - From c92a1e430d39089865637377a5cf163fa59e6139 Mon Sep 17 00:00:00 2001 From: George Ruinelli Date: Fri, 7 Oct 2022 21:04:56 +0200 Subject: [PATCH 13/25] . --- sd-card/html/edit_config_param.html | 46 ++++++++++++----------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index fc04cb99..61e5d622 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -13,37 +13,43 @@ p {font-size: 1em;} table { border: 0pt; + border-collapse: collapse; +} + + +tr { + border-bottom: 1px solid lightgray; } .button { - padding: 5px 20px; + padding: 5px 20px; width: 211px; - font-size: 16px; + font-size: 16px; } textarea { - font-size: 14px; + font-size: 14px; } .description { - color: black; - font-size: 80%; + color: black; + font-size: 80%; } .disabled { - color:lightgrey; + color:lightgrey; } .smallSelect { - width: 30px; + width: 30px; } .invalid-input { - background-color: #FFAA00; + background-color: #FFAA00; } .hidden { - display: none; + display: none; } @@ -59,20 +65,6 @@ textarea { background-color: #ffc5c5; } - -/*th { - text-align: left; -} - -tbody tr:nth-child(odd) { - background-color: Lightgray; -}*/ - - -tr.border-bottom td { - border-bottom: 1pt solid gray; -} - @@ -134,7 +126,7 @@ tr.border-bottom td { @@ -339,7 +331,7 @@ tr.border-bottom td { - - @@ -107,7 +112,7 @@ textarea { - @@ -120,7 +125,7 @@ textarea { - - - - - - - - - - - @@ -274,7 +279,7 @@ textarea { - - @@ -300,7 +305,7 @@ textarea { - @@ -312,7 +317,7 @@ textarea { - @@ -326,7 +331,7 @@ textarea { - @@ -764,7 +769,7 @@ textarea { - - @@ -791,7 +796,7 @@ textarea { - @@ -800,7 +805,7 @@ textarea { - @@ -809,7 +814,7 @@ textarea { - @@ -821,7 +826,7 @@ textarea { - @@ -838,7 +843,7 @@ textarea { - - @@ -865,7 +870,7 @@ textarea { - @@ -874,7 +879,7 @@ textarea { - @@ -883,7 +888,7 @@ textarea { - @@ -895,7 +900,7 @@ textarea { - @@ -912,7 +917,7 @@ textarea { - - @@ -939,7 +944,7 @@ textarea { - @@ -948,7 +953,7 @@ textarea { - @@ -957,7 +962,7 @@ textarea { - @@ -969,7 +974,7 @@ textarea { - @@ -988,7 +993,7 @@ textarea { - - @@ -1015,7 +1020,7 @@ textarea { - @@ -1024,7 +1029,7 @@ textarea { - @@ -1033,7 +1038,7 @@ textarea { - @@ -1045,7 +1050,7 @@ textarea { - @@ -1063,7 +1068,7 @@ textarea { - - @@ -1090,7 +1095,7 @@ textarea { - @@ -1099,7 +1104,7 @@ textarea { - @@ -1108,7 +1113,7 @@ textarea { - @@ -1118,7 +1123,7 @@ textarea { - - - - @@ -1181,7 +1186,7 @@ textarea { - - @@ -1208,7 +1213,7 @@ textarea { - @@ -1217,7 +1222,7 @@ textarea { - @@ -1226,7 +1231,7 @@ textarea { - @@ -1240,7 +1245,7 @@ textarea { - @@ -1255,7 +1260,7 @@ textarea { - @@ -1271,7 +1276,7 @@ textarea { - @@ -1283,7 +1288,7 @@ textarea { - @@ -1295,7 +1300,7 @@ textarea { - From a0e4ee1d00c1f390e53a26c2d92cb3d8b85b5500 Mon Sep 17 00:00:00 2001 From: George Ruinelli Date: Fri, 7 Oct 2022 21:56:29 +0200 Subject: [PATCH 17/25] . --- sd-card/html/edit_config_param.html | 44 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index 453d353d..caf488b6 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -112,12 +112,12 @@ textarea { - - - - - - - - - - - @@ -414,7 +414,7 @@ textarea { - - -
+ + Parameter @@ -98,14 +102,12 @@ tbody tr:nth-child(odd) {

TakeImage

TakeImage

+ - - LogImageLocation + @@ -116,10 +118,8 @@ tbody tr:nth-child(odd) {
- - LogfileRetentionInDays + + @@ -233,10 +233,8 @@ tbody tr:nth-child(odd) {
- - FixedExposure + +

Alignment

Alignment

+ SearchFieldX @@ -267,7 +265,7 @@ tbody tr:nth-child(odd) {
+ SearchFieldY @@ -280,11 +278,9 @@ tbody tr:nth-child(odd) {
+ - - AlignmentAlgo + - "Default" = use only R-Channel, "HighAccuracy" = use all Channels (RGB, 3x slower),
"Fast" (First time RGB, then only check if image is shifted)
-

Digits

+

+

+
- + Model @@ -319,11 +315,9 @@ tbody tr:nth-child(odd) {
+ - - CNNGoodThreshold + @@ -334,11 +328,9 @@ tbody tr:nth-child(odd) {
+ - - LogImageLocation + @@ -348,11 +340,9 @@ tbody tr:nth-child(odd) {
- - LogfileRetentionInDays + + + @@ -364,7 +354,7 @@ tbody tr:nth-child(odd) {
-

Analog

+

+

+
Model + Model + @@ -393,18 +386,18 @@ tbody tr:nth-child(odd) { Path to CNN model file for image recognition. Check the documentation for details.
+ + LogImageLocation Location to store separated digits for logging
- LogfileRetentionInDays + + Time to keep the separated digit images (in days -"0" = forever)

PostProcessing

PostProcessing

+ - - PreValueUse +
+ - - PreValueAgeStartup + @@ -457,11 +446,9 @@ tbody tr:nth-child(odd) {
+ - - AllowNegativeRates +
+ - - ErrorMessage +
+ - - CheckDigitIncreaseConsistency +
+
Postprocessing Individual Parameters:
+ - - DecimalShift + @@ -534,11 +515,9 @@ tbody tr:nth-child(odd) {
+ - - MaxRateValue + @@ -548,11 +527,9 @@ tbody tr:nth-child(odd) {
+ - - MaxRateType +
+ - - ExtendedResolution +
+ - - IgnoreLeadingNaN +

MQTT

MQTT

+ - - Uri + @@ -620,11 +591,9 @@ tbody tr:nth-child(odd) {
+ - - MainTopic + @@ -640,11 +609,9 @@ tbody tr:nth-child(odd) {
+ - - ClientID + @@ -654,11 +621,9 @@ tbody tr:nth-child(odd) {
+ - - user + @@ -668,11 +633,9 @@ tbody tr:nth-child(odd) {
+ - - password + @@ -682,11 +645,9 @@ tbody tr:nth-child(odd) {
+ - - Enable MQTT Retain Flag +

InfluxDB

InfluxDB

+ - - Uri + @@ -717,11 +676,9 @@ tbody tr:nth-child(odd) {
+ - - Database + @@ -731,11 +688,9 @@ tbody tr:nth-child(odd) {
+ - - Measurement + @@ -745,11 +700,9 @@ tbody tr:nth-child(odd) {
+ - - user + @@ -759,11 +712,9 @@ tbody tr:nth-child(odd) {
+ - - password + @@ -775,13 +726,11 @@ tbody tr:nth-child(odd) {

AutoTimer

AutoTimer

- - AutoStart + + AutoStart
- - Intervall + + Intervall @@ -808,7 +755,7 @@ tbody tr:nth-child(odd) {
+

GPIO Settings - Enabling GPIO handler, disable by default integrated flash light. Please enable it with GPIO4 (internal flash LED) settings or GPIO12 (external LED). @@ -818,21 +765,19 @@ tbody tr:nth-child(odd) {

+ GPIO 0 state - - GPIO 0 Usable with restrictions.
@@ -841,12 +786,11 @@ tbody tr:nth-child(odd) {
GPIO 0 use interrupt - GPIO 0 enable interrupt trigger
GPIO 0 PWM duty resolution - GPIO 0 LEDC PWM duty resolution in bit
GPIO 0 enable MQTT - GPIO 0 enable MQTT publishing/subscribing
GPIO 0 enable HTTP - GPIO 0 enable HTTP write/read
GPIO 0 name - GPIO 0 MQTT topic name (empty = GPIO0). Allowed characters (a-z, A-Z, 0-9, _, -)
+ GPIO 1 state - - GPIO 1
Used by default for serial communication as TX pin.
Required for seriales monitor.
GPIO 1 use interrupt - - - GPIO 1 enable interrupt trigger
GPIO 1 PWM duty resolution - GPIO 1 LEDC PWM duty resolution in bit
GPIO 1 enable MQTT - GPIO 1 enable MQTT publishing/subscribing
GPIO 1 enable HTTP - GPIO 1 enable HTTP write/read
GPIO 1 name - GPIO 1 MQTT topic name (empty = GPIO1). Allowed characters (a-z, A-Z, 0-9, _, -)
+ GPIO 3 state - - - GPIO 3 Used by default for serial communication as RX pin.
GPIO 3 use interrupt - - - GPIO 3 Used by default for serial communication as RX pin.
GPIO 3 PWM duty resolution - GPIO 3 LEDC PWM duty resolution in bit
GPIO 3 enable MQTT - GPIO 3 enable MQTT publishing/subscribing
GPIO 3 enable HTTP - GPIO 3 enable HTTP write/read
GPIO 3 name - GPIO 3 MQTT topic name (empty = GPIO3). Allowed characters (a-z, A-Z, 0-9, _, -)
+ GPIO 4 state - - - GPIO 4 Usable with restrictions.
@@ -1122,70 +1031,60 @@ tbody tr:nth-child(odd) {
GPIO 4 use interrupt - - - GPIO 4 enable interrupt trigger
GPIO 4 PWM duty resolution - GPIO 4 LEDC PWM duty resolution in bit
GPIO 4 enable MQTT - GPIO 4 enable MQTT publishing/subscribing
GPIO 4 enable HTTP - GPIO 4 enable HTTP write/read
GPIO 4 name - GPIO 4 MQTT topic name (empty = GPIO4). Allowed characters (a-z, A-Z, 0-9, _, -)
+ GPIO 12 state - - - GPIO 12 is usable without restrictions
GPIO 12 use interrupt - - - GPIO 12 enable interrupt trigger
GPIO 12 PWM duty resolution - GPIO 12 LEDC PWM duty resolution in bit
GPIO 12 enable MQTT - GPIO 12 enable MQTT publishing/subscribing
GPIO 12 enable HTTP - GPIO 12 enable HTTP write/read
GPIO 12 name - GPIO 12 MQTT topic name (empty = GPIO12). Allowed characters (a-z, A-Z, 0-9, _, -)
+ Numbers of LEDs @@ -1318,7 +1205,7 @@ tbody tr:nth-child(odd) {
+ LED Color @@ -1338,33 +1225,30 @@ tbody tr:nth-child(odd) {
+ GPIO 13 state - - GPIO 13 is usable without restrictions
GPIO 13 use interrupt - GPIO 13 enable interrupt trigger
GPIO 13 PWM duty resolution - GPIO 13 LEDC PWM duty resolution in bit
GPIO 13 enable MQTT - GPIO 13 enable MQTT publishing/subscribing
GPIO 13 enable HTTP - GPIO 13 enable HTTP write/read
GPIO 13 name - GPIO 13 MQTT topic name (empty = GPIO13). Allowed characters (a-z, A-Z, 0-9, _, -)

Debug

Debug

+ - - Logfile +
- + + LogfileRetentionInDays @@ -1465,12 +1336,11 @@ tbody tr:nth-child(odd) {

System

System

- + TimeZone
- + TimeServer
- + Hostname + Parameter @@ -576,7 +576,12 @@ tbody tr:nth-child(odd) {

MQTT

+

+ + +

+
@@ -661,7 +666,12 @@ tbody tr:nth-child(odd) {

InfluxDB

+

+ + +

+
@@ -757,8 +767,8 @@ tbody tr:nth-child(odd) {

- GPIO Settings - - Enabling GPIO handler, disable by default integrated flash light. Please enable it with GPIO4 (internal flash LED) settings or GPIO12 (external LED). +

- LogfileRetentionInDays + @@ -1340,9 +1350,8 @@ tbody tr:nth-child(odd) {
- - TimeZone + + From 140ec1b380e9a02c14a00dc14f276d512eda1337 Mon Sep 17 00:00:00 2001 From: George Ruinelli Date: Fri, 7 Oct 2022 18:52:18 +0200 Subject: [PATCH 11/25] . --- sd-card/html/edit_config_param.html | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index 84c46b74..a78708f1 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -777,9 +777,7 @@ tbody tr:nth-child(odd) {
- - GPIO 0 state +
- - GPIO 4 state +
- - GPIO 12 state +
- LED-Type @@ -1203,8 +1195,6 @@ tbody tr:nth-child(odd) {
- Numbers of LEDs @@ -1216,8 +1206,6 @@ tbody tr:nth-child(odd) {
- LED Color From 642d22578fd81369d7abc1c94e565f0d375741ca Mon Sep 17 00:00:00 2001 From: George Ruinelli Date: Fri, 7 Oct 2022 20:41:51 +0200 Subject: [PATCH 12/25] . --- sd-card/html/edit_config_param.html | 150 ++++++++++------------------ 1 file changed, 50 insertions(+), 100 deletions(-) diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index a78708f1..fc04cb99 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -11,6 +11,10 @@ h2 {font-size: 1.5em; margin-block-start: 0.0em; margin-block-end: 0.2em;} h3 {font-size: 1.2em;} p {font-size: 1em;} +table { + border: 0pt; +} + .button { padding: 5px 20px; width: 211px; @@ -52,7 +56,7 @@ textarea { } .expert { - background-color: lightcoral; + background-color: #ffc5c5; } @@ -64,6 +68,11 @@ tbody tr:nth-child(odd) { background-color: Lightgray; }*/ + +tr.border-bottom td { + border-bottom: 1pt solid gray; +} + @@ -131,8 +140,6 @@ tbody tr:nth-child(odd) {
- WaitBeforeTakingPicture @@ -144,8 +151,6 @@ tbody tr:nth-child(odd) {
- ImageQuality @@ -158,8 +163,6 @@ tbody tr:nth-child(odd) {
- ImageSize @@ -175,8 +178,6 @@ tbody tr:nth-child(odd) {
- LEDIntensity @@ -190,8 +191,6 @@ tbody tr:nth-child(odd) {
- Brightness @@ -204,8 +203,6 @@ tbody tr:nth-child(odd) {
- Contrast @@ -219,8 +216,6 @@ tbody tr:nth-child(odd) {
- Saturation @@ -234,7 +229,7 @@ tbody tr:nth-child(odd) {
-
- - SearchFieldX + SearchFieldX @@ -266,8 +259,6 @@ tbody tr:nth-child(odd) {
- SearchFieldY @@ -355,8 +346,6 @@ tbody tr:nth-child(odd) {
- ModelInputSize @@ -753,7 +742,7 @@ tbody tr:nth-child(odd) {
+ Intervall @@ -794,8 +783,7 @@ tbody tr:nth-child(odd) {
+ GPIO 0 use interrupt @@ -813,8 +801,7 @@ tbody tr:nth-child(odd) {
+ GPIO 0 PWM duty resolution
+ GPIO 0 enable MQTT
+ GPIO 0 enable HTTP
+ GPIO 0 name
- - GPIO 1 state + GPIO 1 state
+ GPIO 1 use interrupt @@ -894,8 +875,7 @@ tbody tr:nth-child(odd) {
+ GPIO 1 PWM duty resolution
+ GPIO 1 enable MQTT
+ GPIO 1 enable HTTP
+ GPIO 1 name
- - GPIO 3 state + GPIO 3 state
+ GPIO 3 use interrupt @@ -975,8 +949,7 @@ tbody tr:nth-child(odd) {
+ GPIO 3 PWM duty resolution
+ GPIO 3 enable MQTT
+ GPIO 3 enable HTTP
+ GPIO 3 name
+ GPIO 4 use interrupt @@ -1056,8 +1025,7 @@ tbody tr:nth-child(odd) {
+ GPIO 4 PWM duty resolution
+ GPIO 4 enable MQTT
+ GPIO 4 enable HTTP
+ GPIO 4 name
+ GPIO 12 use interrupt @@ -1136,8 +1100,7 @@ tbody tr:nth-child(odd) {
+ GPIO 12 PWM duty resolution
+ GPIO 12 enable MQTT
+ GPIO 12 enable HTTP
+ GPIO 12 name
- - GPIO 13 state + GPIO 13 state
+ GPIO 13 use interrupt @@ -1261,8 +1218,7 @@ tbody tr:nth-child(odd) {
+ GPIO 13 PWM duty resolution
+ GPIO 13 enable MQTT
+ GPIO 13 enable HTTP
+ GPIO 13 name
- - TimeServer + + @@ -1363,13 +1315,11 @@ tbody tr:nth-child(odd) {
- - Hostname + + - Hostname for server - will be transfered to wlan.ini at next startup) - Time to keep the raw image (in days -"0" = forever) + Time to keep the raw image (in days, resp. "0" = forever)
- Time to keep the separated digit images (in days -"0" = forever) + Time to keep the separated digit images (in days, resp. "0" = forever)
+ Parameter @@ -95,7 +100,7 @@ textarea {

TakeImage

+
+
+ WaitBeforeTakingPicture @@ -131,7 +136,7 @@ textarea {
+ ImageQuality @@ -143,7 +148,7 @@ textarea {
+ ImageSize @@ -158,7 +163,7 @@ textarea {
+ LEDIntensity @@ -171,7 +176,7 @@ textarea {
+ Brightness @@ -183,7 +188,7 @@ textarea {
+ Contrast @@ -196,7 +201,7 @@ textarea {
+ Saturation @@ -209,7 +214,7 @@ textarea {
+ FixedExposure @@ -228,7 +233,7 @@ textarea {

Alignment

+ SearchFieldX @@ -239,7 +244,7 @@ textarea {
+ SearchFieldY @@ -250,7 +255,7 @@ textarea {
+
+ Model @@ -287,7 +292,7 @@ textarea {
+
+
+
+
+ GPIO 0 use interrupt @@ -782,7 +787,7 @@ textarea {
+ GPIO 0 PWM duty resolution
+ GPIO 0 enable MQTT
+ GPIO 0 enable HTTP
+ GPIO 0 name
+ GPIO 1 state
+ GPIO 1 use interrupt @@ -856,7 +861,7 @@ textarea {
+ GPIO 1 PWM duty resolution
+ GPIO 1 enable MQTT
+ GPIO 1 enable HTTP
+ GPIO 1 name
+ GPIO 3 state
+ GPIO 3 use interrupt @@ -930,7 +935,7 @@ textarea {
+ GPIO 3 PWM duty resolution
+ GPIO 3 enable MQTT
+ GPIO 3 enable HTTP
+ GPIO 3 name
+
+ GPIO 4 use interrupt @@ -1006,7 +1011,7 @@ textarea {
+ GPIO 4 PWM duty resolution
+ GPIO 4 enable MQTT
+ GPIO 4 enable HTTP
+ GPIO 4 name
+
+ GPIO 12 use interrupt @@ -1081,7 +1086,7 @@ textarea {
+ GPIO 12 PWM duty resolution
+ GPIO 12 enable MQTT
+ GPIO 12 enable HTTP
+ GPIO 12 name
+ LED-Type @@ -1135,7 +1140,7 @@ textarea {
+ Numbers of LEDs @@ -1146,7 +1151,7 @@ textarea {
+ LED Color @@ -1164,7 +1169,7 @@ textarea {
+ GPIO 13 state
+ GPIO 13 use interrupt @@ -1199,7 +1204,7 @@ textarea {
+ GPIO 13 PWM duty resolution
+ GPIO 13 enable MQTT
+ GPIO 13 enable HTTP
+ GPIO 13 name

Debug

+
+

System

+
+
+
+ - + Time to keep the raw image (in days, resp. "0" = forever) @@ -125,7 +125,7 @@ textarea {
+ WaitBeforeTakingPicture @@ -136,11 +136,11 @@ textarea {
+ ImageQuality - + Quality index for picture (default = "12" - "0" high ... "63" low)
@@ -148,7 +148,7 @@ textarea {
+ ImageSize @@ -163,11 +163,11 @@ textarea {
+ LEDIntensity - + Internal LED Flash Intensity (PWM from 0% - 100%).
@@ -176,11 +176,11 @@ textarea {
+ Brightness - + Image Brightness (-2 .. 2 - default = "0") @@ -188,11 +188,11 @@ textarea {
+ Contrast - + Image Contrast (-2 .. 2 - default = "0")
@@ -201,11 +201,11 @@ textarea {
+ Saturation - + Image Saturation (-2 .. 2 - default = "0")
@@ -233,7 +233,7 @@ textarea {

Alignment

+ SearchFieldX @@ -244,7 +244,7 @@ textarea {
+ SearchFieldY @@ -255,7 +255,7 @@ textarea {
+ - + Time (in minutes), how long a previous read value is valid after reboot (default = 720 min) @@ -1123,7 +1123,7 @@ textarea {
+ LED-Type @@ -1140,7 +1140,7 @@ textarea {
+ Numbers of LEDs @@ -1154,7 +1154,7 @@ textarea { LED Color + R G B @@ -1265,7 +1265,7 @@ textarea { - + Time to keep the log files (in days - "0" = forever) From 641609e187c3f9bf444f824f9bb6aa897afe340f Mon Sep 17 00:00:00 2001 From: jomjol <30766535+jomjol@users.noreply.github.com> Date: Sat, 8 Oct 2022 10:51:19 +0200 Subject: [PATCH 18/25] Update espressif32 to v5.2.0 --- Changelog.md | 2 +- code/components/jomjol_controlGPIO/SmartLeds.h | 3 ++- code/dependencies.lock | 3 ++- code/main/main.cpp | 2 ++ code/platformio.ini | 6 ++---- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Changelog.md b/Changelog.md index e2aa436c..f1c7e2a0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,7 +8,7 @@ ### Changed -- n.a. +- Updated built environment to `espressif32@v5.2.0` ### Fixed diff --git a/code/components/jomjol_controlGPIO/SmartLeds.h b/code/components/jomjol_controlGPIO/SmartLeds.h index 824eb337..4c46fec7 100644 --- a/code/components/jomjol_controlGPIO/SmartLeds.h +++ b/code/components/jomjol_controlGPIO/SmartLeds.h @@ -269,7 +269,8 @@ private: std::unique_ptr< Rgb[] > _secondBuffer; Rgb *_buffer; - xSemaphoreHandle _finishedFlag; + SemaphoreHandle_t _finishedFlag; +// xSemaphoreHandle _finishedFlag; int _pixelPosition; int _componentPosition; diff --git a/code/dependencies.lock b/code/dependencies.lock index de82408d..6e6120b5 100644 --- a/code/dependencies.lock +++ b/code/dependencies.lock @@ -1,2 +1,3 @@ -manifest_hash: 45994dbfed009907994c31f6d279c5861a1eacbf219ce8b58e74e39b3393816a +manifest_hash: 4e37bb0f9273c4de05f38688720fe32aa6e5b892452694a4f7a2ca1659f02cf6 +target: esp32 version: 1.0.0 diff --git a/code/main/main.cpp b/code/main/main.cpp index 4a79fb05..40fbb43b 100644 --- a/code/main/main.cpp +++ b/code/main/main.cpp @@ -118,6 +118,8 @@ bool Init_NVS_SDCard() void task_NoSDBlink(void *pvParameter) { +// esp_rom_gpio_pad_select_gpio(BLINK_GPIO); + gpio_pad_select_gpio(BLINK_GPIO); gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT); diff --git a/code/platformio.ini b/code/platformio.ini index 39b6032c..9a39a856 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -13,14 +13,12 @@ src_dir = main [env:esp32cam] -platform = espressif32@4.4.0 -;platform = espressif32@5.1.0 -;platform = espressif32 +;platform = espressif32@4.4.0 +platform = espressif32@5.2.0 board = esp32cam ;board = m5stack-core-esp32 framework = espidf -;board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions.csv lib_deps = From 47caa1b1186a7136311f7de51ef9c73cc17f6d0e Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 9 Oct 2022 18:45:59 +0200 Subject: [PATCH 19/25] FlowPostProcessing::GetJSON: Add `pre` field to the `/json` response This makes it easier for third-party software to fall back to the `pre` value, if the `value` itself is not available for some reason. --- code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp index 94fd0b78..a894ba09 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp @@ -35,6 +35,7 @@ std::string ClassFlowPostProcessing::GetJSON(std::string _id, std::string _mac, else json += " \"value\": \"\"," + _lineend; json += " \"raw\": \"" + NUMBERS[i]->ReturnRawValue + "\"," + _lineend; + json += " \"pre\": \"" + NUMBERS[i]->ReturnPreValue + "\"," + _lineend; json += " \"error\": \"" + NUMBERS[i]->ErrorMessageText + "\"," + _lineend; if (NUMBERS[i]->ReturnRateValue.length() > 0) json += " \"rate\": " + NUMBERS[i]->ReturnRateValue + "," + _lineend; From eb0b932c44829323f24c04ef0d68190e4b078524 Mon Sep 17 00:00:00 2001 From: jomjol <30766535+jomjol@users.noreply.github.com> Date: Mon, 10 Oct 2022 07:09:00 +0200 Subject: [PATCH 20/25] rolling 20221010 --- Changelog.md | 2 +- .../components/jomjol_mqtt/interface_mqtt.cpp | 45 +------------------ 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/Changelog.md b/Changelog.md index f1c7e2a0..bfb91709 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,7 +4,7 @@ ### Added -- n.a. +- Addes PreValue to `/json` ([#1154](https://github.com/jomjol/AI-on-the-edge-device/issues/1154)) ### Changed diff --git a/code/components/jomjol_mqtt/interface_mqtt.cpp b/code/components/jomjol_mqtt/interface_mqtt.cpp index 1789d252..47c6a4bb 100644 --- a/code/components/jomjol_mqtt/interface_mqtt.cpp +++ b/code/components/jomjol_mqtt/interface_mqtt.cpp @@ -52,6 +52,7 @@ static esp_err_t mqtt_event_handler_cb(esp_mqtt_event_handle_t event) break; case MQTT_EVENT_DISCONNECTED: ESP_LOGI(TAG_INTERFACEMQTT, "MQTT_EVENT_DISCONNECTED"); + esp_mqtt_client_reconnect(client); break; case MQTT_EVENT_SUBSCRIBED: ESP_LOGI(TAG_INTERFACEMQTT, "MQTT_EVENT_SUBSCRIBED, msg_id=%d", event->msg_id); @@ -99,17 +100,6 @@ bool MQTTInit(std::string _mqttURI, std::string _clientid, std::string _user, st int _lzw = _zwmessage.length(); -/* LWTContext = _LWTContext; - - mqtt_cfg.uri = _mqttURI.c_str(); - mqtt_cfg.client_id = _clientid.c_str(); - mqtt_cfg.lwt_topic = _LWTContext.c_str(); - mqtt_cfg.lwt_msg = _zwmessage.c_str(); - mqtt_cfg.lwt_retain = 1; - mqtt_cfg.lwt_msg_len = _lzw; - mqtt_cfg.keepalive = _keepalive; -*/ - esp_mqtt_client_config_t mqtt_cfg = { .uri = _mqttURI.c_str(), .client_id = _clientid.c_str(), @@ -164,39 +154,6 @@ bool MQTTInit(std::string _mqttURI, std::string _clientid, std::string _user, st return true; } -/* -void MQTTReConnect(){ - std::string _zwmessage = "connection lost"; - int _lzw = _zwmessage.length(); - ->>>>>>> Stashed changes - client = esp_mqtt_client_init(&mqtt_cfg); - if (client) - { - if (esp_mqtt_client_register_event(client, esp_mmqtt_ID, mqtt_event_handler, client) != ESP_OK) - LogFile.WriteToFile("MQTT - Could not register event!"); - if (esp_mqtt_client_start(client) != ESP_OK) - LogFile.WriteToFile("MQTT - Could not start client!"); - -<<<<<<< Updated upstream - if(MQTTPublish(_LWTContext, "", 1)) { - LogFile.WriteToFile("MQTT - Client init successful"); - } -======= - if (mqtt_connected) - MQTTPublish(LWTContext, "", 1); - else - LogFile.WriteToFile("Problem with (Re)Connection not successful!"); - ->>>>>>> Stashed changes - } - else - { - LogFile.WriteToFile("MQTT - Could not Init client!"); - } - -} -*/ void MQTTdestroy() { if (client != NULL) { From 0f6c76714341d0334c6dd6f75ddc35a4642971b3 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Wed, 12 Oct 2022 21:34:24 +0200 Subject: [PATCH 21/25] fix analogtodigital: remove rounding --- .../ClassFlowCNNGeneral.cpp | 11 +- .../test_cnnflowcontroll.cpp | 107 ------------------ .../test_flowpostprocessing.cpp | 16 +++ code/test/test_suite_flowcontroll.cpp | 22 +++- 4 files changed, 41 insertions(+), 115 deletions(-) delete mode 100644 code/test/components/jomjol-flowcontroll/test_cnnflowcontroll.cpp diff --git a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp index 88a5fd41..746c8d64 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp @@ -35,7 +35,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution if (GENERAL[_analog]->ROI.size() == 0) return result; if (debugdetailgeneral) LogFile.WriteToFile("ClassFlowCNNGeneral::getReadout _analog=" + std::to_string(_analog) + ", _extendedResolution=" + std::to_string(_extendedResolution) + ", prev=" + std::to_string(prev)); - + if (CNNType == Analogue || CNNType == Analogue100) { float zahl = GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float; @@ -147,7 +147,6 @@ int ClassFlowCNNGeneral::ZeigerEvalHybridNeu(float zahl, float zahl_vorgaenger, if (AnalogerVorgaenger) { -// result = ZeigerEvalAnalogToDigitNeu(zahl, eval_vorgaenger); result = ZeigerEvalAnalogToDigitNeu(zahl, zahl_vorgaenger, eval_vorgaenger); if (debugdetailgeneral) LogFile.WriteToFile("ClassFlowCNNGeneral::ZeigerEvalHybridNeu - Analoger Vorgänger, Bewertung über ZeigerEvalAnalogNeu = " + std::to_string(result) + " zahl: " + std::to_string(zahl) + " zahl_vorgaenger = " + std::to_string(zahl_vorgaenger)+ " eval_vorgaenger = " + std::to_string(eval_vorgaenger) + " DigitalUnschaerfe = " + std::to_string(DigitalUnschaerfe)); @@ -218,12 +217,14 @@ int ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu(float zahl, float ziffer_vor if ((ziffer_vorgaenger >= DigitalUebergangsbereichVorgaengerAnalogToDigit ) && (ziffer_vorgaenger <= (10.0 - DigitalUebergangsbereichVorgaengerAnalogToDigit))) { + /* Bei DigitalUebergangsbereichVorgaengerAnalogToDigit verursacht runden weitere Fehler // kein Ziffernwechsel, da Vorgänger weit genug weg ist (0+/-DigitalUebergangsbereichVorgaenger) --> zahl wird gerundet if ((ergebnis_nachkomma <= 2) || (ergebnis_nachkomma >= 8)) // Band um die Ziffer --> Runden, da Ziffer im Rahmen Ungenauigkeit erreicht - result = ((int) round(zahl) + 10) % 10; - else result = ((int) trunc(zahl) + 10) % 10; - + else + result = ((int) round(zahl) + 10) % 10; + */ + result = ((int) trunc(zahl) + 10) % 10; if (debugdetailgeneral) LogFile.WriteToFile("ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu - kein Ziffernwechsel, da Vorkomma weit genug weg = " + std::to_string(result) + " zahl: " + std::to_string(zahl) + " ziffer_vorgaenger = " + std::to_string(ziffer_vorgaenger) + " DigitalUnschaerfe = " + std::to_string(DigitalUnschaerfe)); return result; diff --git a/code/test/components/jomjol-flowcontroll/test_cnnflowcontroll.cpp b/code/test/components/jomjol-flowcontroll/test_cnnflowcontroll.cpp deleted file mode 100644 index 9d7c9b09..00000000 --- a/code/test/components/jomjol-flowcontroll/test_cnnflowcontroll.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include -#include - -class UnderTestCNN : public ClassFlowCNNGeneral { - public: - using ClassFlowCNNGeneral::ZeigerEvalAnalogNeu; - using ClassFlowCNNGeneral::ZeigerEvalHybridNeu; - using ClassFlowCNNGeneral::ClassFlowCNNGeneral; - -}; - - -/** - * @brief test if all combinations of digit - * evaluation are running correctly - */ -void test_ZeigerEval() -{ - UnderTestCNN undertest = UnderTestCNN(nullptr, Digital100); - - // the 5.2 is already above 5.0 and the previous digit too (3) - printf("Test 5.2, 3\n"); - int result = undertest.ZeigerEvalAnalogNeu(5.2, 3); - TEST_ASSERT_EQUAL(5, result); - - // the 5.2 is already above 5.0 and the previous digit not (9) - // so the current digit shoult be reduced (4.9) - printf("Test 5.2, 9\n"); - TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalAnalogNeu(5.2, 9)); - - printf("Test 4.4, 9\n"); - // the 4.4 (digital100) is not above 5 and the previous digit (analog) too (9.3) - TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalAnalogNeu(4.4, 9)); - - printf("Test 4.5, 0\n"); - // the 4.5 (digital100) is not above 5 and the previous digit (analog) too (9.6) - TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalAnalogNeu(4.5, 0)); - -} - -/** - * @brief test if all combinations of digit - * evaluation are running correctly - */ -void test_ZeigerEvalHybrid() { - UnderTestCNN undertest = UnderTestCNN(nullptr, Digital100); - - // the 5.2 and no previous should round down - printf("ZeigerEvalHybridNeu(5.2, 0, -1)\n"); - TEST_ASSERT_EQUAL(5, undertest.ZeigerEvalHybridNeu(5.2, 0, -1)); - - // the 5.3 and no previous should trunc to 5 - printf("ZeigerEvalHybridNeu(5.3, 0, -1)\n"); - TEST_ASSERT_EQUAL(5, undertest.ZeigerEvalHybridNeu(5.3, 0, -1)); - - printf("ZeigerEvalHybridNeu(5.7, 0, -1)\n"); - // the 5.7 and no previous should trunc to 5 - TEST_ASSERT_EQUAL(6, undertest.ZeigerEvalHybridNeu(5.7, 0, -1)); - - // the 5.8 and no previous should round up to 6 - printf("ZeigerEvalHybridNeu(5.8, 0, -1)\n"); - TEST_ASSERT_EQUAL(6, undertest.ZeigerEvalHybridNeu(5.8, 0, -1)); - - // the 5.7 with previous and the previous between 0.3-0.5 should round up to 6 - TEST_ASSERT_EQUAL(6, undertest.ZeigerEvalHybridNeu(5.7, 0.4, 1)); - - // the 5.3 with previous and the previous between 0.3-0.7 should round down to 5 - TEST_ASSERT_EQUAL(5, undertest.ZeigerEvalHybridNeu(5.3, 0.7, 1)); - - // the 5.3 with previous and the previous <=0.5 should trunc to 5 - TEST_ASSERT_EQUAL(5, undertest.ZeigerEvalHybridNeu(5.3, 0.1, 1)); - - // the 5.3 with previous and the previous >=9.5 should reduce to 4 - TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalHybridNeu(5.3, 9.6, 9)); - - // the 5.7 with previous and the previous >=9.5 should trunc to 5 - TEST_ASSERT_EQUAL(5, undertest.ZeigerEvalHybridNeu(5.7, 9.6, 9)); - - // the 4.5 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.6) - TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalHybridNeu(4.5, 9.6, 0)); - - // the 4.5 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.6) - TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalHybridNeu(4.5, 9.6, 9)); - // the 4.5 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.5) - TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalHybridNeu(4.5, 9.5, 9)); - - // 59.96889 - Pre: 58.94888 - // 8.6 : 9.8 : 6.7 - // the 4.4 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.5) - TEST_ASSERT_EQUAL(8, undertest.ZeigerEvalHybridNeu(8.6, 9.8, 9)); - - // pre = 9.9 (0.0 raw) - // zahl = 1.8 - TEST_ASSERT_EQUAL(2, undertest.ZeigerEvalHybridNeu(1.8, 9.0, 9)); - - // if a digit have an early transition and the pointer is < 9.0 - // prev (pointer) = 6.2, but on digital readout = 6.0 (prev is int parameter) - // zahl = 4.6 - TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalHybridNeu(4.6, 6.0, 6)); - - - // issue #879 vorgaenger is -1, zahl = 6.7 - //TEST_ASSERT_EQUAL(7, undertest.ZeigerEvalHybrid(6.7, -1.0, -1)); - - -} - diff --git a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp index 758868d0..dee92296 100644 --- a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp +++ b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp @@ -303,6 +303,20 @@ void test_doFlow() { result = process_doFlow(analogs, digits, Digital100, false, true, -3); TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); + // Fehler bei V12.0.1 + // Lokal + digits = { 9.8, 9.8, 1.9, 0.9, 0.9, 9.9, 2.9, 4.8}; // 169.3493 als falsches Ergebnis + analogs = { 5.5}; + expected = "211.0345"; + expected_extended= "211.03455"; + + // extendResolution=false + result = process_doFlow(analogs, digits, Digital100, false, false, -3); + TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + + // checkConsistency=false und extendResolution=true + result = process_doFlow(analogs, digits, Digital100, false, true, -3); + TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); } @@ -388,9 +402,11 @@ std::string process_doFlow(std::vector analog, std::vector digits, } string time; + // run test TEST_ASSERT_TRUE(undertestPost->doFlow(time)); + return undertestPost->getReadout(0); } diff --git a/code/test/test_suite_flowcontroll.cpp b/code/test/test_suite_flowcontroll.cpp index 62c9fea1..10dc3a83 100644 --- a/code/test/test_suite_flowcontroll.cpp +++ b/code/test/test_suite_flowcontroll.cpp @@ -1,5 +1,4 @@ #include -#include "components/jomjol-flowcontroll/test_cnnflowcontroll.cpp" #include "components/jomjol-flowcontroll/test_flowpostprocessing.cpp" // SD-Card //////////////////// #include "nvs_flash.h" @@ -8,6 +7,24 @@ #include "driver/sdmmc_host.h" #include "driver/sdmmc_defs.h" static const char *TAGMAIN = "main"; +#define __SD_USE_ONE_LINE_MODE__ +#include "server_GPIO.h" + + + + +void initGPIO() +{ + gpio_config_t io_conf; + //set as output mode + io_conf.mode = gpio_mode_t::GPIO_MODE_INPUT; + //bit mask of the pins that you want to set,e.g.GPIO18/19 + io_conf.pull_down_en = gpio_pulldown_t::GPIO_PULLDOWN_ENABLE; + //set pull-up mode + io_conf.pull_up_en = gpio_pullup_t::GPIO_PULLUP_DISABLE; + //configure GPIO with the given settings + gpio_config(&io_conf); +} bool Init_NVS_SDCard() { @@ -80,11 +97,10 @@ bool Init_NVS_SDCard() */ extern "C" void app_main() { + initGPIO(); Init_NVS_SDCard(); UNITY_BEGIN(); -// RUN_TEST(test_ZeigerEval); -// RUN_TEST(test_ZeigerEvalHybrid); RUN_TEST(test_doFlow); UNITY_END(); From 99e6243e258968ae7b1bed026722bdd89c7faf3f Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Wed, 12 Oct 2022 21:36:19 +0200 Subject: [PATCH 22/25] test case description --- .../components/jomjol-flowcontroll/test_flowpostprocessing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp index dee92296..535fdbdd 100644 --- a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp +++ b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp @@ -305,7 +305,7 @@ void test_doFlow() { // Fehler bei V12.0.1 // Lokal - digits = { 9.8, 9.8, 1.9, 0.9, 0.9, 9.9, 2.9, 4.8}; // 169.3493 als falsches Ergebnis + digits = { 9.8, 9.8, 1.9, 0.9, 0.9, 9.9, 2.9, 4.8}; // 211.0355 als falsches Ergebnis analogs = { 5.5}; expected = "211.0345"; expected_extended= "211.03455"; From ea26a5722ab69d90235238818dce2f56c917074f Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Thu, 13 Oct 2022 21:41:40 +0200 Subject: [PATCH 23/25] rewrite of analogtodigit, added new testcases --- .../ClassFlowCNNGeneral.cpp | 23 +++++---- .../jomjol_flowcontroll/ClassFlowCNNGeneral.h | 2 +- .../test_flowpostprocessing.cpp | 48 ++++++++++++++++++- 3 files changed, 62 insertions(+), 11 deletions(-) diff --git a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp index 746c8d64..7701546b 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp @@ -215,22 +215,22 @@ int ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu(float zahl, float ziffer_vor return result; } - if ((ziffer_vorgaenger >= DigitalUebergangsbereichVorgaengerAnalogToDigit ) && (ziffer_vorgaenger <= (10.0 - DigitalUebergangsbereichVorgaengerAnalogToDigit))) + /* if ((ziffer_vorgaenger >= DigitalUebergangsbereichVorgaengerAnalogToDigit ) && (ziffer_vorgaenger <= (10.0 - DigitalUebergangsbereichVorgaengerAnalogToDigit))) { - /* Bei DigitalUebergangsbereichVorgaengerAnalogToDigit verursacht runden weitere Fehler + Bei DigitalUebergangsbereichVorgaengerAnalogToDigit verursacht runden weitere Fehler // kein Ziffernwechsel, da Vorgänger weit genug weg ist (0+/-DigitalUebergangsbereichVorgaenger) --> zahl wird gerundet if ((ergebnis_nachkomma <= 2) || (ergebnis_nachkomma >= 8)) // Band um die Ziffer --> Runden, da Ziffer im Rahmen Ungenauigkeit erreicht result = ((int) trunc(zahl) + 10) % 10; else result = ((int) round(zahl) + 10) % 10; - */ + result = ((int) trunc(zahl) + 10) % 10; if (debugdetailgeneral) LogFile.WriteToFile("ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu - kein Ziffernwechsel, da Vorkomma weit genug weg = " + std::to_string(result) + " zahl: " + std::to_string(zahl) + " ziffer_vorgaenger = " + std::to_string(ziffer_vorgaenger) + " DigitalUnschaerfe = " + std::to_string(DigitalUnschaerfe)); return result; } - - if (ziffer_vorgaenger <= 1 && eval_vorgaenger<9) // Nulldurchgang hat stattgefunden (!Bewertung über Prev_value und nicht Zahl!) --> hier aufrunden (2.8 --> 3, aber auch 3.1 --> 3) +*/ + if (ziffer_vorgaenger <= 3 && eval_vorgaenger<9) // Nulldurchgang hat stattgefunden (!Bewertung über Prev_value und nicht Zahl!) --> hier aufrunden (2.8 --> 3, aber auch 3.1 --> 3) // aber Sonderfall ziffer_vorgaeger = 0.1 vor_vorgaenger 9.9 => eval_vorgaenger ist 9, damit hat Nulldurchgang nicht stattgefunden. { if (ergebnis_nachkomma > 5) @@ -242,10 +242,15 @@ int ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu(float zahl, float ziffer_vor return result; } - // bleibt nur >= 9.5 --> noch kein Nulldurchgang --> 2.8 --> 2, und 3.1 --> 2 - // hier auf 4 reduziert, da erst ab Vorgänder 9 anfängt umzustellen. Bei 9.5 Vorgänger kann die aktuelle - // Zahl noch x.4 - x.5 sein. - if (ergebnis_nachkomma >= 4) + // Vorlauf ziffer_vorgaenger <=9.9 und ergebnis_nachkomma >=0..1 (digits drehen nach umschalten nicht gleich weiter) + // Beispiel dig=4.0, ana=9.1 ==> dig=3 + + // Nachlauf ziffer_vorgaenger 0..2 und ergebnis_nachkomma 8..9 + // Beispiel dig=6.8, ana=2.2 ==> dig=7 + // dig=4.8, ana=5.5 => dig=4 + + // Aber zwischen ziffer_vorgaenger 3..8 keine Veränderung + if (ergebnis_nachkomma >= 1 || (ziffer_vorgaenger>3 && ziffer_vorgaenger<8) ) result = ergebnis_vorkomma; else result = (ergebnis_vorkomma - 1 + 10) % 10; diff --git a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.h b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.h index e53ec9c0..055df5e3 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.h +++ b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.h @@ -28,7 +28,7 @@ protected: float DigitalUnschaerfe = 0.2; int DigitalBand = 3; float DigitalAnalogerVorgaengerUebergangsbereich = 2; - float DigitalUebergangsbereichVorgaengerAnalogToDigit = 1; // war vorher 2 + // nicht mehr benötigt float DigitalUebergangsbereichVorgaengerAnalogToDigit = 1; // war vorher 2 float DigitalUebergangsbereichVorgaenger = 0.7; // 9.3 - 0.7 float DigitalUebergangsbereichVorlauf = 9.7; // Vorlauf-Nulldurchgang passiert erst ab ca. 9.7 diff --git a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp index 535fdbdd..eaf62ef2 100644 --- a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp +++ b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp @@ -101,7 +101,7 @@ void test_doFlow() { digits = { 1.1, 9.0, 4.0}; analogs = { 8.1, 2.6, 6.25, 9.7}; - expected = "194.8259"; + expected = "193.8259"; result = process_doFlow(analogs, digits); TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); @@ -318,6 +318,52 @@ void test_doFlow() { result = process_doFlow(analogs, digits, Digital100, false, true, -3); TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); + // Fehler bei V12.0.1 + // https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1277425333 + digits = { 2.2, 4.5, 5.9}; // 245.938 als falsches Ergebnis + analogs = { 9.4, 3.8, 8.6}; + expected = "245.938"; + expected_extended= "245.9386"; + + // extendResolution=false + result = process_doFlow(analogs, digits, Digital100, false, false, 0); + TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + + // checkConsistency=false und extendResolution=true + result = process_doFlow(analogs, digits, Digital100, false, true, 0); + TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); + + // Fehler bei V12.0.1 + // https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1277425333 + digits = { 2.2, 4.5, 5.9}; // 245.938 kein Fehler. Aber Grenzfall, deshalb mit als Test aufgenommen. + analogs = { 9.4, 3.8, 8.6}; + expected = "245.938"; + expected_extended= "245.9386"; + + // extendResolution=false + result = process_doFlow(analogs, digits, Digital100, false, false, 0); + TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + + // checkConsistency=false und extendResolution=true + result = process_doFlow(analogs, digits, Digital100, false, true, 0); + TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); + + // Fehler bei V12.0.1 + // https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1265523710 + digits = { 2.0, 4.0, 6.8}; // 246.2045 als falsches Ergebnis + analogs = { 2.2, 0.1, 4.5}; + expected = "247.204"; + expected_extended= "247.2045"; + + // extendResolution=false + result = process_doFlow(analogs, digits, Digital100, false, false, 0); + TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + + // checkConsistency=false und extendResolution=true + result = process_doFlow(analogs, digits, Digital100, false, true, 0); + TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); + + } From e341564eeec6a3cbeee926745aada1b7d1e3043a Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Thu, 13 Oct 2022 22:15:08 +0200 Subject: [PATCH 24/25] missing test cases from #1110 added --- .../test_flowpostprocessing.cpp | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp index eaf62ef2..c45b0c83 100644 --- a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp +++ b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp @@ -363,6 +363,37 @@ void test_doFlow() { result = process_doFlow(analogs, digits, Digital100, false, true, 0); TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); + + // Fehler bei V12.0.1 + // https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issue-1391153343 + digits = { 1.0, 4.0, 2.0}; // 142.9269 als falsches Ergebnis + analogs = { 9.2, 2.5, 6.8, 9.0}; + expected = "141.9269"; + expected_extended= "141.92690"; + + // extendResolution=false + result = process_doFlow(analogs, digits, Digital100, false, false, 0); + TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + + // checkConsistency=false und extendResolution=true + result = process_doFlow(analogs, digits, Digital100, false, true, 0); + TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); + + + // Fehler bei V12.0.1 + // https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1262626388 + digits = { 1.2, 6.8, 0.0, 0.0, 5.0, 2.8}; //170.05387 als falsches Ergebnis + analogs = { 8.7}; + expected = "170.0528"; + expected_extended= "170.05287"; + + // extendResolution=false + result = process_doFlow(analogs, digits, Digital100, false, false, -3); + TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + + // checkConsistency=false und extendResolution=true + result = process_doFlow(analogs, digits, Digital100, false, true, -3); + TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); } From b0e7283d2bc9365e68439bd37b166304f7675d1d Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Thu, 13 Oct 2022 22:40:33 +0200 Subject: [PATCH 25/25] added lokal test case --- .../test_flowpostprocessing.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp index c45b0c83..47c61775 100644 --- a/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp +++ b/code/test/components/jomjol-flowcontroll/test_flowpostprocessing.cpp @@ -395,6 +395,22 @@ void test_doFlow() { result = process_doFlow(analogs, digits, Digital100, false, true, -3); TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); + + // Fehler bei rolling post V12.0.1 + // lokal watermeter1 + digits = { 0.0, 0.0, 9.0, 1.0}; //91.88174 als falsches Ergebnis + analogs = {9.0, 8.0, 1.8, 7.4}; + expected = "90.8817"; + expected_extended= "90.88174"; + + // extendResolution=false + result = process_doFlow(analogs, digits, Digital100, false, false, 0); + TEST_ASSERT_EQUAL_STRING(expected, result.c_str()); + + // checkConsistency=false und extendResolution=true + result = process_doFlow(analogs, digits, Digital100, false, true, 0); + TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str()); + }