jomjol 4 лет назад
Родитель
Сommit
e2a403441f

+ 5 - 1
README.md

@@ -49,9 +49,13 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
 
 ##### Rolling (2021-09-22)
 
+* html: incorporate hostname to title and main page
+* Improved stability during html requests
+
+Rolling (2021-09-21)
+
 * bug fix
 
-  
 
 
 Rolling (2021-09-20)

+ 2 - 2
code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp

@@ -612,12 +612,12 @@ std::vector<HTMLInfo*> ClassFlowCNNGeneral::GetHTMLInfo()
             zw->image = GENERAL[_ana]->ROI[i]->image;
             zw->image_org = GENERAL[_ana]->ROI[i]->image_org;
 
-            printf("Push %s\n", zw->filename.c_str());
+//            printf("Push %s\n", zw->filename.c_str());
 
             result.push_back(zw);
         }
 
-    printf("größe: %d\n", result.size());
+//    printf("größe: %d\n", result.size());
 
     return result;
 }

+ 49 - 55
code/components/jomjol_flowcontroll/ClassFlowControll.cpp

@@ -74,7 +74,7 @@ std::string ClassFlowControll::TranslateAktstatus(std::string _input)
 }
 
 
-std::vector<HTMLInfo*> ClassFlowControll::GetAllDigital()
+std::vector<HTMLInfo*> ClassFlowControll::GetAllDigital() 
 {
     if (flowdigit)
     {
@@ -240,8 +240,8 @@ void ClassFlowControll::InitFlow(std::string config)
 
 }
 
-std::string ClassFlowControll::getActStatus(){
-    return aktstatus;
+std::string* ClassFlowControll::getActStatus(){
+    return &aktstatus;
 }
 
 void ClassFlowControll::doFlowMakeImageOnly(string time){
@@ -554,65 +554,59 @@ esp_err_t ClassFlowControll::GetJPGStream(std::string _fn, httpd_req_t *req)
     {
         _send = flowalignment->ImageBasis;  
     }
-
-
-
-    if (_fn == "alg_roi.jpg")
-    {
-        CImageBasis* _imgzw = new CImageBasis(flowalignment->ImageBasis);
-        flowalignment->DrawRef(_imgzw);
-        if (flowdigit) flowdigit->DrawROI(_imgzw);
-        if (flowanalog) flowanalog->DrawROI(_imgzw);
-
-/*/////////////////////////////////////        
-        cimg_library::CImg<unsigned char> 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;
-    }
-
-    std::vector<HTMLInfo*> htmlinfo;
-    htmlinfo = GetAllDigital();
-    for (int i = 0; i < htmlinfo.size(); ++i)
+    else
     {
-        if (_fn == htmlinfo[i]->filename)
+        if (_fn == "alg_roi.jpg")
         {
-            if (htmlinfo[i]->image)
-                _send = htmlinfo[i]->image;
+            CImageBasis* _imgzw = new CImageBasis(flowalignment->ImageBasis);
+            flowalignment->DrawRef(_imgzw);
+            if (flowdigit) flowdigit->DrawROI(_imgzw);
+            if (flowanalog) flowanalog->DrawROI(_imgzw);
+            _send = _imgzw;
+            Dodelete = true;
         }
-        if (_fn == htmlinfo[i]->filename_org)
+        else
         {
-            if (htmlinfo[i]->image_org)
-                _send = htmlinfo[i]->image_org;        
-        }
-        delete htmlinfo[i];
-    }
-    htmlinfo.clear();
+            std::vector<HTMLInfo*> htmlinfo;
+            htmlinfo = GetAllDigital();
+            for (int i = 0; i < htmlinfo.size(); ++i)
+            {
+                if (_fn == htmlinfo[i]->filename)
+                {
+                    if (htmlinfo[i]->image)
+                        _send = htmlinfo[i]->image;
+                }
+                if (_fn == htmlinfo[i]->filename_org)
+                {
+                    if (htmlinfo[i]->image_org)
+                        _send = htmlinfo[i]->image_org;        
+                }
+                delete htmlinfo[i];
+            }
+            htmlinfo.clear();
 
-    htmlinfo = GetAllAnalog();
-    for (int i = 0; i < htmlinfo.size(); ++i)
-    {
-        if (_fn == htmlinfo[i]->filename)
-        {
-            if (htmlinfo[i]->image)
-                _send = htmlinfo[i]->image;
-        }
-        if (_fn == htmlinfo[i]->filename_org)
-        {
-            if (htmlinfo[i]->image_org)
-                _send = htmlinfo[i]->image_org;        
+            if (!_send)
+            {
+                htmlinfo = GetAllAnalog();
+                for (int i = 0; i < htmlinfo.size(); ++i)
+                {
+                    if (_fn == htmlinfo[i]->filename)
+                    {
+                        if (htmlinfo[i]->image)
+                            _send = htmlinfo[i]->image;
+                    }
+                    if (_fn == htmlinfo[i]->filename_org)
+                    {
+                        if (htmlinfo[i]->image_org)
+                            _send = htmlinfo[i]->image_org;        
+                    }
+                    delete htmlinfo[i];
+                }
+                htmlinfo.clear();
+
+            }
         }
-        delete htmlinfo[i];
     }
-    htmlinfo.clear();
 
     if (_send)
     {

+ 1 - 1
code/components/jomjol_flowcontroll/ClassFlowControll.h

@@ -60,7 +60,7 @@ public:
 
 	bool isAutoStart(long &_intervall);
 
-	std::string getActStatus();
+	std::string* getActStatus();
 
 	std::vector<HTMLInfo*> GetAllDigital();
 	std::vector<HTMLInfo*> GetAllAnalog();	

+ 1 - 27
code/components/jomjol_tfliteclass/CTfLiteClass.cpp

@@ -69,32 +69,6 @@ int CTfLiteClass::GetOutClassification(int _von, int _bis)
   return (zw_class - _von);
 }
 
-/*
-int CTfLiteClass::GetOutClassification()
-{
-  TfLiteTensor* output2 = interpreter->output(0);
-
-  float zw_max = 0;
-  float zw;
-  int zw_class = -1;
-
-  if (output2 == NULL)
-    return -1;
-
-  int numeroutput = output2->dims->data[1];
-  for (int i = 0; i < numeroutput; ++i)
-  {
-    zw = output2->data.f[i];
-    if (zw > zw_max)
-    {
-        zw_max = zw;
-        zw_class = i;
-    }
-  }
-  return zw_class;
-}
-*/
-
 void CTfLiteClass::GetInputDimension(bool silent = false)
 {
   TfLiteTensor* input2 = this->interpreter->input(0);
@@ -283,7 +257,7 @@ CTfLiteClass::CTfLiteClass()
     this->interpreter = nullptr;
     this->input = nullptr;
     this->output = nullptr;  
-    this->kTensorArenaSize = 200 * 1024;   /// laut testfile: 108000 - bisher 600
+    this->kTensorArenaSize = 800 * 1024;   /// laut testfile: 108000 - bisher 600;; 2021-09-11: 200 * 1024
     this->tensor_arena = new uint8_t[kTensorArenaSize]; 
 }
 

+ 2 - 36
code/components/jomjol_tfliteclass/server_tflite.cpp

@@ -28,9 +28,6 @@ ClassFlowControll tfliteflow;
 TaskHandle_t xHandleblink_task_doFlow = NULL;
 TaskHandle_t xHandletask_autodoFlow = NULL;
 
-
-
-
 bool flowisrunning = false;
 
 long auto_intervall = 0;
@@ -506,35 +503,6 @@ esp_err_t handler_editflow(httpd_req_t *req)
         httpd_resp_sendstr_chunk(req, zw.c_str()); 
     }
 
-/*      
-    if (_task.compare("test_analog") == 0)
-    {
-        std::string _host = "";
-        if (httpd_query_key_value(_query, "host", _valuechar, 30) == ESP_OK) {
-            _host = std::string(_valuechar);
-        }
-//        printf("Parameter host: "); printf(_host.c_str()); printf("\n"); 
-//        string zwzw = "Do " + _task + " start\n"; printf(zwzw.c_str());
-        std::string zw = tfliteflow.doSingleStep("[Analog]", _host);
-        httpd_resp_sendstr_chunk(req, zw.c_str()); 
-    }
-*/  
-/*    
-    if (_task.compare("test_digits") == 0)
-    {
-        std::string _host = "";
-        if (httpd_query_key_value(_query, "host", _valuechar, 30) == ESP_OK) {
-            _host = std::string(_valuechar);
-        }
-//        printf("Parameter host: "); printf(_host.c_str()); printf("\n"); 
-
-//        string zwzw = "Do " + _task + " start\n"; printf(zwzw.c_str());
-        std::string zw = tfliteflow.doSingleStep("[Digits]", _host);
-        httpd_resp_sendstr_chunk(req, zw.c_str()); 
-    } 
-*/
-
-
     /* Respond with an empty chunk to signal HTTP response completion */
     httpd_resp_sendstr_chunk(req, NULL);   
 
@@ -553,15 +521,13 @@ esp_err_t handler_statusflow(httpd_req_t *req)
 #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();
+    string* 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));   

+ 5 - 3
code/main/server_main.cpp

@@ -47,6 +47,8 @@ esp_err_t info_get_handler(httpd_req_t *req)
         }
     };
 
+    httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
+
     if (_task.compare("GitBranch") == 0)
     {
         std::string zw;
@@ -400,15 +402,15 @@ httpd_handle_t start_webserver(void)
     httpd_config_t config = { };
 
     config.task_priority      = tskIDLE_PRIORITY+5;
-    config.stack_size         = 32768;                  // bei 32k stürzt das Programm beim Bilderaufnehmen ab
+    config.stack_size         = 32768;      //20210921 --> vorher 32768             // bei 32k stürzt das Programm beim Bilderaufnehmen ab
     config.core_id            = tskNO_AFFINITY;
     config.server_port        = 80;
     config.ctrl_port          = 32768;
-    config.max_open_sockets   = 7;      
+    config.max_open_sockets   = 5;          //20210921 --> vorher 7   
     config.max_uri_handlers   = 24;                       
     config.max_resp_headers   = 8;                        
     config.backlog_conn       = 5;                        
-    config.lru_purge_enable   = true;       // dadurch werden alter Verbindungen gekappt, falls neue benögt werden.               
+    config.lru_purge_enable   = true;       // dadurch werden alte 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;                        

+ 2 - 2
code/main/version.cpp

@@ -1,4 +1,4 @@
-const char* GIT_REV="c033db9";
+const char* GIT_REV="9b3665b";
 const char* GIT_TAG="";
 const char* GIT_BRANCH="rolling";
-const char* BUILD_TIME="2021-09-21 18:28";
+const char* BUILD_TIME="2021-09-22 21:16";

+ 2 - 2
code/sdkconfig

@@ -389,7 +389,7 @@ CONFIG_ESP_INT_WDT_TIMEOUT_MS=300
 CONFIG_ESP_INT_WDT_CHECK_CPU1=y
 CONFIG_ESP_TASK_WDT=y
 # CONFIG_ESP_TASK_WDT_PANIC is not set
-CONFIG_ESP_TASK_WDT_TIMEOUT_S=3
+CONFIG_ESP_TASK_WDT_TIMEOUT_S=6
 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
 # CONFIG_ESP_PANIC_HANDLER_IRAM is not set
@@ -1107,7 +1107,7 @@ CONFIG_INT_WDT_TIMEOUT_MS=300
 CONFIG_INT_WDT_CHECK_CPU1=y
 CONFIG_TASK_WDT=y
 # CONFIG_TASK_WDT_PANIC is not set
-CONFIG_TASK_WDT_TIMEOUT_S=3
+CONFIG_TASK_WDT_TIMEOUT_S=6
 CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
 CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
 # CONFIG_EVENT_LOOP_PROFILING is not set

+ 2 - 1
code/sdkconfig.old

@@ -138,7 +138,8 @@ CONFIG_COMPILER_OPTIMIZATION_SIZE=y
 CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
 # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set
 # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
-# CONFIG_COMPILER_CXX_EXCEPTIONS is not set
+CONFIG_COMPILER_CXX_EXCEPTIONS=y
+CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE=0
 # CONFIG_COMPILER_CXX_RTTI is not set
 CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y
 # CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set

+ 2 - 2
code/version.cpp

@@ -1,4 +1,4 @@
-const char* GIT_REV="c033db9";
+const char* GIT_REV="9b3665b";
 const char* GIT_TAG="";
 const char* GIT_BRANCH="rolling";
-const char* BUILD_TIME="2021-09-21 18:27";
+const char* BUILD_TIME="2021-09-22 21:16";

BIN
firmware/bootloader.bin


BIN
firmware/firmware.bin


BIN
firmware/html.zip


+ 1 - 1
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.74";          // jomjol interner Real
 //        host = "http://192.168.43.191";
 //        host = ".";                           // jomjol interner localhost   
 

+ 33 - 1
sd-card/html/index.html

@@ -73,7 +73,7 @@ li.dropdown {
 
 <body style="font-family: arial">
 
-<h1>Digitizer - AI on the edge</h1>
+<h1 id="id_title">Digitizer - AI on the edge</h1>
 <h2>An ESP32 all inclusive neural network recognition system for meter digitalization</h2>
 
 <ul>
@@ -102,5 +102,37 @@ li.dropdown {
 	 <iframe name="maincontent" id ="maincontent" src="/wasserzaehler_roi.html" title="fileserver" allowfullscreen></iframe> 
 </div>
 
+<script type="text/javascript" src="./gethost.js"></script> 
+<script type="text/javascript" src="./readconfigcommon.js"></script>  
+<script type="text/javascript" src="./readconfigparam.js"></script>  
+
+
+<script type="text/javascript">
+	var basepath = "http://192.168.178.22";
+
+
+  function LoadHostname() {
+    _basepath = getbasepath(); 
+
+     var xhttp = new XMLHttpRequest();
+     try {
+          url = _basepath + '/version?type=Hostname';     
+          xhttp.open("GET", url, false);
+          xhttp.send();
+          hostname = xhttp.responseText;
+          document.title = "jomjol - AI on the edge - " + hostname;
+          document.getElementById("id_title").innerHTML  = "Digitizer - AI on the edge - " + hostname;
+
+     }
+     catch (error)
+     {
+               alert("Loading Hostname failed");
+     }
+  }
+
+  LoadHostname();
+
+</script>
+
 </body>
 </html>

+ 1 - 1
sd-card/html/version.txt

@@ -1 +1 @@
-10.0.0
+10.1.0