mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-14 15:36:56 +03:00
Improved Logfile, extended Logging
This commit is contained in:
@@ -28,6 +28,9 @@
|
||||
|
||||
static const char *TAGMAIN = "connect_wlan_main";
|
||||
|
||||
|
||||
bool debug_detail_heap = true;
|
||||
|
||||
#define FLASH_GPIO GPIO_NUM_4
|
||||
|
||||
void Init_NVS_SDCard()
|
||||
@@ -121,7 +124,9 @@ extern "C" void app_main(void)
|
||||
vTaskDelay( xDelay );
|
||||
// LogFile.WriteToFile("Startsequence 07");
|
||||
setup_time();
|
||||
LogFile.WriteToFile("============================== Main Started =======================================");
|
||||
LogFile.WriteToFile("=============================================================================================");
|
||||
LogFile.WriteToFile("=================================== Main Started ============================================");
|
||||
LogFile.WriteToFile("=============================================================================================");
|
||||
LogFile.SwitchOnOff(false);
|
||||
|
||||
std::string zw = gettimestring("%Y%m%d-%H%M%S");
|
||||
|
||||
@@ -18,13 +18,14 @@
|
||||
|
||||
httpd_handle_t server = NULL;
|
||||
|
||||
|
||||
std::string starttime = "";
|
||||
|
||||
|
||||
/* An HTTP GET handler */
|
||||
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");
|
||||
char _query[200];
|
||||
char _valuechar[30];
|
||||
@@ -125,21 +126,27 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
if (debug_detail_heap) LogFile.WriteHeapInfo("info_get_handler - Done");
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
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()));
|
||||
/* 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;
|
||||
}
|
||||
|
||||
esp_err_t hello_main_handler(httpd_req_t *req)
|
||||
{
|
||||
if (debug_detail_heap) LogFile.WriteHeapInfo("hello_main_handler - Start");
|
||||
|
||||
char filepath[50];
|
||||
printf("uri: %s\n", req->uri);
|
||||
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 */
|
||||
httpd_resp_send_chunk(req, NULL, 0);
|
||||
|
||||
if (debug_detail_heap) LogFile.WriteHeapInfo("hello_main_handler - Stop");
|
||||
|
||||
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)
|
||||
{
|
||||
if (debug_detail_heap) LogFile.WriteHeapInfo("img_tmp_virtual_handler - Start");
|
||||
char filepath[50];
|
||||
|
||||
printf("uri: %s\n", req->uri);
|
||||
@@ -243,6 +254,8 @@ esp_err_t img_tmp_virtual_handler(httpd_req_t *req)
|
||||
return ESP_OK;
|
||||
|
||||
// File wird nicht intern bereit gestellt --> klassischer weg:
|
||||
if (debug_detail_heap) LogFile.WriteHeapInfo("img_tmp_virtual_handler - Done");
|
||||
|
||||
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)
|
||||
{
|
||||
if (debug_detail_heap) LogFile.WriteHeapInfo("sysinfo_handler - Start");
|
||||
|
||||
const char* resp_str;
|
||||
std::string zw;
|
||||
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_send(req, resp_str, strlen(resp_str));
|
||||
/* 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;
|
||||
}
|
||||
|
||||
@@ -22,9 +22,7 @@ httpd_handle_t start_webserver(void);
|
||||
|
||||
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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const char* GIT_REV="7e4f83c";
|
||||
const char* GIT_REV="584a732";
|
||||
const char* GIT_TAG="";
|
||||
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";
|
||||
Reference in New Issue
Block a user