diff --git a/README.md b/README.md index c0f8a9e..4da7dc2 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Simple [RTSP](https://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol), [HTTP JPEG Streamer](https://en.wikipedia.org/wiki/Motion_JPEG) and image server with configuration through the web interface. > [!IMPORTANT] -> New branch available! Here [branch: feature/seeed_xiao_esp32s3](https://github.com/rzeldent/esp32cam-rtsp/tree/feature/seeed_xiao_esp32s3) +> New branch available! Here [branch: develop](https://github.com/rzeldent/esp32cam-rtsp/tree/develop) > This branch supports all the current devices and the Seeed Studio Xiao esp32s3! > Please use this and let me know if this works for you! diff --git a/src/main.cpp b/src/main.cpp index b17f665..1089c3b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -390,11 +390,19 @@ void setup() #endif iotWebConf.init(); - camera_init_result = initialize_camera(); - if (camera_init_result == ESP_OK) - update_camera_settings(); - else - log_e("Failed to initialize camera: 0x%0x. Frame size: %s, frame rate: %d ms, jpeg quality: %d", camera_init_result, param_frame_size.value(), param_frame_duration.value(), param_jpg_quality.value()); + // Try to initialize 3 times + for (auto i = 0; i < 3; i++) + { + camera_init_result = initialize_camera(); + if (camera_init_result == ESP_OK) + { + update_camera_settings(); + break; + } + + log_e("Failed to initialize camera. Error: 0x%0x. Frame size: %s, frame rate: %d ms, jpeg quality: %d", camera_init_result, param_frame_size.value(), param_frame_duration.value(), param_jpg_quality.value()); + delay(500); + } // Set up required URL handlers on the web server web_server.on("/", HTTP_GET, handle_root);