Procházet zdrojové kódy

Improved Logfile, extended Logging

jomjol před 5 roky
rodič
revize
db0ca1cb9b

+ 24 - 1
code/components/jomjol_controlcamera/server_camera.cpp

@@ -29,26 +29,38 @@ void PowerResetCamera(){
 
 
 esp_err_t handler_lightOn(httpd_req_t *req)
 esp_err_t handler_lightOn(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_lightOn - Start");
+
     LogFile.WriteToFile("handler_lightOn");
     LogFile.WriteToFile("handler_lightOn");
     printf("handler_lightOn uri:\n"); printf(req->uri); printf("\n");
     printf("handler_lightOn uri:\n"); printf(req->uri); printf("\n");
     Camera.LightOnOff(true);
     Camera.LightOnOff(true);
     const char* resp_str = (const char*) req->user_ctx;
     const char* resp_str = (const char*) req->user_ctx;
-    httpd_resp_send(req, resp_str, strlen(resp_str));      
+    httpd_resp_send(req, resp_str, strlen(resp_str));  
+
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_lightOn - Done");
+
     return ESP_OK;
     return ESP_OK;
 };
 };
 
 
 esp_err_t handler_lightOff(httpd_req_t *req)
 esp_err_t handler_lightOff(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_lightOff - Start");
+
     LogFile.WriteToFile("handler_lightOff");
     LogFile.WriteToFile("handler_lightOff");
     printf("handler_lightOff uri:\n"); printf(req->uri); printf("\n");
     printf("handler_lightOff uri:\n"); printf(req->uri); printf("\n");
     Camera.LightOnOff(false);
     Camera.LightOnOff(false);
     const char* resp_str = (const char*) req->user_ctx;
     const char* resp_str = (const char*) req->user_ctx;
     httpd_resp_send(req, resp_str, strlen(resp_str));       
     httpd_resp_send(req, resp_str, strlen(resp_str));       
+
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_lightOff - Done");
+
     return ESP_OK;
     return ESP_OK;
 };
 };
 
 
 esp_err_t handler_capture(httpd_req_t *req)
 esp_err_t handler_capture(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture - Start");
+
     LogFile.WriteToFile("handler_capture");
     LogFile.WriteToFile("handler_capture");
     int quality;
     int quality;
     framesize_t res;
     framesize_t res;
@@ -59,12 +71,17 @@ esp_err_t handler_capture(httpd_req_t *req)
 
 
     esp_err_t ressult;
     esp_err_t ressult;
     ressult = Camera.CaptureToHTTP(req);
     ressult = Camera.CaptureToHTTP(req);
+
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture - Done");
+
     return ressult;
     return ressult;
 };
 };
 
 
 
 
 esp_err_t handler_capture_with_ligth(httpd_req_t *req)
 esp_err_t handler_capture_with_ligth(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture_with_ligth - Start");
+
     LogFile.WriteToFile("handler_capture_with_ligth");
     LogFile.WriteToFile("handler_capture_with_ligth");
     char _query[100];
     char _query[100];
     char _delay[10];
     char _delay[10];
@@ -98,6 +115,8 @@ esp_err_t handler_capture_with_ligth(httpd_req_t *req)
     ressult = Camera.CaptureToHTTP(req);  
     ressult = Camera.CaptureToHTTP(req);  
 
 
     Camera.LightOnOff(false);
     Camera.LightOnOff(false);
+
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture_with_ligth - Done");
    
    
     return ressult;
     return ressult;
 };
 };
@@ -106,6 +125,8 @@ esp_err_t handler_capture_with_ligth(httpd_req_t *req)
 
 
 esp_err_t handler_capture_save_to_file(httpd_req_t *req)
 esp_err_t handler_capture_save_to_file(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture_save_to_file - Start");
+
     LogFile.WriteToFile("handler_capture_save_to_file");
     LogFile.WriteToFile("handler_capture_save_to_file");
     char _query[100];
     char _query[100];
     char _delay[10];
     char _delay[10];
@@ -151,6 +172,8 @@ esp_err_t handler_capture_save_to_file(httpd_req_t *req)
     const char* resp_str = (const char*) fn.c_str();
     const char* resp_str = (const char*) fn.c_str();
     httpd_resp_send(req, resp_str, strlen(resp_str));  
     httpd_resp_send(req, resp_str, strlen(resp_str));  
   
   
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_capture_save_to_file - Done");
+
     return ressult;
     return ressult;
 };
 };
 
 

+ 3 - 0
code/components/jomjol_controlcamera/server_camera.h

@@ -13,4 +13,7 @@ void register_server_camera_uri(httpd_handle_t server);
 
 
 void PowerResetCamera();
 void PowerResetCamera();
 
 
+
+extern bool debug_detail_heap;
+
 #endif
 #endif

+ 8 - 1
code/components/jomjol_fileserver_ota/server_ota.cpp

@@ -303,6 +303,8 @@ void CheckOTAUpdate(void)
 
 
 esp_err_t handler_ota_update(httpd_req_t *req)
 esp_err_t handler_ota_update(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_ota_update - Start");    
+
     LogFile.WriteToFile("handler_ota_update");    
     LogFile.WriteToFile("handler_ota_update");    
     char _query[200];
     char _query[200];
     char _filename[30];
     char _filename[30];
@@ -378,7 +380,9 @@ esp_err_t handler_ota_update(httpd_req_t *req)
     }
     }
 
 
     httpd_resp_send(req, resp_str, strlen(resp_str));  
     httpd_resp_send(req, resp_str, strlen(resp_str));  
-    
+
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_ota_update - Done");    
+
     return ESP_OK;
     return ESP_OK;
 };
 };
 
 
@@ -414,6 +418,8 @@ void doReboot(){
 
 
 esp_err_t handler_reboot(httpd_req_t *req)
 esp_err_t handler_reboot(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_reboot - Start");    
+
     LogFile.WriteToFile("handler_reboot");
     LogFile.WriteToFile("handler_reboot");
     ESP_LOGI(TAGPARTOTA, "!!! System will restart within 5 sec!!!");
     ESP_LOGI(TAGPARTOTA, "!!! System will restart within 5 sec!!!");
     const char* resp_str = "!!! System will restart within 5 sec!!!";
     const char* resp_str = "!!! System will restart within 5 sec!!!";
@@ -421,6 +427,7 @@ esp_err_t handler_reboot(httpd_req_t *req)
     
     
     doReboot();
     doReboot();
 
 
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_reboot - Done");    
     return ESP_OK;
     return ESP_OK;
 }
 }
 
 

+ 3 - 1
code/components/jomjol_fileserver_ota/server_ota.h

@@ -8,4 +8,6 @@ static const char *TAGPARTOTA = "server_ota";
 
 
 void register_server_ota_sdcard_uri(httpd_handle_t server);
 void register_server_ota_sdcard_uri(httpd_handle_t server);
 void CheckOTAUpdate();
 void CheckOTAUpdate();
-void doReboot();
+void doReboot();
+
+extern bool debug_detail_heap;

+ 4 - 20
code/components/jomjol_flowcontroll/ClassFlowControll.cpp

@@ -13,8 +13,6 @@
 
 
 static const char* TAG = "flow_controll";
 static const char* TAG = "flow_controll";
 
 
-bool flowcontrolldebugdetail = true;
-
 
 
 std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _host){
 std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _host){
     std::string _classname = "";
     std::string _classname = "";
@@ -202,17 +200,7 @@ bool ClassFlowControll::doFlow(string time)
 
 
 
 
 /////////////////////////////////////////////////////
 /////////////////////////////////////////////////////
-    if (flowcontrolldebugdetail){
-        std::string aStartEspInfoStr = "ClassFlowAnalog::doFlow - Start: " + getESPHeapInfo();
-        LogFile.WriteToFile(aStartEspInfoStr);
-    }    
-
-    if (flowcontrolldebugdetail){
-        std::string aStartEspInfoStr = "ClassFlowAnalog::doFlow - Now : " + getESPHeapInfo();
-        LogFile.WriteToFile(aStartEspInfoStr);
-
-    }
-
+    if (debug_detail_heap) LogFile.WriteHeapInfo("ClassFlowAnalog::doFlow - Start");
 /////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////
 
 
     for (int i = 0; i < FlowControll.size(); ++i)
     for (int i = 0; i < FlowControll.size(); ++i)
@@ -220,7 +208,8 @@ bool ClassFlowControll::doFlow(string time)
         zw_time = gettimestring("%Y%m%d-%H%M%S");
         zw_time = gettimestring("%Y%m%d-%H%M%S");
         aktstatus = zw_time + ": " + FlowControll[i]->name();
         aktstatus = zw_time + ": " + FlowControll[i]->name();
         string zw = "FlowControll.doFlow - " + FlowControll[i]->name();
         string zw = "FlowControll.doFlow - " + FlowControll[i]->name();
-        LogFile.WriteToFile(zw);
+        if (debug_detail_heap) LogFile.WriteHeapInfo(zw);
+//        LogFile.WriteToFile(zw);
         if (!FlowControll[i]->doFlow(time)){
         if (!FlowControll[i]->doFlow(time)){
             repeat++;
             repeat++;
             LogFile.WriteToFile("Fehler im vorheriger Schritt - wird zum " + to_string(repeat) + ". Mal wiederholt");
             LogFile.WriteToFile("Fehler im vorheriger Schritt - wird zum " + to_string(repeat) + ". Mal wiederholt");
@@ -237,12 +226,7 @@ bool ClassFlowControll::doFlow(string time)
             result = true;
             result = true;
         }
         }
 
 
-        if (flowcontrolldebugdetail){
-            std::string aStartEspInfoStr = "ClassFlowAnalog::doFlow - Now : " + getESPHeapInfo();
-            LogFile.WriteToFile(aStartEspInfoStr);
-
-        }
-
+        if (debug_detail_heap) LogFile.WriteHeapInfo("ClassFlowAnalog::doFlow");
     }
     }
     zw_time = gettimestring("%Y%m%d-%H%M%S");    
     zw_time = gettimestring("%Y%m%d-%H%M%S");    
     aktstatus = zw_time + ": Flow is done";
     aktstatus = zw_time + ": Flow is done";

+ 2 - 0
code/components/jomjol_flowcontroll/ClassFlowControll.h

@@ -56,3 +56,5 @@ public:
 	string name(){return "ClassFlowControll";};
 	string name(){return "ClassFlowControll";};
 };
 };
 
 
+extern bool debug_detail_heap;
+

+ 42 - 0
code/components/jomjol_logfile/ClassLogFile.cpp

@@ -10,6 +10,48 @@ static const char *TAG = "log";
 
 
 ClassLogFile LogFile("/sdcard/log/message", "log_%Y-%m-%d.txt");
 ClassLogFile LogFile("/sdcard/log/message", "log_%Y-%m-%d.txt");
 
 
+void ClassLogFile::WriteHeapInfo(std::string _id)
+{
+    std::string _zw;
+    _zw = "\t" + _id + "\t" + getESPHeapInfo();
+    WriteToFile(_zw);
+}
+
+
+std::string ClassLogFile::getESPHeapInfo(){
+	string espInfoResultStr = "";
+	char aMsgBuf[80];
+    
+	multi_heap_info_t aMultiHead_info ;
+	heap_caps_get_info (&aMultiHead_info,MALLOC_CAP_8BIT);
+	size_t aFreeHeapSize  = heap_caps_get_free_size(MALLOC_CAP_8BIT);
+	size_t aMinFreeHeadSize =  heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT);
+	size_t aMinFreeHeapSize =  heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT);
+	size_t aHeapLargestFreeBlockSize = heap_caps_get_largest_free_block(MALLOC_CAP_8BIT);
+	sprintf(aMsgBuf,"Free Heap Size: \t%ld", (long) aFreeHeapSize);
+	size_t aFreeSPIHeapSize  = heap_caps_get_free_size(MALLOC_CAP_8BIT| MALLOC_CAP_SPIRAM);
+ 	size_t aFreeInternalHeapSize  = heap_caps_get_free_size(MALLOC_CAP_8BIT| MALLOC_CAP_INTERNAL);
+	size_t aMinFreeInternalHeapSize =  heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT| MALLOC_CAP_INTERNAL);
+
+	sprintf(aMsgBuf,"\tHeap:\t%ld", (long) aFreeHeapSize);
+	espInfoResultStr += string(aMsgBuf);
+	sprintf(aMsgBuf,"\tMin Free:\t%ld", (long) aMinFreeHeapSize);
+	espInfoResultStr += string(aMsgBuf);
+	sprintf(aMsgBuf,"\tlarg. Block: \t%ld", (long) aHeapLargestFreeBlockSize);
+	espInfoResultStr += string(aMsgBuf);
+	sprintf(aMsgBuf,"\tSPI Heap:\t%ld", (long) aFreeSPIHeapSize);
+	espInfoResultStr += string(aMsgBuf);
+	sprintf(aMsgBuf,"\tMin Free Heap Size:\t%ld", (long) aMinFreeHeadSize);
+	sprintf(aMsgBuf,"\tNOT_SPI Heap:\t%ld", (long) (aFreeHeapSize - aFreeSPIHeapSize));
+	espInfoResultStr += string(aMsgBuf);
+	sprintf(aMsgBuf,"\tlargest Block Size: \t%ld", (long) aHeapLargestFreeBlockSize);
+	sprintf(aMsgBuf,"\tInternal Heap:\t%ld", (long) (aFreeInternalHeapSize));
+	espInfoResultStr += string(aMsgBuf);
+	sprintf(aMsgBuf,"\tInternal Min Heap free:\t%ld", (long) (aMinFreeInternalHeapSize));
+	espInfoResultStr += string(aMsgBuf);
+	return 	espInfoResultStr;
+}
+
 void ClassLogFile::WriteToDedicatedFile(std::string _fn, std::string info, bool _time)
 void ClassLogFile::WriteToDedicatedFile(std::string _fn, std::string info, bool _time)
 {
 {
     FILE* pFile;
     FILE* pFile;

+ 4 - 0
code/components/jomjol_logfile/ClassLogFile.h

@@ -12,6 +12,10 @@ private:
 public:
 public:
     ClassLogFile(std::string _logpath, std::string _logfile);
     ClassLogFile(std::string _logpath, std::string _logfile);
 
 
+    std::string getESPHeapInfo();
+
+    void WriteHeapInfo(std::string _id);
+
     void SwitchOnOff(bool _doLogFile);
     void SwitchOnOff(bool _doLogFile);
     void SetRetention(unsigned short _retentionInDays);
     void SetRetention(unsigned short _retentionInDays);
 
 

+ 34 - 3
code/components/jomjol_tfliteclass/server_tflite.cpp

@@ -24,11 +24,22 @@ TaskHandle_t xHandleblink_task_doFlow = NULL;
 TaskHandle_t xHandletask_autodoFlow = NULL;
 TaskHandle_t xHandletask_autodoFlow = NULL;
 
 
 
 
+
+
 bool flowisrunning = false;
 bool flowisrunning = false;
 
 
 long auto_intervall = 0;
 long auto_intervall = 0;
 bool auto_isrunning = false;
 bool auto_isrunning = false;
 
 
+
+int countRounds = 0;
+
+int getCountFlowRounds() {
+    return countRounds;
+}
+
+
+
 esp_err_t GetJPG(std::string _filename, httpd_req_t *req)
 esp_err_t GetJPG(std::string _filename, httpd_req_t *req)
 {
 {
     return tfliteflow.GetJPGStream(_filename, req);
     return tfliteflow.GetJPGStream(_filename, req);
@@ -101,6 +112,8 @@ void blink_task_doFlow(void *pvParameter)
 
 
 esp_err_t handler_init(httpd_req_t *req)
 esp_err_t handler_init(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_init - Start");       
+
     LogFile.WriteToFile("handler_init"); 
     LogFile.WriteToFile("handler_init"); 
     printf("handler_doinit uri:\n"); printf(req->uri); printf("\n");
     printf("handler_doinit uri:\n"); printf(req->uri); printf("\n");
 
 
@@ -114,11 +127,15 @@ esp_err_t handler_init(httpd_req_t *req)
     /* Respond with an empty chunk to signal HTTP response completion */
     /* Respond with an empty chunk to signal HTTP response completion */
     httpd_resp_send_chunk(req, NULL, 0);    
     httpd_resp_send_chunk(req, NULL, 0);    
 
 
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_init - Done");       
+
     return ESP_OK;
     return ESP_OK;
 };
 };
 
 
 esp_err_t handler_doflow(httpd_req_t *req)
 esp_err_t handler_doflow(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_doflow - Start");       
+
     LogFile.WriteToFile("handler_doflow");   
     LogFile.WriteToFile("handler_doflow");   
     char* resp_str;
     char* resp_str;
 
 
@@ -137,7 +154,9 @@ esp_err_t handler_doflow(httpd_req_t *req)
     resp_str = "doFlow gestartet - dauert ca. 60 Sekunden";
     resp_str = "doFlow gestartet - dauert ca. 60 Sekunden";
     httpd_resp_send(req, resp_str, strlen(resp_str));  
     httpd_resp_send(req, resp_str, strlen(resp_str));  
     /* Respond with an empty chunk to signal HTTP response completion */
     /* Respond with an empty chunk to signal HTTP response completion */
-    httpd_resp_send_chunk(req, NULL, 0);        
+    httpd_resp_send_chunk(req, NULL, 0);       
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_doflow - Done");       
+
     return ESP_OK;
     return ESP_OK;
 };
 };
 
 
@@ -146,6 +165,8 @@ esp_err_t handler_doflow(httpd_req_t *req)
 
 
 esp_err_t handler_wasserzaehler(httpd_req_t *req)
 esp_err_t handler_wasserzaehler(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_wasserzaehler - Start");    
+
     LogFile.WriteToFile("handler_wasserzaehler");    
     LogFile.WriteToFile("handler_wasserzaehler");    
     bool _rawValue = false;
     bool _rawValue = false;
     bool _noerror = false;
     bool _noerror = false;
@@ -215,7 +236,7 @@ esp_err_t handler_wasserzaehler(httpd_req_t *req)
             httpd_resp_sendstr_chunk(req, txt.c_str()); 
             httpd_resp_sendstr_chunk(req, txt.c_str()); 
             delete htmlinfo[i];
             delete htmlinfo[i];
         }
         }
-        htmlinfo.clear();         
+        htmlinfo.clear();   
 
 
     }   
     }   
 
 
@@ -227,12 +248,15 @@ esp_err_t handler_wasserzaehler(httpd_req_t *req)
     /* Respond with an empty chunk to signal HTTP response completion */
     /* Respond with an empty chunk to signal HTTP response completion */
     httpd_resp_sendstr_chunk(req, NULL);   
     httpd_resp_sendstr_chunk(req, NULL);   
 
 
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_wasserzaehler - Done");   
+
     return ESP_OK;
     return ESP_OK;
 };
 };
 
 
 
 
 esp_err_t handler_editflow(httpd_req_t *req)
 esp_err_t handler_editflow(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_editflow - Start");       
     LogFile.WriteToFile("handler_editflow");    
     LogFile.WriteToFile("handler_editflow");    
 
 
     printf("handler_editflow uri: "); printf(req->uri); printf("\n");
     printf("handler_editflow uri: "); printf(req->uri); printf("\n");
@@ -334,6 +358,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
 
 
         zw = "CutImage Done";
         zw = "CutImage Done";
         httpd_resp_sendstr_chunk(req, zw.c_str()); 
         httpd_resp_sendstr_chunk(req, zw.c_str()); 
+        
     }
     }
 
 
     if (_task.compare("test_take") == 0)
     if (_task.compare("test_take") == 0)
@@ -388,6 +413,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
 
 
     /* Respond with an empty chunk to signal HTTP response completion */
     /* Respond with an empty chunk to signal HTTP response completion */
     httpd_resp_sendstr_chunk(req, NULL);   
     httpd_resp_sendstr_chunk(req, NULL);   
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_editflow - Done");       
 
 
     return ESP_OK;
     return ESP_OK;
 };
 };
@@ -395,6 +421,8 @@ esp_err_t handler_editflow(httpd_req_t *req)
 
 
 esp_err_t handler_prevalue(httpd_req_t *req)
 esp_err_t handler_prevalue(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_prevalue - Start");       
+
     LogFile.WriteToFile("handler_prevalue"); 
     LogFile.WriteToFile("handler_prevalue"); 
     const char* resp_str;
     const char* resp_str;
     string zw;
     string zw;
@@ -424,6 +452,8 @@ esp_err_t handler_prevalue(httpd_req_t *req)
     /* Respond with an empty chunk to signal HTTP response completion */
     /* Respond with an empty chunk to signal HTTP response completion */
     httpd_resp_send_chunk(req, NULL, 0);      
     httpd_resp_send_chunk(req, NULL, 0);      
 
 
+    if (debug_detail_heap) LogFile.WriteHeapInfo("handler_prevalue - Start");       
+
     return ESP_OK;
     return ESP_OK;
 };
 };
 
 
@@ -444,7 +474,8 @@ void task_autodoFlow(void *pvParameter)
 
 
     while (auto_isrunning)
     while (auto_isrunning)
     {
     {
-        LogFile.WriteToFile("task_autodoFlow - next round"); 
+        std::string _zw = "task_autodoFlow - next round - Round #" + std::to_string(++countRounds);
+        LogFile.WriteToFile(_zw); 
         printf("Autoflow: start\n");
         printf("Autoflow: start\n");
         fr_start = esp_timer_get_time();
         fr_start = esp_timer_get_time();
 
 

+ 3 - 1
code/components/jomjol_tfliteclass/server_tflite.h

@@ -17,4 +17,6 @@ bool isSetupModusActive();
 
 
 esp_err_t GetJPG(std::string _filename, httpd_req_t *req);
 esp_err_t GetJPG(std::string _filename, httpd_req_t *req);
 
 
-esp_err_t GetRawJPG(httpd_req_t *req);
+esp_err_t GetRawJPG(httpd_req_t *req);
+
+extern bool debug_detail_heap;

+ 1 - 1
code/components/jomjol_time_sntp/time_sntp.cpp

@@ -111,7 +111,7 @@ static void initialize_sntp(void)
 {
 {
     ESP_LOGI(TAG, "Initializing SNTP");
     ESP_LOGI(TAG, "Initializing SNTP");
     sntp_setoperatingmode(SNTP_OPMODE_POLL);
     sntp_setoperatingmode(SNTP_OPMODE_POLL);
-    sntp_setservername(0, "xx_pool.ntp.org");
+    sntp_setservername(0, "pool.ntp.org");
 //    sntp_set_time_sync_notification_cb(time_sync_notification_cb);
 //    sntp_set_time_sync_notification_cb(time_sync_notification_cb);
     sntp_init();
     sntp_init();
 }
 }

+ 6 - 1
code/main/main.cpp

@@ -28,6 +28,9 @@
 
 
 static const char *TAGMAIN = "connect_wlan_main";
 static const char *TAGMAIN = "connect_wlan_main";
 
 
+
+bool debug_detail_heap = true;
+
 #define FLASH_GPIO GPIO_NUM_4
 #define FLASH_GPIO GPIO_NUM_4
 
 
 void Init_NVS_SDCard()
 void Init_NVS_SDCard()
@@ -121,7 +124,9 @@ extern "C" void app_main(void)
     vTaskDelay( xDelay );   
     vTaskDelay( xDelay );   
 //    LogFile.WriteToFile("Startsequence 07");  
 //    LogFile.WriteToFile("Startsequence 07");  
     setup_time();
     setup_time();
-    LogFile.WriteToFile("============================== Main Started =======================================");
+    LogFile.WriteToFile("=============================================================================================");
+    LogFile.WriteToFile("=================================== Main Started ============================================");
+    LogFile.WriteToFile("=============================================================================================");
     LogFile.SwitchOnOff(false);
     LogFile.SwitchOnOff(false);
 
 
     std::string zw = gettimestring("%Y%m%d-%H%M%S");
     std::string zw = gettimestring("%Y%m%d-%H%M%S");

+ 20 - 3
code/main/server_main.cpp

@@ -18,13 +18,14 @@
 
 
 httpd_handle_t server = NULL;   
 httpd_handle_t server = NULL;   
 
 
-
 std::string starttime = "";
 std::string starttime = "";
 
 
 
 
 /* An HTTP GET handler */
 /* An HTTP GET handler */
 esp_err_t info_get_handler(httpd_req_t *req)
 esp_err_t info_get_handler(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("info_get_handler - Start");    
+
     LogFile.WriteToFile("info_get_handler");    
     LogFile.WriteToFile("info_get_handler");    
     char _query[200];
     char _query[200];
     char _valuechar[30];    
     char _valuechar[30];    
@@ -125,21 +126,27 @@ esp_err_t info_get_handler(httpd_req_t *req)
         return ESP_OK;        
         return ESP_OK;        
     }
     }
 
 
+    if (debug_detail_heap) LogFile.WriteHeapInfo("info_get_handler - Done");    
 
 
     return ESP_OK;
     return ESP_OK;
 }
 }
 
 
 esp_err_t starttime_get_handler(httpd_req_t *req)
 esp_err_t starttime_get_handler(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("starttime_get_handler - Start");       
     httpd_resp_send(req, starttime.c_str(), strlen(starttime.c_str())); 
     httpd_resp_send(req, starttime.c_str(), strlen(starttime.c_str())); 
     /* Respond with an empty chunk to signal HTTP response completion */
     /* Respond with an empty chunk to signal HTTP response completion */
-    httpd_resp_send_chunk(req, NULL, 0);     
+    httpd_resp_send_chunk(req, NULL, 0);  
+
+    if (debug_detail_heap) LogFile.WriteHeapInfo("starttime_get_handler - Done");          
 
 
     return ESP_OK;
     return ESP_OK;
 }
 }
 
 
 esp_err_t hello_main_handler(httpd_req_t *req)
 esp_err_t hello_main_handler(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("hello_main_handler - Start");
+
     char filepath[50];
     char filepath[50];
     printf("uri: %s\n", req->uri);
     printf("uri: %s\n", req->uri);
     int _pos;
     int _pos;
@@ -189,6 +196,9 @@ esp_err_t hello_main_handler(httpd_req_t *req)
 
 
     /* Respond with an empty chunk to signal HTTP response completion */
     /* Respond with an empty chunk to signal HTTP response completion */
     httpd_resp_send_chunk(req, NULL, 0);
     httpd_resp_send_chunk(req, NULL, 0);
+
+    if (debug_detail_heap) LogFile.WriteHeapInfo("hello_main_handler - Stop");   
+
     return ESP_OK;
     return ESP_OK;
 }
 }
 
 
@@ -218,6 +228,7 @@ esp_err_t img_tmp_handler(httpd_req_t *req)
 
 
 esp_err_t img_tmp_virtual_handler(httpd_req_t *req)
 esp_err_t img_tmp_virtual_handler(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("img_tmp_virtual_handler - Start");    
     char filepath[50];
     char filepath[50];
 
 
     printf("uri: %s\n", req->uri);
     printf("uri: %s\n", req->uri);
@@ -243,6 +254,8 @@ esp_err_t img_tmp_virtual_handler(httpd_req_t *req)
         return ESP_OK;
         return ESP_OK;
 
 
     // File wird nicht intern bereit gestellt --> klassischer weg:
     // File wird nicht intern bereit gestellt --> klassischer weg:
+    if (debug_detail_heap) LogFile.WriteHeapInfo("img_tmp_virtual_handler - Done");   
+
     return img_tmp_handler(req);
     return img_tmp_handler(req);
 }
 }
 
 
@@ -252,6 +265,8 @@ esp_err_t img_tmp_virtual_handler(httpd_req_t *req)
 
 
 esp_err_t sysinfo_handler(httpd_req_t *req)
 esp_err_t sysinfo_handler(httpd_req_t *req)
 {
 {
+    if (debug_detail_heap) LogFile.WriteHeapInfo("sysinfo_handler - Start");  
+
     const char* resp_str; 
     const char* resp_str; 
     std::string zw;
     std::string zw;
     std::string cputemp = std::to_string(temperatureRead());
     std::string cputemp = std::to_string(temperatureRead());
@@ -285,7 +300,9 @@ esp_err_t sysinfo_handler(httpd_req_t *req)
     httpd_resp_set_type(req, "application/json");
     httpd_resp_set_type(req, "application/json");
     httpd_resp_send(req, resp_str, strlen(resp_str));   
     httpd_resp_send(req, resp_str, strlen(resp_str));   
     /* Respond with an empty chunk to signal HTTP response completion */
     /* Respond with an empty chunk to signal HTTP response completion */
-    httpd_resp_send_chunk(req, NULL, 0);      
+    httpd_resp_send_chunk(req, NULL, 0);  
+
+    if (debug_detail_heap) LogFile.WriteHeapInfo("sysinfo_handler - Done");          
 
 
     return ESP_OK;
     return ESP_OK;
 }
 }

+ 1 - 3
code/main/server_main.h

@@ -22,9 +22,7 @@ httpd_handle_t start_webserver(void);
 
 
 void register_server_main_uri(httpd_handle_t server, const char *base_path);
 void register_server_main_uri(httpd_handle_t server, const char *base_path);
 
 
-
-//void disconnect_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data);
-//void connect_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data);
+extern bool debug_detail_heap;
 
 
 
 
 #endif
 #endif

+ 2 - 2
code/main/version.cpp

@@ -1,4 +1,4 @@
-const char* GIT_REV="7e4f83c";
+const char* GIT_REV="584a732";
 const char* GIT_TAG="";
 const char* GIT_TAG="";
 const char* GIT_BRANCH="rolling-reduce-sd-use";
 const char* GIT_BRANCH="rolling-reduce-sd-use";
-const char* BUILD_TIME="2020-12-24 15:56";
+const char* BUILD_TIME="2020-12-26 09:05";

+ 2 - 2
code/version.cpp

@@ -1,4 +1,4 @@
-const char* GIT_REV="7e4f83c";
+const char* GIT_REV="584a732";
 const char* GIT_TAG="";
 const char* GIT_TAG="";
 const char* GIT_BRANCH="rolling-reduce-sd-use";
 const char* GIT_BRANCH="rolling-reduce-sd-use";
-const char* BUILD_TIME="2020-12-24 15:56";
+const char* BUILD_TIME="2020-12-26 09:05";

binární
firmware/bootloader.bin


binární
firmware/firmware.bin