ESP32-CAM Troubleshooting Guide: Most Common Problems Fixed

After releasing some projects with the ESP32-CAM, some readers reported issues when trying to use the ESP32-CAM. This guide is a compilation with the most common errors when using the ESP32-CAM and how to fix them.

ESP32-CAM Troubleshooting Guide: Most Common Problems Fixed

We’ve released the following projects with the ESP32-CAM:

Note: some of our readers reported errors when trying to follow the ESP32-CAM project with Home Assistant. We’ve modified some lines on the code, so most of the problems related with that project should be fixed.

Please note that we couldn’t reproduce some of the errors on our end. However, we’ve gathered all the information given by our readers to get answers to the most common issues.

If you have a different problem or a different solution to these issues, you can share your tips by writing a comment below.

Most common errors:

  1. Failed to connect to ESP32: Timed out waiting for packet header
  2. Camera init failed with error 0x20001 or similar
  3. Brownout detector or Guru meditation error
  4. Sketch too big error – Wrong partition scheme selected
  5. Board at COMX is not available – COM Port Not Selected
  6. Psram error: GPIO isr service is not installed
  7. Weak Wi-Fi Signal
  8. No IP Address in Arduino IDE Serial Monitor
  9. Can’t open web server
  10. The image lags/shows lots of latency
  11. esp_camera_fb_get(): Failed to get the frame on time!

1. Failed to connect to ESP32: Timed out waiting for packet header

ESP32-CAM Failed to connect to ESP32: Timed out waiting for packet header

This error means that the ESP32-CAM is not in flashing mode or it is not connected properly to the FTDI programmer.

Double-check the steps to upload code

Double-check that you’ve followed the exact steps to put your ESP32-CAM in flashing mode. Failing to complete one of the steps may result in that error. Here’s the steps you need to follow:

Connect the ESP32-CAM board to your computer using an FTDI programmer. Follow the next schematic diagram:

Important: GPIO 0 needs to be connected to GND so that you’re able to upload code.

Many FTDI programmers have a jumper that allows you to select 3.3V or 5V. Make sure the jumper is in the right place to select 5V.

Important: GPIO 0 needs to be connected to GND so that you’re able to upload code.

ESP32-CAMFTDI Programmer
GNDGND
5VVCC (5V)
U0RTX
U0TRX
GPIO 0GND

To upload the code, follow the next steps:

1) Go to Tools Board and select AI-Thinker ESP32-CAM.

2) Go to Tools Port and select the COM port the ESP32 is connected to.

3) Then, click the upload button to upload the code.

4) When you start to see these dots on the debugging window as shown below, press the ESP32-CAM on-board RST button.

After a few seconds, the code should be successfully uploaded to your board.

GPIO 0 must be connected to GND

Important: if you can’t upload the code, double-check that GPIO 0 is connected to GND and that you selected the right settings in the Tools menu. You should also press the on-board Reset button to restart your ESP32 in flashing mode. Also, check that you have the FTDI programmer jumper cap set to 5V.

Check the FTDI programmer you are using

One of our readers reported the following: “found out that you can program the board with a USB-to-TTL module model CP2102 and that the CH340 model does NOT work“. This is the FTDI programmer we’re using.

Power the ESP32-CAM with 5V

Some of our readers reported that they could only upload code when the ESP32 was powered with 5V. So, power the ESP32-CAM with 5V.

FTDI Programmer 5V

Measure the output voltage of your FTDI programmer (VCC and GND) using a Multimeter to ensure it’s providing 5V to your ESP32-CAM.

FTDI Programmer output 5V multimeter

2. Camera init failed with error 0x20001 or similar

ESP32-CAM Camera init failed with error 0x20001 or similar

If you get this exact error, it means that your camera OVX is not connected properly to your ESP32 board or you have the wrong pin assignment in the code.

Sometimes, unplugging and plugging the FTDI programmer multiple times or restart the board multiple times, might solve the issue.

Camera not connected properly

The camera has a tiny connector and you must ensure it’s connected in the the right away and with a secure fit, otherwise it will fail to establish a connection.

Wrong pin assignment in the code

When you get this error, it might also mean that you didn’t select the right board in the define section or the pin definition is wrong for your board.

Make sure you select the right camera module in your projects. You just need to uncomment the right camera module and comment all the others:

//#define CAMERA_MODEL_WROVER_KIT
//#define CAMERA_MODEL_M5STACK_PSRAM
#define CAMERA_MODEL_AI_THINKER

In this example, we’re using the CAMERA_MODEL_AI_THINKER, so it’s the one that is enabled. Otherwise, it will fail the pin assignment and the camera will fail to init.

There are many esp32-cam boards being released (“fake boards”) that the wiring between the ESP32 and the OV camera might be different, so selecting the camera module, might not be enough. You might need to check each gpio declaration with your board pinout.

For example, M5Stack board without PSRAM has a different pin assignment than the M5STACK with PSRAM (defined on the code by default). So, you need to change the pin definition in the code accordingly to the board pinout.

Not enough power through USB source

If you’re powering your ESP32 through a USB port on your computer, it might not be supplying enough power.

Faulty FTDI programmer

Some readers also reported this problem was solved by replacing their actual FTDI programmer with this one.

The camera/connector is broken

If you get this error, it might also mean that your camera or the camera ribbon is broken. If that is the case, you may get a new OV2640 camera probe.

3. Brownout detector or Guru meditation error

When you open your Arduino IDE Serial monitor and the error message “Brownout detector was triggered” is constantly being printed over and over again. It means that there’s some sort of hardware problem.

It’s often related to one of the following issues:

  • Poor quality USB cable;
  • USB cable is too long;
  • Board with some defect (bad solder joints);
  • Bad computer USB port;
  • Or not enough power provided by the computer USB port.

Solution: 

  • try a different shorter USB cable (with data wires)
  • use a different computer USB port or use a USB hub with an external power supply
  • some readers reported that when powering the ESP32-CAM with 5V, the issue was fixed.

Also, follow the suggestions described in issue 2.

4. Sketch too big error – Wrong partition scheme selected

ESP32-CAM Sketch too big error Wrong partition scheme selected

When you get the following error:

Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
Error compiling for board ESP32 Dev Module.

It means that you haven’t selected the right partition scheme. Make sure you select the right partition scheme. In your Arduino IDE, go to Tools > Partition Scheme, select “Huge APP (3MB No OTA)“.

5. Board at COMX is not available – COM Port Not Selected

ESP32-CAM COM Port Not Selected

If you get the following error or similar:

serial.serialutil.SerialException: could not open port 'COM8': WindowsError(2, 'The system cannot find the file specified.')
Failed to execute script esptool
the selected serial port Failed to execute script esptool
 does not exist or your board is not connected
Board at COM8 is not available

It means that you haven’t selected the COM port in the Tools menu. In your Arduino IDE, go to Tools > Port and select the COM port the ESP32 is connected to.

It might also mean that the ESP32-CAM is not establishing a serial connection with your computer or it is not properly connected to the USB connector.

6. Psram error: GPIO isr service is not installed

ESP32-CAM Psram error GPIO isr service is not installed

You are using a board without PSRAM and you get the following error or similar:

E (161) gpio: gpio_isr_handler_remove(380): GPIO isr service is not installed, call gpio_install_isr_service() first
Camera init failed with error 0x101

when the board was initialized with the following settings:

config.frame_size = FRAMESIZE_UXGA;
config.jpeg_quality = 10;
config.fb_count = 2;

Adding the following fixes the issues (it lowers the image resolution so it won’t need so much space to store images. However, as a result, you cannot get some high resolution formats due to the limited memory):

if(psramFound()){
  config.frame_size = FRAMESIZE_UXGA;
  config.jpeg_quality = 10;
  config.fb_count = 2;
} else {
  config.frame_size = FRAMESIZE_SVGA;
  config.jpeg_quality = 12;
  config.fb_count = 1;
}

Note: face recognition and detection doesn’t work with boards without PSRAM. However, you can still use all the other functionalities of the board. For example, although you can’t use the face recognition and detection features of this project (ESP32-CAM Video Streaming and Face Recognition with Arduino IDE), you can still play with the example and explore the board features as long as you have the right pin assignment in the code.

7. Weak Wi-Fi Signal

Some readers reported that after powering the ESP32-CAM with 5V, they’ve gotten a more stable Wi-Fi signal. You can read this dedicated guide to learn how to connect an external antenna to the ESP32-CAM and extend Wi-Fi coverage.

The ESP32-CAM has the option to use either the built-in antenna or an external antenna. If your ESP32-CAM AI-Thinker has no Wi-Fi connection or poor connection, it might have the external antenna enabled. If you connect an external antenna to the connector, it should work fine.

Check if the jumper 0K resistor by the antenna connector is in the proper position for the desired antenna. There are 3 little white squares laid out like a “<” with the middle position being common.

ESP32-CAM external and built-in antenna
Photo courtesy of Helmut Schoenborn

The following photo shows a closer look at that area. You can clearly see a small 0K resistor connecting to the built-in antenna.

esp32-cam connected to built-in antenna
Photo courtesy of Helmut Schoenborn

With board turned so the the PCB antenna is up:

  • To use the PCB antenna, the resistor must be on the top position, like this: /
  • For the antenna connector, the resistor must be on the bottom position, like this: \

So, to enable the on-board antenna:

  • Unsolder the resistor that goes to the antenna, it’s in this position \
  • And solder together the two connections to enable the on-board antenna.

8. No IP Address in Arduino IDE Serial Monitor

f you just see dots printed in the serial monitor (……), it means that your ESP32-CAM is not establishing a Wi-Fi connection with your router.

Double-check your network credentials

You need to make sure that you’ve typed your exact network credentials (SSID and password) in the following variables:

const char* ssid = "REPLACE_WITH_YOUR_SSID";
const char* password = "REPLACE_WITH_YOUR_PASSWORD";

Select the right baud rate in the Arduino IDE Serial Monitor

If you don’t select the right baud rate in the Arduino IDE Serial Monitor, you won’t get your board IP address or you’ll just get garbage on the screen.

Make sure you select the right baud rate. In our examples with the ESP32-CAM, we use 115200 baud rate.

Reset the board multiple times

You might also need to press the ESP32-CAM on-board RESET button multiple times to restart your ESP and print the IP address during boot.

RX and TX swapped

Double-check the connections between your ESP32 board and the FTDI programmer. RX goes to TX and TX goes to RX. If these connections are swapped, the ESP32-CAM is not able to establish a serial communication with your computer.

Wi-Fi Range

If the router is far away from your ESP32 board, it might not be able to catch the Wi-Fi signal. Ensure that your ESP32-CAM is fairly close to your router.

9. Can’t open web server

If the ESP32-CAM is printing the IP address in your Arduino IDE Serial Monitor, but when you try to open the web server in your web browser you see a blank screen, it usually means that you are trying to access the ESP32-CAM web server with multiple web browser tabs.

At the moment, these ESP32-CAM sketches only work with one client connected at a time.

10. The image lags/shows lots of latency

Having some latency is normal for such a small and cheap camera. Some readers have suggested the following to reduce latency:

  • Power the ESP32-CAM with a standalone 5V power supply
  • Reduce the frame size with the following in your code:
    config.frame_size = FRAMESIZE_SVGA or config.frame_size = FRAMESIZE_VGA
  • Use an external antenna.

11. esp_camera_fb_get(): Failed to get the frame on time!

We’ve personally never faced this issue. However, many readers are getting this error with their ESP32-CAM boards.

One of our readers (Fibula) suggested the following to solve this issue:

“Im using the ESP32-CAM Module 2MP OV2640 Camera sensor Module Type-C USB module from Aliexpress. Although not mentioned, It doesn’t have the extra PSRAM the other M5 models do, and the camera has one changed IO pin.

See here: https://github.com/m5stack/m5stack-cam-psram/blob/master/README.md and scroll down to Interface Comparison.

The CameraWebServer Arduino example we’re probably all using doesn’t have this ESP32-CAM model defined.

You need to add it yourself in the main tab add:

#define CAMERA_MODEL_M5STACK_NO_PSRAM

And in the camera_pins.h tab add the following:

#elif defined(CAMERA_MODEL_M5STACK_NO_PSRAM)
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM 15
#define XCLK_GPIO_NUM 27
#define SIOD_GPIO_NUM 25
#define SIOC_GPIO_NUM 23
#define Y9_GPIO_NUM 19
#define Y8_GPIO_NUM 36
#define Y7_GPIO_NUM 18
#define Y6_GPIO_NUM 39
#define Y5_GPIO_NUM 5
#define Y4_GPIO_NUM 34
#define Y3_GPIO_NUM 35
#define Y2_GPIO_NUM 17
#define VSYNC_GPIO_NUM 22
#define HREF_GPIO_NUM 26
#define PCLK_GPIO_NUM 21

And you’re good to go.

Also note that the max resolution of the bare ESP32-CAM Module is XGA 1024×768, I assume also because of the lack of PSRAM. “

We hope this suggestion solves your issue. Let us know in the comments section.

Using larger microSD card sizes

According to he datasheet, the ESP32-CAM should only supports 4GB microSD cards.

However, we’ve tested with 16GB microSD card and it works well.

You might not be able to store more than 4GB, even though you have 16GB. We haven’t tested storing more than 4GB, so we’re not sure about this.

Are these projects compatible with M5Stack board?

Yes, the M5Stack ESP32 board is compatible with out projects. However, you must check your camera pinout to ensure you have the right assignment in the code.

You can check the M5Stack camera connections here.

How to set a fixed the IP Address

To set a static/fixed IP address, you can follow the next tutorial:

Setting ESP32-CAM as Access Point (AP)

You can set your ESP32-CAM as an Access Point (AP). This means you are able to connect to your ESP32-CAM directly without having to connect to your router. You can use the following code to set your video streaming web server as an Access Point:

/*********
  Rui Santos
  Complete project details at https://RandomNerdTutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/
  
  IMPORTANT!!! 
   - Select Board "AI Thinker ESP32-CAM"
   - GPIO 0 must be connected to GND to upload a sketch
   - After connecting GPIO 0 to GND, press the ESP32-CAM on-board RESET button to put your board in flashing mode
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files.

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.
*********/

#include "esp_camera.h"
#include <WiFi.h>
#include "esp_timer.h"
#include "img_converters.h"
#include "Arduino.h"
#include "fb_gfx.h"
#include "soc/soc.h" //disable brownout problems
#include "soc/rtc_cntl_reg.h"  //disable brownout problems
#include "esp_http_server.h"

// Replace with your network credentials
const char* ssid     = "ESP32-Access-Point";
const char* password = "123456789";

#define PART_BOUNDARY "123456789000000000000987654321"

// This project was tested with the AI Thinker Model, M5STACK PSRAM Model and M5STACK WITHOUT PSRAM
#define CAMERA_MODEL_AI_THINKER
//#define CAMERA_MODEL_M5STACK_PSRAM
//#define CAMERA_MODEL_M5STACK_WITHOUT_PSRAM

// Not tested with this model
//#define CAMERA_MODEL_WROVER_KIT

#if defined(CAMERA_MODEL_WROVER_KIT)
  #define PWDN_GPIO_NUM    -1
  #define RESET_GPIO_NUM   -1
  #define XCLK_GPIO_NUM    21
  #define SIOD_GPIO_NUM    26
  #define SIOC_GPIO_NUM    27
  
  #define Y9_GPIO_NUM      35
  #define Y8_GPIO_NUM      34
  #define Y7_GPIO_NUM      39
  #define Y6_GPIO_NUM      36
  #define Y5_GPIO_NUM      19
  #define Y4_GPIO_NUM      18
  #define Y3_GPIO_NUM       5
  #define Y2_GPIO_NUM       4
  #define VSYNC_GPIO_NUM   25
  #define HREF_GPIO_NUM    23
  #define PCLK_GPIO_NUM    22

#elif defined(CAMERA_MODEL_M5STACK_PSRAM)
  #define PWDN_GPIO_NUM     -1
  #define RESET_GPIO_NUM    15
  #define XCLK_GPIO_NUM     27
  #define SIOD_GPIO_NUM     25
  #define SIOC_GPIO_NUM     23
  
  #define Y9_GPIO_NUM       19
  #define Y8_GPIO_NUM       36
  #define Y7_GPIO_NUM       18
  #define Y6_GPIO_NUM       39
  #define Y5_GPIO_NUM        5
  #define Y4_GPIO_NUM       34
  #define Y3_GPIO_NUM       35
  #define Y2_GPIO_NUM       32
  #define VSYNC_GPIO_NUM    22
  #define HREF_GPIO_NUM     26
  #define PCLK_GPIO_NUM     21

#elif defined(CAMERA_MODEL_M5STACK_WITHOUT_PSRAM)
  #define PWDN_GPIO_NUM     -1
  #define RESET_GPIO_NUM    15
  #define XCLK_GPIO_NUM     27
  #define SIOD_GPIO_NUM     25
  #define SIOC_GPIO_NUM     23
  
  #define Y9_GPIO_NUM       19
  #define Y8_GPIO_NUM       36
  #define Y7_GPIO_NUM       18
  #define Y6_GPIO_NUM       39
  #define Y5_GPIO_NUM        5
  #define Y4_GPIO_NUM       34
  #define Y3_GPIO_NUM       35
  #define Y2_GPIO_NUM       17
  #define VSYNC_GPIO_NUM    22
  #define HREF_GPIO_NUM     26
  #define PCLK_GPIO_NUM     21

#elif defined(CAMERA_MODEL_AI_THINKER)
  #define PWDN_GPIO_NUM     32
  #define RESET_GPIO_NUM    -1
  #define XCLK_GPIO_NUM      0
  #define SIOD_GPIO_NUM     26
  #define SIOC_GPIO_NUM     27
  
  #define Y9_GPIO_NUM       35
  #define Y8_GPIO_NUM       34
  #define Y7_GPIO_NUM       39
  #define Y6_GPIO_NUM       36
  #define Y5_GPIO_NUM       21
  #define Y4_GPIO_NUM       19
  #define Y3_GPIO_NUM       18
  #define Y2_GPIO_NUM        5
  #define VSYNC_GPIO_NUM    25
  #define HREF_GPIO_NUM     23
  #define PCLK_GPIO_NUM     22
#else
  #error "Camera model not selected"
#endif

static const char* _STREAM_CONTENT_TYPE = "multipart/x-mixed-replace;boundary=" PART_BOUNDARY;
static const char* _STREAM_BOUNDARY = "\r\n--" PART_BOUNDARY "\r\n";
static const char* _STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\n\r\n";

httpd_handle_t stream_httpd = NULL;

static esp_err_t stream_handler(httpd_req_t *req){
  camera_fb_t * fb = NULL;
  esp_err_t res = ESP_OK;
  size_t _jpg_buf_len = 0;
  uint8_t * _jpg_buf = NULL;
  char * part_buf[64];

  res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE);
  if(res != ESP_OK){
    return res;
  }

  while(true){
    fb = esp_camera_fb_get();
    if (!fb) {
      Serial.println("Camera capture failed");
      res = ESP_FAIL;
    } else {
      if(fb->width > 400){
        if(fb->format != PIXFORMAT_JPEG){
          bool jpeg_converted = frame2jpg(fb, 80, &_jpg_buf, &_jpg_buf_len);
          esp_camera_fb_return(fb);
          fb = NULL;
          if(!jpeg_converted){
            Serial.println("JPEG compression failed");
            res = ESP_FAIL;
          }
        } else {
          _jpg_buf_len = fb->len;
          _jpg_buf = fb->buf;
        }
      }
    }
    if(res == ESP_OK){
      size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len);
      res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen);
    }
    if(res == ESP_OK){
      res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len);
    }
    if(res == ESP_OK){
      res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY));
    }
    if(fb){
      esp_camera_fb_return(fb);
      fb = NULL;
      _jpg_buf = NULL;
    } else if(_jpg_buf){
      free(_jpg_buf);
      _jpg_buf = NULL;
    }
    if(res != ESP_OK){
      break;
    }
    //Serial.printf("MJPG: %uB\n",(uint32_t)(_jpg_buf_len));
  }
  return res;
}

void startCameraServer(){
  httpd_config_t config = HTTPD_DEFAULT_CONFIG();
  config.server_port = 80;

  httpd_uri_t index_uri = {
    .uri       = "/",
    .method    = HTTP_GET,
    .handler   = stream_handler,
    .user_ctx  = NULL
  };
  
  //Serial.printf("Starting web server on port: '%d'\n", config.server_port);
  if (httpd_start(&stream_httpd, &config) == ESP_OK) {
    httpd_register_uri_handler(stream_httpd, &index_uri);
  }
}

void setup() {
  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
 
  Serial.begin(115200);
  Serial.setDebugOutput(false);
  
  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sscb_sda = SIOD_GPIO_NUM;
  config.pin_sscb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.pixel_format = PIXFORMAT_JPEG; 
  
  if(psramFound()){
    config.frame_size = FRAMESIZE_UXGA;
    config.jpeg_quality = 10;
    config.fb_count = 2;
  } else {
    config.frame_size = FRAMESIZE_SVGA;
    config.jpeg_quality = 12;
    config.fb_count = 1;
  }
  
  // Camera init
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK) {
    Serial.printf("Camera init failed with error 0x%x", err);
    return;
  }
  // Connect to Wi-Fi network with SSID and password
  Serial.print("Setting AP (Access Point)…");
  // Remove the password parameter, if you want the AP (Access Point) to be open
  WiFi.softAP(ssid, password);

  IPAddress IP = WiFi.softAPIP();
  Serial.print("Camera Stream Ready! Connect to the ESP32 AP and go to: http://");
  Serial.println(IP);
  
  // Start streaming web server
  startCameraServer();
}

void loop() {
  delay(1);
}

View raw code

To better understand how it works, you can read the next tutorial:

Learn how to program and build 17 projects with the ESP32-CAM using Arduino IDE DOWNLOAD »

Learn how to program and build 17 projects with the ESP32-CAM using Arduino IDE DOWNLOAD »

Wrapping Up

We hope you’ve found this troubleshooting guide useful and you were able to make your ESP32-CAM work with our projects.

If you have any other issues or suggestions on how to fix them, please post a comment below.

If you like this project, you may also like other projects with the ESP32-CAM:

Thank you for reading.

P.S. It is very difficult to understand what’s wrong with your project when we can’t reproduce the error on our end. However, if you post the error, there might be other readers with the same issue/solution, so we encourage you to interact in the comment’s section.


Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »

Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »


Enjoyed this project? Stay updated by subscribing our weekly newsletter!

173 thoughts on “ESP32-CAM Troubleshooting Guide: Most Common Problems Fixed”

  1. Sara. I keep getting an error while compiling with dl_lib.h.
    I am also unable to find that file on the web. Can you please enlighten me
    on how to find that file.

    Regards

    Stuart Megson

    Reply
  2. I followed the direction correctly and the code gives me an IP address. When I enter the IP address I get the web page but no image. I am using 5v power as 3.3 v would not work. I have seen other people with this problem but no answers on what causes this or how to fix it.

    Reply
    • Got mine working using an external 3.3V supply (brownout if I tried to use USB power) and using Firefox on Win10 to connect. If I try to connect from a mobile device (Android phone or old iPad) I see the webcam menu but I don’t see the image. Troubleshooting guide suggests no image with multiple web clients, but this was single client connection.

      Reply
  3. I also get an error “dl_lib.h: No such file or directory”
    Then i have downloaded the file “dl_lib.h” from :
    https://github.com/denizyuret/dlib/blob/master/dlib.h

    .. but then i got another error :

    In file included from C:\Users\Johan\Documents\_ESP_EYE\esp32_video_streaming_webserver\esp32_video_streaming_webserver.ino:26:0:

    C:\Users\Johan\AppData\Local\Temp\arduino_build_292130\sketch\dl_lib.h: In function ‘char* dstrdup(str_t)’:

    dl_lib.h:234:9: error: expected unqualified-id before ‘new’

    str_t new = dalloc (len);

    ^

    dl_lib.h:235:29: error: expected type-specifier before ‘,’ token

    return (str_t) memcpy (new, s, len);

    ^

    Meerdere bibliotheken gevonden voor “WiFi.h”
    Gebruikt: C:\Users\Johan\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.3-rc1\libraries\WiFi
    Niet gebruikt: C:\Program Files (x86)\Arduino\libraries\WiFi
    Bibliotheek WiFi op versie 1.0 in map: C:\Users\Johan\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.3-rc1\libraries\WiFi wordt gebruikt
    exit status 1
    expected unqualified-id before ‘new’

    …any ideas?

    I’m also trying with an esp-eye and add this to the code :

    #define CAMERA_MODEL_ESP_EYE
    #elif defined(CAMERA_MODEL_ESP_EYE)
    #define PWDN_GPIO_NUM -1
    #define RESET_GPIO_NUM -1
    #define XCLK_GPIO_NUM 4
    #define SIOD_GPIO_NUM 18
    #define SIOC_GPIO_NUM 23

    #define Y9_GPIO_NUM 36
    #define Y8_GPIO_NUM 37
    #define Y7_GPIO_NUM 38
    #define Y6_GPIO_NUM 39
    #define Y5_GPIO_NUM 35
    #define Y4_GPIO_NUM 14
    #define Y3_GPIO_NUM 13
    #define Y2_GPIO_NUM 34
    #define VSYNC_GPIO_NUM 5
    #define HREF_GPIO_NUM 27
    #define PCLK_GPIO_NUM 25

    Reply
  4. WEAK SIGNAL is also cause by the jumper that is solded for use the external antenna. Just change it to use the internal antenna

    Reply
      • You also need to put information on the page about setting the jumper on the FTDI board.

        The other thing I see is and especially people that pay for your projects that you do not provide the help you should.

        Reply
        • Kevin,
          I find just the opposite. Rui and Sara help extensively. I do not get why you would think that at all? You do have to take some initiative to solve your own problems, but the computer systems, browsers, board possibilities and mis-understandings abound, so I find they do a very good job of support whenever possible.
          Sorry you don’t think so.
          Dave

          Reply
  5. Hi Sara/Rui

    While trying to run the esp32 camera sketch using the FTDI device to interface the ESP32-CAM module to my PC I get the following error despite using the correct COM port using the Arduino IDE.

    esptool.py v2.6
    Serial port COM3
    Traceback (most recent call last):
    File “esptool.py”, line 2959, in
    File “esptool.py”, line 2952, in _main
    File “esptool.py”, line 2652, in main
    File “esptool.py”, line 222, in __init__
    File “site-packages\serial\__init__.py”, line 88, in serial_for_url
    File “site-packages\serial\serialwin32.py”, line 62, in open
    serial.serialutil.SerialException: could not open port ‘COM3’: WindowsError(121, ‘The semaphore timeout period has expired.’)
    Failed to execute script esptool
    the selected serial port Failed to execute script esptool
    does not exist or your board is not connected
    Error opening serial port ‘COM3’. (Port busy)

    do you have a solution to this problem as I have followed your advice on the esp32-cam-troubeshooting-guide.

    Thank you.

    Reply
  6. No matter what I do, every time I try to connect to the server, I get the following message in the browser:

    “Header fields are too long for server to interpret”

    I have tried several sketches, several fixes, several apparent workarounds, but it just keeps coming up. It compiles and uploads without a problem. But this issue is stopping any further progress.

    Any ideas would be greatly appreciated.

    J.

    Reply
  7. Thank you for publishing this informative and very helpful troubleshooting guide. Specifically for the TTGO T-Camera w/Microphone v1.6, courtesy of github.com/lewisxhe/esp32-camera-series we learned you MUST set PinMode on GPIO 13 and 14:

    pinMode(13, INPUT_PULLUP);
    pinMode(14, INPUT_PULLUP);

    to prevent crashes.

    Reply
  8. Hi,
    I get the following in monitor

    ets Jun 8 2016 00:22:57

    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff0018,len:4
    load:0x3fff001c,len:1100
    load:0x40078000,len:9232
    load:0x40080400,len:6400
    entry 0x400806a8

    But thats it. No …. for Wifi or any further info.
    I note the difference is I have entry 0x400806a8 whilst your example shows 0x400806a4. Is this significant?

    Thanks for any help.

    Reply
  9. Yes! Finally got it to work. What worked for me was first flashing at 3V3 and then running the ESP32 at 5V. However, one thing I missed, even in the troubleshooting guide (and did wrong myself) was that after switching to 5V, you will also have to connect the Vcc line (now carrying 5V) to the 5V pin on the ESP32 board in stead of the 3V3 pin that is only used for flashing. This may be obvious for experienced ESP32 users, but it isn’t for everyone 😉

    Reply
    • Hi Pierre.
      I’m happy that you finally made it work!
      Thank you for sharing your mistakes. It may be helpful for some of our readers.
      Now you can have fun experimenting our ESP32-CAM projects 😀
      Regards,
      Sara

      Reply
  10. I can connect to web page get everything but no video, l am monitoring the output of the board an it is sending packets. Tried several browsers with same result also tried several esp boards and cameras.H E L P!!!
    Frustrated

    Reply
    • Hi.
      I understand your frustration.
      However, without any additional details, it is very difficult to understand what is causing the issue…

      Reply
    • camera streams fine on my android chrome browser, however in Microsoft edge its just an x but it will capture a still. one thing I notice is when the button start stream is depressed looking in serial monitor nothing happens. its like the start stream button has no functionality . could be a flash issue or some other html issue.

      Reply
      • Hi.
        I think it’s a problem with the HTML. I think some features are not supported on Edge.
        Regards,
        Sara

        Reply
  11. Rui
    The camera I have is the one that seems to be on most of the ebay sites ie ESP32-S FCCID 2AHMR. I haven’t been able to buy an AI Thinker esp32cam.
    Sketch downloads for mine but when you go to serial monitor it says camera not supported.
    Do you know if there is any camera model you can select for the sketch that will make this work?

    Reply
  12. Sara, please help, I have the esp32 cam programed ,I can connect to it with 4 different browsers, powered it with both 3.3 and 5 volts on the respected pins, I see packets being transmitted but no video image . I see this on two different boards and cameras ,do you have any ideas?

    Reply
    • Hi.
      Are you powering the ESP32-CAM with 5V and 3.3V simultaneously? You should only use one power source.
      Were you able to see the streaming when just one web browser tab with the streaming is open? (just one client at a time)?
      Regards,
      Sara

      Reply
      • Only one voltage source at a time not both, and only one session at at time one on each browser at a time no multi sessions. Each session was monitored from the esp. I have tried several video modes from the web page configuration and restarted the session. If I could send you an image it would be worth a thousand words.

        Reply
        • Hi Frank.
          What web browser are you using?
          You can upload your photo to imgur, google drive or other, and then share the link.
          Regards,
          Sara

          Reply
  13. Dear Rui/Sara
    Forget my previous comment. Finally got it to work by
    1. Getting hold of AIThinker ESP32 -S
    2. Getting a secure camera connection (previous camera/ESP32 did not connect securely and camera kept falling out.
    3.Using a CP2102 and connecting ESP32-S to 5v
    Regards
    Neil Austen

    Reply
  14. Hi,
    thanks for the fine tutorial and this troubleshooting guide!
    I followed the steps and everything compiled, uploaded, started. The Serial monitor notifies that webserver at port 80 and stream server at port 81 have started and the Camera ready – however, I can only see the settings and get a black rectangle instead of the video. 2 or 3 other posters may have the same problem.
    The hardware was bought from and is described at:
    aliexpress.com/item/33038740493.html?spm=a2g0s.9042311.0.0.4cfd4c4d39A7TQ
    Is there anything I can contribute to research the problem?

    Reply
    • Hi Danyel.
      Thank you for sharing your problem.
      Some readers have reported same problem as you. However, if you already followed all our suggestion in our troubleshooting guide, I don’t know what else can be the problem.
      Some people reported that after powering the ESP32 with 5V, everything started working fine.
      Regards,
      Sara

      Reply
  15. Hi,
    I have programed mine with both sketches (not at the same time). After using 5v for programing all seemed to go well.
    However, regardless of which sketch (server or other) the images is full of horizontal lines. I have also noticed that the EPS32 module AND camera module get very hot after just a few minutes.
    This is regardless of 5v or 3.3volts.
    I have tried running off a battery in case the lines are generated by noise from a USB supply, but there is no difference.
    Has anyone else had this or do you have any ideas.
    Thanks.

    Reply
    • Hi Martin.
      For what you describe it seems that your camera may be defective or broken.
      Do you get any errors in the Serial Monitor regarding the camera initialization?
      Regards,
      Sara

      Reply
  16. brownout and camera init failed whatever I tried every camera model and every troubleshooting guide as above.. Then I found someone said esp32 should connect 5v rather than 3.3v. Finally it works after I connect to 5v to eps32!

    Reply
  17. ets Jun 8 2016 00:22:57

    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff0018,len:4
    load:0x3fff001c,len:1100
    load:0x40078000,len:9232
    load:0x40080400,len:6400
    entry 0x400806a8
    [D][esp32-hal-psram.c:47] psramInit(): PSRAM enabled

    Thats as far as mine gets, any ideas?

    Reply
  18. I’ve tried to connected the ESP32-CAM to Homeassiatnt without success.
    Streaming to web app (ie ,chrom,saphari) works fine.
    I’ve done clean install of homeassistant on my Ubuntu laptop.
    No other devices expect the camera. Still with no results. Working with 5V coming from the USB slot to power the camera.
    I suspect the camera code , although full success is reported at HA forums.
    Looking for an advice.

    Reply
  19. Have the same problem: dl_lib.h not found. Cant find the library. Can you tell us where to find it?

    Kind regards and greetings from Switzerland

    delf

    Reply
  20. I got my camera working perfectly but face recognition will not work. There have been some comments floating around that the problem is with version 1.0.2 of the library. Can you confirm this is the cause of the problem.
    Cheers
    Neil Austen

    Reply
    • Hi, Neil, happy new year! I have encountered the same problem as you. Now my online video stream works normally, but when I clicked the “Face recognition” and “Face Detection”, nothing happened and there is no colorful box displayed.

      Besides, my board has also PSRAM. I still don’t know how to solve it? Do you have any progress on this problem?

      Reply
  21. Team,
    I spent a lot of time trying to fix the issue #3 (Brownout… and Guru Meditation –> Amiga style) and the problem was on the Chinese USB-to-RS323 TTL module. I think those does not work well at high baud data communication, failing to transmit data to ESP32. I did change to a new module (original FTDI) and works perfectly.
    Hope it helps,
    AH

    Reply
  22. first of all congratulations for these wonderful tutorials of esp32-cam..really high quality stuff..

    after 1-2 hours with Brownout detector error..and after trying change to another cable or usb port or try usb hub nothing worked..

    a test i suggest to other users is to upload an easy sketch like:
    void setup(){ Serial.begin(115200);} void loop(){Serial.println(“i’m working”);}
    if you open serial..you MUST see the message..

    BUT when i tried some “heavy” sketch like WiFi scan example..or the CameraWebServer i had the Brownout detector error..
    The only solution i found until now is to use a good power supply with 5v. Then i disconnected 5v (or 3.3v) pin that connects ESP and FTDI and connect the 5v ESP pin to the power supply, and the ground with the ground of ESP (i left the ESP32-FTDI ground because i guess everything has to be grounded).

    After that reupload camera sketch and everything worked perfect..
    So, i guess Wifi is very hungry for power to run with a USB..

    btw..i have a question that nowhere have found good solid answer:
    on ESP32-CAM there is 5v, 3.3v and VCC pins..
    5v and 3.3v is only for INPUT to esp? can also work as OUTPUT?
    what is VCC and what if i want to power ESP with a 9V battery?

    Sorry..for the ultra long post..

    Reply
  23. First, thanks for providing so much great info about the ESP32 camera :-). To chime in regarding my experiences.

    1. using the FTDI adaptor VCC pin to provide power produces brownouts, so I use a good 5V supply to the 5V pin on the module. The Vcc pin on the module is “not” connected to external power, and shows 3.3V.

    2. I bought modules from 2 different ebay vendors, the first would not flash, no matter what, but the 2nd works fine, with both Rui’s code and the ESP32/camera example in the Arduino IDE.

    3. it always pays to try a simple program first, like toggling an I/O pin, just to see if the module will flash ok.

    Reply
  24. my problem is esp32 was working correctly i was de bugging codes one time message came esp32 wroom is not recognised,after that whole day i was trying but no luck , i re installed arduino ide esspressif, no luck no error message, it says Hash data varified , Compressed 3072 bytes to 144… , writing at 0x00008000…..(100%)
    wrote 3072 bytes(144 compressed)at 0x00008000 in 0.0 seconds(effective 910.2 kbits/s)… , Hash of data verified Leaving Hard resetting via RTS pin… but application does not start, i have 4 boards same thing ,please let me know what is wrong , THANKS

    Reply
    • Hi.
      That message means that the code was successfully uploaded to your board.
      After seeing that message, press the on-board RST button to start the program.
      Regards,
      Sara

      Reply
      • I have the same problem. After remove the jumper between IO0 and GND , I pressed the RST button, in the serial monitor it came out like this.

        !⸮t4⸮8⸮⸮⸮⸮⸮s⸮⸮KG

        Reply
        • Hi.
          Please double-check that your serial monitor is set at a baud rate of 115200 and that you have the right RX and TX connections.
          Regards,
          Sara

          Reply
    • Small adjustment to Sara’s reply.
      …..
      After seeing that message, REMOVE the jumper/link between IO0 and GND and THEN press the RST (reset) button. 🙂

      By the way, was the jumper/link connected between IO0 and GND before sketch upload?

      Regards

      Reply
  25. Hey, I have been eating my heart out in finding the solution to this error. I have also looked into other forums for this answer if anyone faced the same issue but none seem to be giving any solid way to correct this problem.

    I have also installed cp210x driver that did not work either.

    Even did the pip installation of pyserial as was given in one of the forums

    Please, I would really appreciate if you could help me in on this.

    esptool.py v2.6
    Serial port COM4
    Traceback (most recent call last):
    File “esptool.py”, line 2959, in
    File “esptool.py”, line 2952, in _main
    File “esptool.py”, line 2652, in main
    File “esptool.py”, line 222, in __init__
    File “site-packages\serial\__init__.py”, line 88, in serial_for_url
    File “site-packages\serial\serialwin32.py”, line 62, in open
    serial.serialutil.SerialException: could not open port ‘COM4’: WindowsError(2, ‘The system cannot find the file specified.’)
    Failed to execute script esptool
    the selected serial port Failed to execute script esptool
    does not exist or your board is not connected

    Reply
  26. I can not get an IP address in the monitor window. I get all other info except the ip address. I have made sure my ssid and password for my wifi is correct. Is there suppose to be any info come up in the monitor window to tell me if something is wrong?

    Any suggestions?

    Reply
  27. There are a few posts here with no answers to the issue of “dl_lib.h: No such file or directory” when compiling. Some have said just commenting it out will allow you to compile, which is true, but I’m not getting an image. Is there no answer to the issue of the missing library file? The other example tutorial for streaming works fine.

    Reply
    • Hi.
      At the moment, we still haven’t figured out what the problem is :/
      If anyone knows how to solve this, please share.
      Regards,
      Sara

      Reply
  28. For dl_lib.h: No such file or directory is because ESP32 Board Version 1.03 does’nt seem to include this anymore. Downgrade your ESP32 Board Version down to 1.02 in Andruino IDE and it should be fine. Worked for me.

    Reply
  29. for those who are facing the compilation error: dl_lib.h: No such file or directory, just comment out the #include”dl_lib.h” and it should get compiled. (ESP32 code 1.03).

    Reply
  30. Good morning
    Even if I press the button RST on the ESP32_CAM I get the message:
    “A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header”
    What can I do?

    Reply
  31. Hi, open the webserver, but I press the “start stream” button and the failure to open the image, this message appears in serial ,, …… already tried in 3 browsers, can anyone help me?

    [E][camera.c:1344] esp_camera_fb_get(): Failed to get the frame on time!
    Camera capture failed

    Reply
  32. Now it seems to write the code but then it complains that it was unable to do it, and it doesn’t write anything to the serial monitor, after disconnecting IO0 from ground and press RST:

    “Arduino: 1.8.10 (Linux), Board: “ESP32 Wrover Module, Huge APP (3MB No OTA), QIO, 80MHz, 921600, None”

    Sketch uses 405876 bytes (12%) of program storage space. Maximum is 3145728 bytes.
    Global variables use 17624 bytes (5%) of dynamic memory, leaving 310056 bytes for local variables. Maximum is 327680 bytes.
    esptool.py v2.6
    Serial port /dev/ttyUSB0
    Connecting…..
    Chip is ESP32D0WDQ6 (revision 1)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
    MAC: a4:cf:12:6d:1c:e8
    Uploading stub…
    Running stub…
    Stub running…
    Changing baud rate to 921600
    Changed.
    Configuring flash size…
    Warning: Could not auto-detect Flash size (FlashID=0x0, SizeID=0x0), defaulting to 4MB
    Compressed 8192 bytes to 47…

    Writing at 0x0000e000… (100 %)
    Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 1944.2 kbit/s)…

    A fatal error occurred: Timed out waiting for packet header
    A fatal error occurred: Timed out waiting for packet header

    Reply
  33. I get the dl_lib.h error when compiling. Comment out as suggested and it compiles. I get the menu after inputting IP and can get a still photo but will not stream.

    Reply
  34. @Rafhael, I’m having the same error.
    “[E][camera.c:1344] esp_camera_fb_get(): Failed to get the frame on time!
    Camera capture failed”
    Did you find a solution?

    Reply
  35. @Rafhael, I’m having the same error.
    [E][camera.c:1344] esp_camera_fb_get(): Failed to get the frame on time!
    Camera capture failed
    if you have solved this with you, please post solution here; thanks

    Reply
  36. I am using the latest version of Arduino IDE 1.8. 10., to address Error #4, above.

    When I go to Tools > Partition Scheme, select “Huge APP (3MB No OTA)“, there is no such Tool.

    Where is the Partition Scheme Tool?

    Reply
    • Hi Joel.
      You need to select your board first.
      Select the board first, and then check that you have that option.
      Regards,
      Sara

      Reply
  37. “Failed to connect to ESP32: Timed out waiting for packet header”. Add me to the people who failed to download the ESP32-CAM sketch when I connected the FTDI 3.3v output to 3v3 on the ESP32-CAM, using a genuine FTDI FT232RL-based USB serial adapter.

    I resolved by switching the FTDI adapter to 5v mode, and connecting from the Vcc output on FTDI to the 5v input on the ESP32.

    I note that you show the connection made this way in your PIR project blog post. https://i2.wp.com/randomnerdtutorials.com/wp-content/uploads/2019/08/ESP32-CAM-FTDI-programmer-5V-supply.png

    Reply
    • Hi Rob.
      Yes, you are right.
      We can get our ESP32-CAM working with 3.3V.
      However, after so many issues reported by ours readers, we now recommend powering with 5V on our most recent projects.
      We still need to update some of our previous ESP32-CAM projects to use 5V instead of 3.3V.
      Thanks for sharing.
      Regards,
      Sara

      Reply
  38. hey guys, maybe anyone has found the solution for this error:

    [E][camera.c:1344] esp_camera_fb_get(): Failed to get the frame on time!
    Camera capture failed

    regards, Mike

    Reply
  39. A solution to the “esp_camera_fb_get(): Failed to get the frame on time!” message….
    Im using the ESP32-CAM Module 2MP OV2640 Camera sensor Module Type-C USB module from Aliexpress. Although not mentioned It doesn’t have the extra PSRAM the other M5 models do AND the camera has one changed IO pin. See here… https://github.com/m5stack/m5stack-cam-psram/blob/master/README.md and scroll down to Interface Comparison. The CameraWebServer Arduino example we’re probably all using doesnt have this ESP32-CAM model defined. You need to add it yourself eg in the main tab add #define CAMERA_MODEL_M5STACK_NO_PSRAM , and in the camera_pins.h tab add…
    #elif defined(CAMERA_MODEL_M5STACK_NO_PSRAM)
    #define PWDN_GPIO_NUM -1
    #define RESET_GPIO_NUM 15
    #define XCLK_GPIO_NUM 27
    #define SIOD_GPIO_NUM 25
    #define SIOC_GPIO_NUM 23

    #define Y9_GPIO_NUM 19
    #define Y8_GPIO_NUM 36
    #define Y7_GPIO_NUM 18
    #define Y6_GPIO_NUM 39
    #define Y5_GPIO_NUM 5
    #define Y4_GPIO_NUM 34
    #define Y3_GPIO_NUM 35
    #define Y2_GPIO_NUM 17
    #define VSYNC_GPIO_NUM 22
    #define HREF_GPIO_NUM 26
    #define PCLK_GPIO_NUM 21

    And you’re good to go.
    Also note that the max resolution of the bare ESP32-CAM Module is XGA1024x768 i assume also because of the lack of PSRAM.

    Reply
    • Hi.
      Thanks for sharing.
      I’ll add this to our troubleshooting guide.
      I’ve never faced this issue though. However, many people are complaining about this error.
      Regards,
      Sara

      Reply
  40. Fibula, thanks for the info, although I am not using the M5STACK module. Therefore, this info does not apply and does not resolve the issue for me. I still get this error. Based on your information, the likely cause is similar and likely caused by a pin change. The search continues!

    Reply
  41. New ESP32 Arduino version (v 1.03) remove this file “dl_lib.h” (and some others). Depending the sketch, probabily you can just remove this line because this library is beeing included but no method or function from this files is used.

    Reply
  42. Hi Sara,
    I’m getting
    Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: “ESP32 Wrover Module, Huge APP (3MB No OTA/1MB SPIFFS), QIO, 80MHz, 921600, None”

    Sketch uses 2100663 bytes (66%) of program storage space. Maximum is 3145728 bytes.
    Global variables use 53544 bytes (16%) of dynamic memory, leaving 274136 bytes for local variables. Maximum is 327680 bytes.
    esptool.py v2.6
    Serial port COM8
    Connecting…….._____….._____….._____….._____….._____….._____….._____

    A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
    A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

    This report would have more information with
    “Show verbose output during compilation”
    option enabled in File -> Preferences.

    Haven’t been able to find the solution.
    I have used 2 FTDI’s, 3 different wire sets, 2 different ESP32S-CAM boards and all get the same fault…
    Please help I’m loosing my mind!

    Reply
    • Hi Adrian.
      That means that your ESP32-CAM is not in flashing mode when you try to upload code.
      Please make sure that GPIO 0 is connected to GND and that you press the RST button before clicking the upload button.
      Try powering the ESP32-CAM with 5V as well as set the FTDI programmer to 5V.
      Regards,
      Sara

      Reply
      • So after months of trying, I tried Flashing a new ESP32Cam and I have finally managed to flash a ESP32Cam.

        The issue was that I needed to press and release the RST button after the
        ……_____……_____ started,
        Then it flashed fine.
        However I tried this on the 1st ESP32Cam which I had tried flashing time and time again before today and no luck.
        I tried with the new method and still no luck!
        Regards Adrian

        Reply
    • Hi,
      I detected the same issue. Root cause is lacking of sufficient 3.3 V power via the USB – serial FTDIs. External 5 V supply to the ESP32 solved the problem.
      In that case there is no need to connect 3.3, GND, TX and RX are sufficient (and IO 0 to GND).

      Reply
  43. DEAR SARA,
    i have been encountering the following problem
    “Board ESP32wrover (platform esp32, package esp32) is unknown”
    “Error compiling for ESP32 Wrover Module”
    in the Arduino IDE
    PLEASE ANY HELP AS TO THE WAY FORWARD?

    Reply
  44. Hi,
    Thank you for a great tutorial.
    Another approach to solve a problem.

    My ESP32-Camera module is 2AHMR .
    Upload of sketch working fine as described above.
    But after reset, Camera was not recognized.
    Tried with separate 5V power supply and different camera definitions in sketch – no luck.
    Went back to AI-Thinker definition in sketch and uploaded the sketch with different Flash Mode. Instead of QIO, I used DIO.
    That was the magic key for me. 🙂

    I am keeping the external 5V power supply on 5V pin and using the USB2Seriel on 3.3V connected to 3.3V on the ESP.

    I have experienced the Flash Mode issue before with other ESP32’s…

    Regards.

    Reply
  45. got this error after press reset button on esp32…
    23:23:21.525 -> ets Jun 8 2016 00:22:57
    23:23:21.525 ->
    23:23:21.525 -> rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    23:23:21.525 -> configsip: 0, SPIWP:0xee
    23:23:21.525 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    23:23:21.525 -> mode:DIO, clock div:1
    23:23:21.525 -> load:0x3fff0018,len:4
    23:23:21.525 -> load:0x0f3f0004,len:448
    23:23:21.869 -> ets Jun 8 2016 00:22:57
    23:23:21.869 ->
    23:23:21.869 -> rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    23:23:21.869 -> configsip: 0, SPIWP:0xee
    23:23:21.869 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    23:23:21.869 -> mode:DIO, clock div:1
    23:23:21.869 -> load:0x3fff0018,len:4
    23:23:21.869 -> load:0x0f3f0004,len:192
    23:23:22.166 -> ets Jun 8 2016 00:22:57
    23:23:22.166 ->
    23:23:22.166 -> rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    23:23:22.166 -> configsip: 0, SPIWP:0xee
    23:23:22.166 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    23:23:22.166 -> mode:DIO, clock div:1
    23:23:22.166 -> load:0x3fff0018,len:4
    23:23:22.166 -> load:0x0f3f0004,len:448

    what should i do??

    Reply
  46. Hello, how is this message? Can you help me, please?

    [E][camera.c:1049] camera_probe(): Detected camera not supported.
    [E][camera.c:1249] esp_camera_init(): Camera probe failed with error 0x20004

    Reply
  47. Regarding “Failed to connect to ESP32: Timed out waiting for packet header”

    Your schematic photo misled me:
    https://i0.wp.com/randomnerdtutorials.com/wp-content/uploads/2019/03/ESP32-CAM-wiring-FTDI1.png?w=750&ssl=1

    The FTDI has another pin layout as shown. Please consider to replace the image with something like this one:

    https://buyhere22.com/components/usb-ttl-ft232rl-pinout.png

    Also, I had the brownout issue using 3V. The 5V jumper settings in the FTDI needs also another counterpart pin on the ESP32! Something which wasn’t obvious for me.

    Now, although I downloaded the latest arduino, the example code works great, I am unable to use the face recognition feature. Is there any further documentation on that?

    Reply
      • Hello Sara, happy new year!
        Finally got back to the project. Added a line to the setup-code: Yes, my board has PSRAM. I bought this board: “KeeYees WiFi + Bluetooth Modul Kit 4M PSRAM ESP32-CAM Dual-Core 32 Bit CPU” (smile.amazon.de/gp/product/B07S83X9NM/)

        Alas, enrolling faces seems to have no effect at all. No fancy yellow rectangle, no text displayed. I tried different light environments.

        Will debug the code…

        Reply
        • Hi, Markus, happy new year! I have encountered the same problem as you. Now my online video stream works normally, but when I clicked the “Face recognition” and “Face Detection”, nothing happened and there is no colorful box displayed.

          Besides, my board has also PSRAM. I still don’t know how to solve it? Do you have any progress on this problem?

          Reply
  48. I was constantly getting

    A fatal error occurred: Timed out waiting for packet content

    when uploading but the initial communication was working fine (esptool.py displayed the device details just fine).

    The solution was to set the baud rate down to 115200. Maybe it’s the cheap CH341 USB-to-TTL module I’m using that cannot cope with higher baud rates.

    Maybe this is helpful to others.

    Reply
  49. hello world, could someone help me? I managed to view 3 esp32-cam inside my house … but when I tried to access from the outside I can only view 1 esp32-cam … the question is: has anyone tried to add more than one camera by accessing it from the external?

    Reply
  50. Hi Rui/Sara,

    Thanks for you excellent tutorials on the ESP32-CAM boards. I have it setup now with the cam-web-server-camera-home-assistant sketch, which works very well when used with Chrome/Firefox. I run into problems though when running it into VLC (just doesn’t connect) and into my VMS, which reports “Camera error – HTTP mulitpart stream header missing Content-Length’. Any ideas why VLC & the VMS are throwing an error?

    Best regards

    Andy

    Reply
    • Hi Andy.
      I don’t know why that happens – I never tried using VLC to check ESP32-CAM video.
      Please note that the ESP32-CAM can only stream to one client at a time.
      I’m sorry that I can’t help much.
      Regards,
      Sara

      Reply
  51. Could you help me pls I can’t find on any website pinout for fake camera. I checked all this stuf like voltage itd. but it didn’t help me. I will be vey grateful if you help me

    Reply
    • Hi.
      That means the code was successfully uploaded.
      Disconnect GPIO 0 from GND, open the Serial Monitor and press the ESP32-CAM on-board RESET button to get its IP address.
      Then, you just need to open a browser and type the ESP32-CAM IP address.
      Regards,
      Sara

      Reply
  52. thanks for sharing amazing projects
    i upload code to the board and everythings work fine but when i turn off wifi and then turn it on again, web server not work again and it need manual restart to work again.
    how can i fix this?

    Reply
  53. Hi, I tried following the tutorial and managed to get everything working up to the point of obtaining the IP address from the serial monitor. I bought an ESP32-S from Bangood (the only difference to the one in the tutorial is that mine doesn’t have the words AI-Thinker imprinted underneath ESP32-S). https://www.banggood.com/ESP32-CAM-WiFi-bluetooth-Development-Board-ESP32-with-FT232RL-FTDI-USB-to-TTL-Serial-Converter-40-Pin-Jumper-p-1605463.html?rmmds=detail-left-hotproducts__5&cur_warehouse=UK

    I get an endless loop of the same message and have no idea how to fix this:

    ets Jun 8 2016 00:22:57

    rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff0018,len:4
    load:0x3fff001c,len:1216
    ho 0 tail 12 room 4
    load:0x40078000,len:9720
    ho 0 tail 12 room 4
    load:0x40080400,len:6352
    entry 0x400806b8
    Guru Meditation Error: Core 0 panic’ed (IllegalInstruction). Exception was unhandled.
    Memory dump at 0x400db308: ffffffff ffffffff ffffffff
    Core 0 register dump:
    PC : 0x400db30c PS : 0x00060e30 A0 : 0x800d776c A1 : 0x3ffbb9f0
    A2 : 0x00000001 A3 : 0x00000001 A4 : 0x3ffc2900 A5 : 0x00000000
    A6 : 0x00000080 A7 : 0x00000000 A8 : 0x800852c1 A9 : 0x3ffbb9d0
    A10 : 0x3ffc2900 A11 : 0x00c86016 A12 : 0x3ff49060 A13 : 0x00000000
    A14 : 0x00000000 A15 : 0x00000000 SAR : 0x00000017 EXCCAUSE: 0x00000000
    EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000

    Backtrace: 0x400db30c:0x3ffbb9f0 0x400d7769:0x3ffbba20 0x400d34c8:0x3ffbba40 0x400d3441:0x3ffbba60 0x400d3db3:0x3ffbba80 0x400d73ae:0x3ffbbab0 0x4008db91:0x3ffbbad0

    Rebooting…

    Reply
    • Hi.
      Take a look at bullet number 3.
      Also, double-check that the ESP32-CAM is being powered with 5V. Check that with a multimeter.
      Regards,
      Sara

      Reply
      • Hi,
        I tried suggestions from bullet 3 but these don’t work. Checked the voltage input with a multiemeter and it was recieving 5V. I tried the ESP32 – WiFiScan Example and this worked fine however trying the ESP32-CAM Video Streaming and Face Recognition with Arduino IDE runs into the error mentioned in my above post. I don’t know if the WiFiScan uses PSRAM but if it doesn’t maybe this is the problem and my board is faulty?

        Reply
          • Hi Sara,

            Yes I tried all of the above and rebuilt the circuit many times. I believe my board might be faulty as it is not detecting PSRAM, which it should be. I will let you know if the tutorials still fail to work upon receiving a new ESP32 board unless there is anything else you can think of that might help?

            With best regards,
            Andrew

  54. Hello Sara,
    Im using the AI Thinker module which includes psram and though face the Failed to get the frame on time-issue.

    Perhaps someone knows a way to face this.

    Reply
  55. Having put together a soldered solution, your “How Too’s” are so good and then, I followed the Can’t get it to program, Point “1”!!!!
    No Luck.

    I then got another FTDI, and ESP-Cam module and, cobbled together, patched it. WORKED: Thanks sort of happy now.

    Reply
  56. nevermind, it was my fault, I was connecting to my network guest ssid, so when I tried from the main net I wasn’t reaching…!

    Reply
  57. Hello Shara,

    I’m having this problem, repeat on my serial monitor, could you help me please …

    16:42:39.376 -> rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    16:42:39.376 -> configsip: 0, SPIWP:0xee
    16:42:39.376 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    16:42:39.376 -> mode:DIO, clock div:1
    16:42:39.376 -> load:0x3fff0018,len:4
    16:42:39.376 -> load:0x3fff001c,len:1100
    16:42:39.376 -> load:0x40078000,len:9232
    16:42:39.376 -> load:0x40080400,len:6400
    16:42:39.376 -> entry 0x400806a8
    16:42:39.895 -> ets Jun 8 2016 00:22:57

    Reply
    • Hi.
      For that problem, take a look at the suggestions at bullet 2 and 3. Usually, it is related to power supply. Make sure the ESP32-CAM is being powered with 5V on the 5V pin (not VCC pin).
      Regards,
      Sara

      Reply
      • I’m getting a similar (slightly different) repeating Serial Monitor Output (see below). We’re on a Mac connected via USB/TTL cable which is putting out 5VDC (confirmed with multi-meter)

        Tech specs:
        MCU: AI Thinker ESP32Cam (that has worked just fine in the past)
        Computer: MacBook Pro using on OS 10.15.4 (latest)
        Arduino IDE: v1.8.12 (latest)
        SiLabs Driver: v5.3.5 (latest)
        ESP32 board package version 1.0.4 (latest)
        Tools > Board > “AI Thinker ESP32-Cam” (This may be a change from prior successful attempts, so we might try other some other boards)

        Repeating Serial Monitor Output:
        rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
        configsip: 0, SPIWP:0xee
        clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
        mode:DIO, clock div:1
        load:0x3fff0018,len:4
        load:0x3fff001c,len:1216
        ho 0 tail 12 room 4
        load:0x40078000,len:9720
        ho 0 tail 12 room 4
        load:0x40080400,len:6352
        entry 0x400806b8

        Reply
        • Ammending the previous post. I get a little farther along if, instead of hitting the ESP32Cam’s “Reset” button after flashing, simply unplugging and re-plugging in the power. That takes care of the looping, but I get a camera error:

          rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
          configsip: 0, SPIWP:0xee
          clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
          mode:DIO, clock div:1
          load:0x3fff0018,len:4
          load:0x3fff001c,len:1216
          ho 0 tail 12 room 4
          load:0x40078000,len:9720
          ho 0 tail 12 room 4
          load:0x40080400,len:6352
          entry 0x400806b8

          [E][camera.c:1049] camera_probe(): Detected camera not supported.
          [E][camera.c:1249] esp_camera_init(): Camera probe failed with error 0x20004

          Reply
      • Hi.
        The connections have already been revised, but the problem persists, I have even tried to put an external power supply, however nothing has resolved so far, I have also followed resolutions 2 and 3, and nothing too. Any more ideas? Thankful for the return.

        Reply
  58. I let my problem going until I had to get rif of it to go further : pictures are with artefacts above resolution SVGA.
    Downgrade the frequency to 10MHz solved my problem : config.xclk_freq_hz = 10000000;

    I get now very nice picture for all resolutions (I do not need framerate at all)
    I was looking for that for a while… I do not beleive I’m the only one !!!
    Hope it will help many makers.

    Maybe I got too cheap cameras ^^ !

    Reply
      • I have this error compile everything right, when I change to the correct model of the camera it does not work.

        [E] [camera.c: 1344] esp_camera_fb_get (): Failed to get the frame on time!
        00: 20: 59.513 -> Camera capture failed

        I tried all the solutions above and it didn’t work, can someone help me?

        Reply
          • Good morning Sara, the same code as the topic with this model,

            produto.mercadolivre.com.br/MLB-1209327508-modulo-esp32-cam-c-camera-ov2640-2mp-_JM?quantity=1

            I noticed that the model I bought is not Ai Thinker, is there any difference?

            The camera is Ov2640 …

            can you help me ?

          • Hi.
            The camera should work with that board.
            Are you following the exact steps we show?
            How are you powering your board?
            Regards,
            Sara

          • Yes, I tried all of the above corrections, and continued with camera initialization error and capture failure, I’m using the notebook’s own power, 5v on the FTD converter output, the code loads beauty, opens the perfect web interface, but when it goes start the camera, it returns on the monitor

            [E] [camera.c: 1344] esp_camera_fb_get (): Failed to get the frame on time!
            00: 20: 59.513 -> Camera capture failed

            Thanks for listening.

  59. Hello,
    I fell into all the traps without getting out of it, suddenly I changed my rifle
    and I started on the Time Lapse proposed by the bitluni laboratory: https://bitluni.net/esp32camtimelapse
    On the one hand, it works well, and seems more stable ;
    and on the other hand, I was able to add the use of the GPIO0 port to use the ESP32 as a sound detector (via the FFT) and trigger a reboot that takes the photo.

    Reply
  60. I think your instructions should mention dropping the upload speed to 115200.
    Until I did that, I couldn’t upload the sketch. I had to read the instructions on ‘instructables circuits’ to find that out. Others had the same issue, judging by the comments here.

    Reply
    • The suggested upload speed is 115200. However, the speed of 962100 is also workable. A reliable upload speed varies from project to project. Even, the placement of the TX and RX wires can affect the upload speed.

      Reply
  61. Hi ,

    I used esp32-cam in some dark scene, so added LEDC module for LIGHTING. I tried GPIO 4 ,14, 15, LEDs worked well. But the camera could not started up(camera can’t work with LEDC together?).

    error messages:
    E][sccb.c:154] SCCB_Write(): SCCB_Write Failed addr:0x30, reg:0xff, data:0x0

    Reply
    • Hi.
      It can.
      But you probably need to use a different PWM channel.
      The OV2640 camera uses PWM channel 0 when working with the ESP32-CAM. So, if you’re using PWM with the ESP32 and the camera at the same time, select a different channel for the PWM that is controlling the LED.
      I hope this helps.
      Regards,
      Sara

      Reply
  62. Hello, it has allowed me to load the code but without reaction. The serial monitor does not print when I load it, when I reset it I get the following message:
    20: 13: 08.908 -> ets Jun 8 2016 00:22:57
    20: 13: 08.908 ->
    20: 13: 08.908 -> rst: 0x1 (POWERON_RESET), boot: 0x3 (DOWNLOAD_BOOT (UART0 / UART1 / SDIO_REI_REO_V2))
    20: 13: 08.908 -> waiting for download

    I am using a Ttl Pl2303 Rs232 series programmer, will this have to do?

    Reply
  63. I test the “motion detector photo email”. I found the followings in serial monitor.No gmail sending.
    23:11:27.766 -> The picture has been saved in /photo.jpg – Size: 12048 bytes
    23:11:27.766 -> Sending email…
    23:11:27.766 -> Connecting to SMTP server…
    23:11:29.869 -> SMTP server connected, wait for response…
    23:11:30.073 -> Identification…
    23:11:30.311 -> Authentication…
    23:11:30.617 -> Sign in…
    23:11:31.227 -> Error, login password is not valid
    23:11:31.260 -> Error sending Email, login password is not valid
    23:11:31.260 -> Going to sleep now

    Reply
  64. hi, i am having a problem uploading the code… i had already checked the wiring and they are all good. Besides, i had changed the 3v to 5v and it still doesn’t work… i pressed the reset button too while uploading. what should i do?

    Reply
    • Hi.
      That means you forgot to disconnect GPIO 0 from GND. That means the ESP32 is in flashing mode.
      Disconnect GPIO 0 from GND and you won’t have that issue. The ESP32 will run the code.
      Regards,
      Sara

      Reply
  65. Hello, congratulations on the excellent work you are doing. Let’s see if you can orient me, my ESP CAM, goes well but in browser you only see image, does not load configuration menu. What am I doing wrong? What’s the matter?.
    Best regards.

    Reply
  66. Hello, problem solved, I have been playing with different sketches and I had one modified by Rui loaded that did not have the configuration menu
    Regards.

    Reply
  67. As a newbie, working with ESP32_CAM, I found I have almost all the issues mentioned above and in the guide. I never take a compilation failure as true unless I have: 1) powered off the project; 2) reset the wires on the breadboad; 3) checked the camera; 4) checked the wires on my TTL comms board. Then if I get the error three times in a row I assume something has changed in my code, maybe an accidental key press or even an intentional change that is incorrect.
    Then I check google and github for the details of the error, then I might ask for help. Sometimes it is just a lack of information in a fast changing world; sometimes it is my pure ignorance because I am not a programmer and I do not know the compiler language. I hope I am learning along the way!!

    Reply

Leave a Reply to pliz Cancel reply

Download our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.