diff --git a/Changelog.md b/Changelog.md index 0e490c0b..9952c6b8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,34 @@ + + +##### 7.1.2 MQTT-Update - (2021-06-17) + +* NEW: 7.1.2: bug fix setting hostname, Flash-LED not off during rebootNEW: 7.1.1: bug fix wlan password with "=" (again) + +* MQTT error message: changes "no error", send retain flag + +* Update wlan handling to esp-idf 4.1 + +* Upgrade digital CNN to v8.7.0 (added new images) + +* Bug fix: MQTT, WLAN, LED-Controll, GPIO usage, fixed IP, calculation flow rate + + + +##### 7.0.1 MQTT-Update - (2021-05-13) + +* NEW: 7.0.1: bug fix wlan password with "=" + +* Upgrade digital CNN to v8.5.0 (added new images) + +* New MQTT topics: flow rate (units/minute), time stamp (last correct read readout) + +* Update MQTT/Error topic to " " in case no error (instead of empty string) + +* Portrait or landscape image orientation in rotated image (avoid cropping) + ##### 6.7.2 Image Processing in Memory - (2021-05-01) * NEW 6.7.2: Updated html for setup modus - remove reboot on edit configuration) diff --git a/README.md b/README.md index ffc4ed17..d29add21 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,12 @@ In other cases you can contact the developer via email: **ATTENTION: the configuration and prevalue files are modified automatically and will not be backward compatible!** - -##### 7.1.2 MQTT-Update - (2021-06-17) - -* NEW: 7.1.2: bug fix setting hostname, Flash-LED not off during rebootNEW: 7.1.1: bug fix wlan password with "=" (again) -* MQTT error message: changes "no error", send retain flag -* Update wlan handling to esp-idf 4.1 -* Upgrade digital CNN to v8.7.0 (added new images) -* Bug fix: MQTT, WLAN, LED-Controll, GPIO usage, fixed IP, calculation flow rate - - - -##### 7.0.1 MQTT-Update - (2021-05-13) - -* NEW: 7.0.1: bug fix wlan password with "=" - -* Upgrade digital CNN to v8.5.0 (added new images) - -* New MQTT topics: flow rate (units/minute), time stamp (last correct read readout) - -* Update MQTT/Error topic to " " in case no error (instead of empty string) - -* Portrait or landscape image orientation in rotated image (avoid cropping) - - - - ## Additional ideas There are some ideas and feature request, which are not followed currently - mainly due to capacity reasons on side of the developer. They are collected here: [FeatureRequest.md](FeatureRequest.md) @@ -107,6 +87,10 @@ There are some ideas and feature request, which are not followed currently - mai ## History +##### 7.1.2 MQTT-Update - (2021-06-17) + +**7.0.1 MQTT-Update - (2021-05-13)** + ##### 6.7.2 Image Processing in Memory - (2021-05-01) ##### 5.0.0 Setup Modus - (2020-12-06) @@ -129,8 +113,3 @@ There are some ideas and feature request, which are not followed currently - mai #### [Full Changelog](Changelog.md) - - -## Solved topics - -* n.a. diff --git a/code/components/jomjol_flowcontroll/ClassFlowControll.cpp b/code/components/jomjol_flowcontroll/ClassFlowControll.cpp index c27f1c4c..52a739bf 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowControll.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowControll.cpp @@ -12,6 +12,9 @@ #include "Helper.h" #include "server_ota.h" + +//#include "CImg.h" + #include "server_help.h" //#define DEBUG_DETAIL_ON @@ -51,6 +54,25 @@ std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _ return result; } +std::string ClassFlowControll::TranslateAktstatus(std::string _input) +{ + if (_input.compare("ClassFlowMakeImage") == 0) + return ("Take Image"); + if (_input.compare("ClassFlowAlignment") == 0) + return ("Aligning"); + if (_input.compare("ClassFlowAnalog") == 0) + return ("Analog ROIs"); + if (_input.compare("ClassFlowDigit") == 0) + return ("Digital ROIs"); + if (_input.compare("ClassFlowMQTT") == 0) + return ("Sending MQTT"); + if (_input.compare("ClassFlowPostProcessing") == 0) + return ("Processing"); + + return "Unkown Status"; +} + + std::vector ClassFlowControll::GetAllDigital() { for (int i = 0; i < FlowControll.size(); ++i) @@ -95,7 +117,7 @@ void ClassFlowControll::SetInitialParameter(void) flowpostprocessing = NULL; disabled = false; aktRunNr = 0; - aktstatus = "Startup"; + aktstatus = "Booting ..."; } @@ -209,9 +231,9 @@ void ClassFlowControll::doFlowMakeImageOnly(string time){ for (int i = 0; i < FlowControll.size(); ++i) { if (FlowControll[i]->name() == "ClassFlowMakeImage") { - zw_time = gettimestring("%Y%m%d-%H%M%S"); - aktstatus = zw_time + ": " + FlowControll[i]->name(); - string zw = "FlowControll.doFlowMakeImageOnly - " + FlowControll[i]->name(); +// zw_time = gettimestring("%Y%m%d-%H%M%S"); + zw_time = gettimestring("%H:%M:%S"); + aktstatus = TranslateAktstatus(FlowControll[i]->name()) + " (" + zw_time + ")"; FlowControll[i]->doFlow(time); } } @@ -231,8 +253,11 @@ bool ClassFlowControll::doFlow(string time) for (int i = 0; i < FlowControll.size(); ++i) { - zw_time = gettimestring("%Y%m%d-%H%M%S"); - aktstatus = zw_time + ": " + FlowControll[i]->name(); + zw_time = gettimestring("%H:%M:%S"); + aktstatus = TranslateAktstatus(FlowControll[i]->name()) + "(" + zw_time + ")"; + +// zw_time = gettimestring("%Y%m%d-%H%M%S"); +// aktstatus = zw_time + ": " + FlowControll[i]->name(); string zw = "FlowControll.doFlow - " + FlowControll[i]->name(); @@ -259,25 +284,11 @@ bool ClassFlowControll::doFlow(string time) #endif } - zw_time = gettimestring("%Y%m%d-%H%M%S"); - aktstatus = zw_time + ": Flow is done"; + zw_time = gettimestring("%H:%M:%S"); + aktstatus = "Flow finished (" + zw_time + ")"; return result; } -void ClassFlowControll::UpdateAktStatus(std::string _flow) -{ - aktstatus = gettimestring("%Y%m%d-%H%M%S"); - aktstatus = aktstatus + "\t" + std::to_string(aktRunNr) + "\t"; - - if (_flow == "ClassFlowMakeImage") - aktstatus = aktstatus + "Taking Raw Image"; - else - if (_flow == "ClassFlowAlignment") - aktstatus = aktstatus + "Aligning Image"; - - -} - string ClassFlowControll::getReadoutAll(int _type) { @@ -289,10 +300,18 @@ string ClassFlowControll::getReadoutAll(int _type) out = out + numbers[i]->name + "\t"; switch (_type) { case READOUT_TYPE_VALUE: - out = out + numbers[i]->ReturnValue; + out = out + numbers[i]->ReturnValueNoError; break; case READOUT_TYPE_PREVALUE: - out = out + numbers[i]->ReturnPreValue; + if (flowpostprocessing->PreValueUse) + { + if (numbers[i]->PreValueOkay) + out = out + numbers[i]->ReturnPreValue; + else + out = out + "PreValue too old"; + } + else + out = out + "PreValue deactivated"; break; case READOUT_TYPE_RAWVALUE: out = out + numbers[i]->ReturnRawValue; @@ -523,6 +542,18 @@ esp_err_t ClassFlowControll::GetJPGStream(std::string _fn, httpd_req_t *req) flowalignment->DrawRef(_imgzw); if (flowdigit) flowdigit->DrawROI(_imgzw); if (flowanalog) flowanalog->DrawROI(_imgzw); + +/*///////////////////////////////////// + cimg_library::CImg cimg(_imgzw->rgb_image, _imgzw->bpp, _imgzw->width, _imgzw->height, 1); + + //Convert cimg type +// cimg.permute_axes("yzcx"); + cimg.draw_text(300, 300, "Dies ist ein Test", "black"); + + + //Convert back to stb type to save +// cimg.permute_axes("cxyz"); +*//////////////////////////////////// _send = _imgzw; Dodelete = true; } diff --git a/code/components/jomjol_flowcontroll/ClassFlowControll.h b/code/components/jomjol_flowcontroll/ClassFlowControll.h index 31875f8b..29de1089 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowControll.h +++ b/code/components/jomjol_flowcontroll/ClassFlowControll.h @@ -36,8 +36,6 @@ protected: std::string aktstatus; int aktRunNr; - void UpdateAktStatus(std::string _flow); - public: void InitFlow(std::string config); bool doFlow(string time); @@ -49,6 +47,8 @@ public: string GetPrevalue(std::string _number = ""); bool ReadParameter(FILE* pfile, string& aktparamgraph); + string TranslateAktstatus(std::string _input); + string GetMQTTMainTopic(); esp_err_t GetJPGStream(std::string _fn, httpd_req_t *req); diff --git a/code/components/jomjol_flowcontroll/ClassFlowDigit.cpp b/code/components/jomjol_flowcontroll/ClassFlowDigit.cpp index fdd67c3d..170eeba7 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowDigit.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowDigit.cpp @@ -28,6 +28,7 @@ void ClassFlowDigit::SetInitialParameter(void) disabled = false; DecimalShift = 0; DecimalShiftEnabled = false; + isLogImageSelect = false; } ClassFlowDigit::ClassFlowDigit() : ClassFlowImage(TAG) @@ -119,6 +120,13 @@ bool ClassFlowDigit::ReadParameter(FILE* pfile, string& aktparamgraph) LogImageLocation = "/sdcard" + zerlegt[1]; isLogImage = true; } + + if ((zerlegt[0] == "LogImageSelect") && (zerlegt.size() > 1)) + { + LogImageSelect = zerlegt[1]; + isLogImageSelect = true; + } + if ((zerlegt[0] == "Model") && (zerlegt.size() > 1)) { cnnmodelfile = zerlegt[1]; @@ -328,7 +336,17 @@ bool ClassFlowDigit::doNeuralNetwork(string time) if (isLogImage) { - LogImage(logPath, DIGIT[_dig]->ROI[i]->name, NULL, &DIGIT[_dig]->ROI[i]->resultklasse, time, DIGIT[_dig]->ROI[i]->image_org); + if (isLogImageSelect) + { + if (LogImageSelect.find(DIGIT[_dig]->ROI[i]->name) != std::string::npos) + { + LogImage(logPath, DIGIT[_dig]->ROI[i]->name, NULL, &DIGIT[_dig]->ROI[i]->resultklasse, time, DIGIT[_dig]->ROI[i]->image_org); + } + } + else + { + LogImage(logPath, DIGIT[_dig]->ROI[i]->name, NULL, &DIGIT[_dig]->ROI[i]->resultklasse, time, DIGIT[_dig]->ROI[i]->image_org); + } } } #ifndef OHNETFLITE diff --git a/code/components/jomjol_flowcontroll/ClassFlowDigit.h b/code/components/jomjol_flowcontroll/ClassFlowDigit.h index f6d98616..f89d2e85 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowDigit.h +++ b/code/components/jomjol_flowcontroll/ClassFlowDigit.h @@ -33,6 +33,9 @@ protected: int DecimalShift; bool DecimalShiftEnabled; + bool isLogImageSelect; + string LogImageSelect; + ClassFlowAlignment* flowpostalignment; diff --git a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h index a53243e5..14d3ed5f 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h +++ b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h @@ -51,7 +51,6 @@ protected: std::vector NUMBERS; bool UpdatePreValueINI; - bool PreValueUse; int PreValueAgeStartup; bool ErrorMessage; @@ -77,6 +76,8 @@ protected: public: + bool PreValueUse; + ClassFlowPostProcessing(std::vector* lfc); bool ReadParameter(FILE* pfile, string& aktparamgraph); bool doFlow(string time); diff --git a/code/components/jomjol_tfliteclass/CTfLiteClass.cpp b/code/components/jomjol_tfliteclass/CTfLiteClass.cpp index 9ff43353..f2fa67f2 100644 --- a/code/components/jomjol_tfliteclass/CTfLiteClass.cpp +++ b/code/components/jomjol_tfliteclass/CTfLiteClass.cpp @@ -17,6 +17,7 @@ float CTfLiteClass::GetOutputValue(int nr) return output2->data.f[nr]; } + int CTfLiteClass::GetClassFromImageBasis(CImageBasis *rs) { if (!LoadInputImageBasis(rs)) diff --git a/code/components/jomjol_tfliteclass/CTfLiteClass.h b/code/components/jomjol_tfliteclass/CTfLiteClass.h index 4c6ed8f7..b5cbc7ea 100644 --- a/code/components/jomjol_tfliteclass/CTfLiteClass.h +++ b/code/components/jomjol_tfliteclass/CTfLiteClass.h @@ -64,6 +64,7 @@ class CTfLiteClass void GetOutPut(); int GetOutClassification(); int GetClassFromImageBasis(CImageBasis *rs); + std::string GetStatusFlow(); float GetOutputValue(int nr); void GetInputDimension(bool silent); diff --git a/code/components/jomjol_tfliteclass/server_tflite.cpp b/code/components/jomjol_tfliteclass/server_tflite.cpp index f38c19ba..b859edeb 100644 --- a/code/components/jomjol_tfliteclass/server_tflite.cpp +++ b/code/components/jomjol_tfliteclass/server_tflite.cpp @@ -530,6 +530,36 @@ esp_err_t handler_editflow(httpd_req_t *req) }; +esp_err_t handler_statusflow(httpd_req_t *req) +{ +#ifdef DEBUG_DETAIL_ON + LogFile.WriteHeapInfo("handler_prevalue - Start"); +#endif + + const char* resp_str; + string zw; + +#ifdef DEBUG_DETAIL_ON + printf("handler_prevalue:\n"); printf(req->uri); printf("\n"); +#endif + + zw = tfliteflow.getActStatus(); + + resp_str = zw.c_str(); + + httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); + httpd_resp_send(req, resp_str, strlen(resp_str)); + /* Respond with an empty chunk to signal HTTP response completion */ + httpd_resp_send_chunk(req, NULL, 0); + +#ifdef DEBUG_DETAIL_ON + LogFile.WriteHeapInfo("handler_prevalue - Start"); +#endif + + return ESP_OK; +}; + + esp_err_t handler_prevalue(httpd_req_t *req) { #ifdef DEBUG_DETAIL_ON @@ -684,6 +714,10 @@ void register_server_tflite_uri(httpd_handle_t server) camuri.user_ctx = (void*) "Light Off"; httpd_register_uri_handler(server, &camuri); + camuri.uri = "/statusflow.html"; + camuri.handler = handler_statusflow; + camuri.user_ctx = (void*) "Light Off"; + httpd_register_uri_handler(server, &camuri); camuri.uri = "/editflow.html"; camuri.handler = handler_editflow; diff --git a/code/main/server_main.cpp b/code/main/server_main.cpp index de2683e3..b06eca6a 100644 --- a/code/main/server_main.cpp +++ b/code/main/server_main.cpp @@ -131,6 +131,16 @@ esp_err_t info_get_handler(httpd_req_t *req) return ESP_OK; } + if (_task.compare("FlowStatus") == 0) + { + std::string zw; + zw = std::string("FlowStatus"); + httpd_resp_sendstr_chunk(req, zw.c_str()); + httpd_resp_sendstr_chunk(req, NULL); + return ESP_OK; + } + + #ifdef DEBUG_DETAIL_ON LogFile.WriteHeapInfo("info_get_handler - Done"); #endif @@ -398,7 +408,7 @@ httpd_handle_t start_webserver(void) config.max_uri_handlers = 24; config.max_resp_headers = 8; config.backlog_conn = 5; - config.lru_purge_enable = false; + config.lru_purge_enable = true; // dadurch werden alter Verbindungen gekappt, falls neue benögt werden. config.recv_wait_timeout = 30; // default: 5 config.send_wait_timeout = 30; // default: 5 config.global_user_ctx = NULL; diff --git a/code/main/version.cpp b/code/main/version.cpp index 80062529..e94e7e4a 100644 --- a/code/main/version.cpp +++ b/code/main/version.cpp @@ -1,4 +1,4 @@ -const char* GIT_REV="f6b1a41"; +const char* GIT_REV="0dac0e8"; const char* GIT_TAG=""; -const char* GIT_BRANCH="master"; -const char* BUILD_TIME="2021-08-12 07:22"; \ No newline at end of file +const char* GIT_BRANCH="rolling"; +const char* BUILD_TIME="2021-08-24 08:31"; \ No newline at end of file diff --git a/code/main/version.h b/code/main/version.h index 78ac0255..551c53f8 100644 --- a/code/main/version.h +++ b/code/main/version.h @@ -13,7 +13,7 @@ extern "C" #include "Helper.h" #include -const char* GIT_BASE_BRANCH = "master - v8.1.0 - 2021-08-12"; +const char* GIT_BASE_BRANCH = "master - v8.2.0 - 2021-08-24"; const char* git_base_branch(void) diff --git a/code/version.cpp b/code/version.cpp index 80062529..e94e7e4a 100644 --- a/code/version.cpp +++ b/code/version.cpp @@ -1,4 +1,4 @@ -const char* GIT_REV="f6b1a41"; +const char* GIT_REV="0dac0e8"; const char* GIT_TAG=""; -const char* GIT_BRANCH="master"; -const char* BUILD_TIME="2021-08-12 07:22"; \ No newline at end of file +const char* GIT_BRANCH="rolling"; +const char* BUILD_TIME="2021-08-24 08:31"; \ No newline at end of file diff --git a/firmware/bootloader.bin b/firmware/bootloader.bin index 814d07f9..7ffd371e 100644 Binary files a/firmware/bootloader.bin and b/firmware/bootloader.bin differ diff --git a/firmware/firmware.bin b/firmware/firmware.bin index 7437cd5b..762034a3 100644 Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ diff --git a/firmware/html.zip b/firmware/html.zip index 4f227a94..94e6db8b 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 26a5520d..b65fb48a 100644 --- a/sd-card/html/gethost.js +++ b/sd-card/html/gethost.js @@ -9,7 +9,7 @@ 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.22"; // jomjol interner Real + host = "http://192.168.178.64"; // jomjol interner Real // host = "http://192.168.43.191"; // host = "."; // jomjol interner localhost diff --git a/sd-card/html/version.txt b/sd-card/html/version.txt index 4a3e1cf6..f0ad3287 100644 --- a/sd-card/html/version.txt +++ b/sd-card/html/version.txt @@ -1 +1 @@ -9.6.0 \ No newline at end of file +9.7.0 \ No newline at end of file diff --git a/sd-card/html/wasserzaehler_roi.html b/sd-card/html/wasserzaehler_roi.html index 322c74fb..61e6cd80 100644 --- a/sd-card/html/wasserzaehler_roi.html +++ b/sd-card/html/wasserzaehler_roi.html @@ -55,12 +55,11 @@
+
- - @@ -82,10 +81,11 @@ function addZero(i) { $('#img').html(''); $('#timestamp').html("Last Page Refresh:" + (h + ":" + m + ":" + s)); + loadStatus(); refresh(); }); - function refresh() { +function refresh() { setTimeout (function() { var time = new Date(); var timestamp = new Date().getTime(); @@ -96,6 +96,7 @@ function addZero(i) { // reassign the url to be like alg_roi.jpg?timestamp=456784512 based on timestamp $('#img').html(''); $('#timestamp').html("Last Page Refresh:" + (h + ":" + m + ":" + s)); + loadStatus(); init(); refresh(); }, 300000); @@ -104,6 +105,20 @@ function addZero(i) { var basepath = "http://192.168.178.22"; + function loadStatus() { + url = basepath + '/statusflow.html'; + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + var _rsp = xhttp.responseText; + _rsp = "Status: " + _rsp; + $('#statusflow').html(_rsp); + } + } + xhttp.open("GET", url, true); + xhttp.send(); + } + function loadValue(_type, _div, _style) { url = basepath + '/wasserzaehler.html?all=true&type=' + _type; var xhttp = new XMLHttpRequest(); @@ -150,8 +165,11 @@ function addZero(i) { loadValue("raw", "raw"); loadValue("prevalue", "prevalue"); loadValue("error", "error", "font-size:8px"); + loadStatus(); } init(); + +