forked from external-repos/esp32cam-rtsp
- Default value for initResult if initialzation fails
This commit is contained in:
24
README.md
24
README.md
@@ -85,24 +85,24 @@ There are a lot of boards available that are all called ESP32-CAM.
|
|||||||
However, there are differences in CPU (type/speed/cores), how the camera is connected, presence of PSRAM or not...
|
However, there are differences in CPU (type/speed/cores), how the camera is connected, presence of PSRAM or not...
|
||||||
To select the right board use the table below and use the configuration that is listed below for your board:
|
To select the right board use the table below and use the configuration that is listed below for your board:
|
||||||
|
|
||||||
| Board | Configuration | Image | CPU | RAM | Camera | Site |
|
| Board | Configuration | Image | CPU | RAM | Camera | Site |
|
||||||
|--- |--- |--- |--- |--- |--- |--- |
|
|--- |--- |--- |--- |--- |--- |--- |
|
||||||
| Espressif ESP32-Wropver CAM | | <img src="assets/boards/esp32-wrover-cam.jpg" height="100" /> | ESP32 | 520KB SRAM 4MB PSRAM | OV2640 | |
|
| Espressif ESP32-Wropver CAM | |  | ESP32 | 520KB SRAM 4MB PSRAM | OV2640 | |
|
||||||
| AI-Thinker ESP32-CAM | ai_thinker_esp32cam | <img src="assets/boards/ai-thinker-esp32-cam-ipex.jpg" height="100" /> <img src="assets/boards/ai-thinker-esp32-cam.jpg" height="100" /> | ESP32-S / 160Mhz | 520KB SRAM 4MB PSRAM | OV2640 | https://docs.ai-thinker.com/en/esp32-cam |
|
| AI-Thinker ESP32-CAM | ai_thinker_esp32cam |   | ESP32-S | 520KB SRAM 4MB PSRAM | OV2640 | https://docs.ai-thinker.com/en/esp32-cam |
|
||||||
| Espressif ESP-EYE | | <img src="assets/boards/espressif-esp-eye.jpg" height="100" /> | ESP32 | 520KB SRAM 4MB PSRAM | OV2640 | |
|
| Espressif ESP-EYE | |  | ESP32 | 520KB SRAM 4MB PSRAM | OV2640 | |
|
||||||
| Espressif ESP-S3-EYE | | <img src="assets/boards/espressif-esps3-eye.jpg" height="100" /> | ESP32-S3 | 520KB SRAM 4MB PSRAM | OV2640 | https://www.espressif.com/en/products/devkits/esp-eye/overview |
|
| Espressif ESP-S3-EYE | |  | ESP32-S3 | 520KB SRAM 4MB PSRAM | OV2640 | https://www.espressif.com/en/products/devkits/esp-eye/overview |
|
||||||
| LilyGo camera module | | <img src="assets/boards/lilygo-camera-module.jpg" height="100" /> | ESP32 Wrover | 520KB SRAM 4MB PSRAM | OV2640 / OV5640
|
| LilyGo camera module | |  | ESP32 Wrover | 520KB SRAM 4MB PSRAM | OV2640 / OV5640 | |
|
||||||
| LilyGo Simcam | | <img src="assets/boards/lilygo-simcam.jpg" height="100" /> | | | OV2640 | |
|
| LilyGo Simcam | |  | | | OV2640 | |
|
||||||
| LilyGo TTGO-T Camera | | <img src="assets/boards/lilygo-ttgo-t-camera.jpg" height="100" /> || | OV2640 | |
|
| LilyGo TTGO-T Camera | |  | | | OV2640 | |
|
||||||
| M5 Stack Camera | | <img src="assets/boards/m5stack-esp32-camera.jpg" height="100" /> ||| OV2640 | |
|
| M5 Stack Camera | |  | | | OV2640 | |
|
||||||
| Seeed studio Xiao ESPS3 Sense | seeed_xiao_esp32s3_sense | <img src="assets/boards/seeed-studio-xiao-esp32s3-sense.jpg" height="100" /> | ESP32-S3 | 520KB SRAM 4MB PSRAM | OV2640 | |
|
| Seeed studio Xiao ESPS3 Sense | seeed_xiao_esp32s3_sense |  | ESP32-S3 | 520KB SRAM 4MB PSRAM | OV2640 | |
|
||||||
|
|
||||||
## Installing and running PlatformIO
|
## Installing and running PlatformIO
|
||||||
|
|
||||||
PlatformIO is available for all major operating systems: Windows, Linux and MacOS. It is also provided as a plugin to [Visual Studio Code](https://visualstudio.microsoft.com).
|
PlatformIO is available for all major operating systems: Windows, Linux and MacOS. It is also provided as a plugin to [Visual Studio Code](https://visualstudio.microsoft.com).
|
||||||
More information can be found at: [https://docs.platformio.org/en/latest/installation.html](https://docs.platformio.org/en/latest/installation.html) below the basics.
|
More information can be found at: [https://docs.platformio.org/en/latest/installation.html](https://docs.platformio.org/en/latest/installation.html) below the basics.
|
||||||
|
|
||||||
Install [**Visual Studio Code**](https://code.visualstudio.com) and install the PlatformIO plugin.
|
Install [Visual Studio Code](https://code.visualstudio.com) and install the PlatformIO plugin.
|
||||||
|
|
||||||
## Putting the ESP32-CAM in download mode
|
## Putting the ESP32-CAM in download mode
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,15 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
[platformio]
|
||||||
|
#default_envs = esp32cam
|
||||||
|
#default_envs = ai_thinker_esp32cam
|
||||||
|
#default_envs = esp_eye
|
||||||
|
#default_envs = ttgo-t-beam
|
||||||
|
#default_envs = m5stack_esp32cam
|
||||||
|
#default_envs = esp32_wrover_cam
|
||||||
|
default_envs = seeed_xiao_esp32s3
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
framework = arduino
|
framework = arduino
|
||||||
@@ -27,8 +36,8 @@ monitor_filters = log2file, time, default, esp32_exception_decoder
|
|||||||
|
|
||||||
build_flags =
|
build_flags =
|
||||||
-O2
|
-O2
|
||||||
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
|
-D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
|
||||||
-DIOTWEBCONF_PASSWORD_LEN=64
|
-D IOTWEBCONF_PASSWORD_LEN=64
|
||||||
|
|
||||||
board_build.embed_txtfiles =
|
board_build.embed_txtfiles =
|
||||||
html/index.min.html
|
html/index.min.html
|
||||||
|
|||||||
11
src/main.cpp
11
src/main.cpp
@@ -89,6 +89,10 @@ void handle_root()
|
|||||||
auto ipv4 = WiFi.getMode() == WIFI_MODE_AP ? WiFi.softAPIP() : WiFi.localIP();
|
auto ipv4 = WiFi.getMode() == WIFI_MODE_AP ? WiFi.softAPIP() : WiFi.localIP();
|
||||||
auto ipv6 = WiFi.getMode() == WIFI_MODE_AP ? WiFi.softAPIPv6() : WiFi.localIPv6();
|
auto ipv6 = WiFi.getMode() == WIFI_MODE_AP ? WiFi.softAPIPv6() : WiFi.localIPv6();
|
||||||
|
|
||||||
|
auto initResult = esp_err_to_name(camera_init_result);
|
||||||
|
if (initResult == nullptr)
|
||||||
|
initResult = "Unknown reason";
|
||||||
|
|
||||||
moustache_variable_t substitutions[] = {
|
moustache_variable_t substitutions[] = {
|
||||||
// Version / CPU
|
// Version / CPU
|
||||||
{"AppTitle", APP_TITLE},
|
{"AppTitle", APP_TITLE},
|
||||||
@@ -125,7 +129,7 @@ void handle_root()
|
|||||||
{"JpegQuality", String(param_jpg_quality.value())},
|
{"JpegQuality", String(param_jpg_quality.value())},
|
||||||
{"CameraInitialized", String(camera_init_result == ESP_OK)},
|
{"CameraInitialized", String(camera_init_result == ESP_OK)},
|
||||||
{"CameraInitResult", String(camera_init_result)},
|
{"CameraInitResult", String(camera_init_result)},
|
||||||
{"CameraInitResultText", esp_err_to_name(camera_init_result)},
|
{"CameraInitResultText", initResult},
|
||||||
// Settings
|
// Settings
|
||||||
{"Brightness", String(param_brightness.value())},
|
{"Brightness", String(param_brightness.value())},
|
||||||
{"Contrast", String(param_contrast.value())},
|
{"Contrast", String(param_contrast.value())},
|
||||||
@@ -299,10 +303,8 @@ void setup()
|
|||||||
pinMode(LED_BUILTIN, OUTPUT);
|
pinMode(LED_BUILTIN, OUTPUT);
|
||||||
digitalWrite(LED_BUILTIN, false);
|
digitalWrite(LED_BUILTIN, false);
|
||||||
|
|
||||||
#ifdef CORE_DEBUG_LEVEL
|
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
Serial.setDebugOutput(true);
|
Serial.setDebugOutput(true);
|
||||||
#endif
|
|
||||||
|
|
||||||
log_i("CPU Freq: %d Mhz, %d core(s)", getCpuFrequencyMhz(), ESP.getChipCores());
|
log_i("CPU Freq: %d Mhz, %d core(s)", getCpuFrequencyMhz(), ESP.getChipCores());
|
||||||
log_i("Free heap: %d bytes", ESP.getFreeHeap());
|
log_i("Free heap: %d bytes", ESP.getFreeHeap());
|
||||||
@@ -310,7 +312,6 @@ void setup()
|
|||||||
log_i("Board: %s", board_name);
|
log_i("Board: %s", board_name);
|
||||||
log_i("Starting " APP_TITLE "...");
|
log_i("Starting " APP_TITLE "...");
|
||||||
|
|
||||||
|
|
||||||
if (default_camera_config.fb_location == CAMERA_FB_IN_PSRAM)
|
if (default_camera_config.fb_location == CAMERA_FB_IN_PSRAM)
|
||||||
{
|
{
|
||||||
if (!psramInit())
|
if (!psramInit())
|
||||||
@@ -397,5 +398,5 @@ void loop()
|
|||||||
if (camera_server)
|
if (camera_server)
|
||||||
camera_server->doLoop();
|
camera_server->doLoop();
|
||||||
|
|
||||||
yield();
|
sleep(0);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user