From 4335b5d18a465183c1e7e2fa934447eadb13aaf8 Mon Sep 17 00:00:00 2001 From: remipch <75692116+remipch@users.noreply.github.com> Date: Sun, 19 Feb 2023 08:01:30 +0100 Subject: [PATCH] fix mdns init in examples mdns must be initialized after camera --- examples/cat_face_detection/web/main/app_main.cpp | 4 +++- examples/human_face_detection/web/main/app_main.cpp | 4 +++- examples/motion_detection/web/main/app_main.cpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/cat_face_detection/web/main/app_main.cpp b/examples/cat_face_detection/web/main/app_main.cpp index 41c3a28..d74ff82 100755 --- a/examples/cat_face_detection/web/main/app_main.cpp +++ b/examples/cat_face_detection/web/main/app_main.cpp @@ -10,7 +10,6 @@ static QueueHandle_t xQueueHttpFrame = NULL; extern "C" void app_main() { app_wifi_main(); - app_mdns_main(); xQueueAIFrame = xQueueCreate(2, sizeof(camera_fb_t *)); xQueueHttpFrame = xQueueCreate(2, sizeof(camera_fb_t *)); @@ -18,4 +17,7 @@ extern "C" void app_main() register_camera(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2, xQueueAIFrame); register_cat_face_detection(xQueueAIFrame, NULL, NULL, xQueueHttpFrame); register_httpd(xQueueHttpFrame, NULL, true); + + // Must be done after camera initialization because it calls 'esp_camera_sensor_get' + app_mdns_main(); } diff --git a/examples/human_face_detection/web/main/app_main.cpp b/examples/human_face_detection/web/main/app_main.cpp index e208a83..dc1eb93 100755 --- a/examples/human_face_detection/web/main/app_main.cpp +++ b/examples/human_face_detection/web/main/app_main.cpp @@ -10,7 +10,6 @@ static QueueHandle_t xQueueHttpFrame = NULL; extern "C" void app_main() { app_wifi_main(); - app_mdns_main(); xQueueAIFrame = xQueueCreate(2, sizeof(camera_fb_t *)); xQueueHttpFrame = xQueueCreate(2, sizeof(camera_fb_t *)); @@ -18,4 +17,7 @@ extern "C" void app_main() register_camera(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2, xQueueAIFrame); register_human_face_detection(xQueueAIFrame, NULL, NULL, xQueueHttpFrame); register_httpd(xQueueHttpFrame, NULL, true); + + // Must be done after camera initialization because it calls 'esp_camera_sensor_get' + app_mdns_main(); } diff --git a/examples/motion_detection/web/main/app_main.cpp b/examples/motion_detection/web/main/app_main.cpp index 42769ca..3aefca0 100755 --- a/examples/motion_detection/web/main/app_main.cpp +++ b/examples/motion_detection/web/main/app_main.cpp @@ -10,7 +10,6 @@ static QueueHandle_t xQueueHttpFrame = NULL; extern "C" void app_main() { app_wifi_main(); - app_mdns_main(); xQueueAIFrame = xQueueCreate(2, sizeof(camera_fb_t *)); xQueueHttpFrame = xQueueCreate(2, sizeof(camera_fb_t *)); @@ -18,4 +17,7 @@ extern "C" void app_main() register_camera(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2, xQueueAIFrame); register_motion_detection(xQueueAIFrame, NULL, NULL, xQueueHttpFrame); register_httpd(xQueueHttpFrame, NULL, true); + + // Must be done after camera initialization because it calls 'esp_camera_sensor_get' + app_mdns_main(); }