This commit is contained in:
jomjol
2021-01-01 10:13:00 +01:00
parent 9c8f64f602
commit c59826471c
28 changed files with 263 additions and 106 deletions

View File

@@ -26,12 +26,8 @@
#include "server_main.h"
#include "server_camera.h"
#include "server_GPIO.h"
static const char *TAGMAIN = "connect_wlan_main";
bool debug_detail_heap = false;
#define FLASH_GPIO GPIO_NUM_4
void Init_NVS_SDCard()
@@ -144,7 +140,6 @@ extern "C" void app_main(void)
register_server_tflite_uri(server);
register_server_file_uri(server, "/sdcard");
register_server_ota_sdcard_uri(server);
register_server_GPIO_uri(server);
register_server_main_uri(server, "/sdcard");
TFliteDoAutoStart();

View File

@@ -15,6 +15,9 @@
#include "server_tflite.h"
//#define DEBUG_DETAIL_ON
httpd_handle_t server = NULL;
@@ -24,7 +27,9 @@ 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");
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("info_get_handler - Start");
#endif
LogFile.WriteToFile("info_get_handler");
char _query[200];
@@ -126,26 +131,35 @@ esp_err_t info_get_handler(httpd_req_t *req)
return ESP_OK;
}
if (debug_detail_heap) LogFile.WriteHeapInfo("info_get_handler - Done");
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("info_get_handler - Done");
#endif
return ESP_OK;
}
esp_err_t starttime_get_handler(httpd_req_t *req)
{
if (debug_detail_heap) LogFile.WriteHeapInfo("starttime_get_handler - Start");
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("starttime_get_handler - Start");
#endif
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);
if (debug_detail_heap) LogFile.WriteHeapInfo("starttime_get_handler - Done");
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("starttime_get_handler - Done");
#endif
return ESP_OK;
}
esp_err_t hello_main_handler(httpd_req_t *req)
{
if (debug_detail_heap) LogFile.WriteHeapInfo("hello_main_handler - Start");
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("hello_main_handler - Start");
#endif
char filepath[50];
printf("uri: %s\n", req->uri);
@@ -197,7 +211,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");
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("hello_main_handler - Stop");
#endif
return ESP_OK;
}
@@ -228,7 +244,10 @@ 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");
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("img_tmp_virtual_handler - Start");
#endif
char filepath[50];
printf("uri: %s\n", req->uri);
@@ -254,7 +273,9 @@ 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");
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("img_tmp_virtual_handler - Done");
#endif
return img_tmp_handler(req);
}
@@ -265,7 +286,9 @@ 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");
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("sysinfo_handler - Start");
#endif
const char* resp_str;
std::string zw;
@@ -302,7 +325,9 @@ esp_err_t sysinfo_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("sysinfo_handler - Done");
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("sysinfo_handler - Done");
#endif
return ESP_OK;
}

View File

@@ -22,7 +22,4 @@ httpd_handle_t start_webserver(void);
void register_server_main_uri(httpd_handle_t server, const char *base_path);
extern bool debug_detail_heap;
#endif

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="ae11698";
const char* GIT_REV="9c8f64f";
const char* GIT_TAG="";
const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2020-12-31 11:13";
const char* GIT_BRANCH="rolling-update-cimage";
const char* BUILD_TIME="2021-01-01 09:32";