Monday, 6 March 2023

ESP32-CAM Video Streaming and Face Recognition with Arduino IDE

 

ESP32-CAM Video Streaming and Face Recognition with Arduino IDE

This article is a quick getting started guide for the ESP32-CAM board. We’ll show you how to setup a video streaming web server with face recognition and detection in less than 5 minutes with Arduino IDE.


Note: in this tutorial we use the example from the arduino-esp32 library. This tutorial doesn’t cover how to modify the example.

Related project: ESP32-CAM Video Streaming Web Server (works with Home Assistant and Node-Red)

Watch the Video Tutorial

You can watch the video tutorial or keep reading this page for the written instructions.

Parts Required

To follow this tutorial you need the following components:

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Introducing the ESP32-CAM

https://youtu.be/MicAM_A0_lU 


The ESP32-CAM is a very small camera module with the ESP32-S chip that costs approximately $10. Besides the OV2640 camera, and several GPIOs to connect peripherals, it also features a microSD card slot that can be useful to store images taken with the camera or to store files to serve to clients.

The ESP32-CAM doesn’t come with a USB connector, so you need an FTDI programmer to upload code through the U0R and U0T pins (serial pins).

Features

Here is a list with the ESP32-CAM features:

  • The smallest 802.11b/g/n Wi-Fi BT SoC module
  • Low power 32-bit CPU,can also serve the application processor
  • Up to 160MHz clock speed, summary computing power up to 600 DMIPS
  • Built-in 520 KB SRAM, external 4MPSRAM
  • Supports UART/SPI/I2C/PWM/ADC/DAC
  • Support OV2640 and OV7670 cameras, built-in flash lamp
  • Support image WiFI upload
  • Support TF card
  • Supports multiple sleep modes
  • Embedded Lwip and FreeRTOS
  • Supports STA/AP/STA+AP operation mode
  • Support Smart Config/AirKiss technology
  • Support for serial port local and remote firmware upgrades (FOTA)

ESP32-CAM Pinout

The following figure shows the ESP32-CAM pinout (AI-Thinker module).

There are three GND pins and two pins for power: either 3.3V or 5V.

GPIO 1 and GPIO 3 are the serial pins. You need these pins to upload code to your board. Additionally, GPIO 0 also plays an important role, since it determines whether the ESP32 is in flashing mode or not. When GPIO 0 is connected to GND, the ESP32 is in flashing mode.

The following pins are internally connected to the microSD card reader:

  • GPIO 14: CLK
  • GPIO 15: CMD
  • GPIO 2: Data 0
  • GPIO 4: Data 1 (also connected to the on-board LED)
  • GPIO 12: Data 2
  • GPIO 13: Data 3

Video Streaming Server

Follow the next steps to build a video streaming web server with the ESP32-CAM that you can access on your local network.

Important: Make sure you have your Arduino IDE updated as well as the latest version of the ESP32 add-on.

1. Install the ESP32 add-on

In this example, we use Arduino IDE to program the ESP32-CAM board. So, you need to have Arduino IDE installed as well as the ESP32 add-on. Follow one of the next tutorials to install the ESP32 add-on, if you haven’t already:

2. CameraWebServer Example Code

In your Arduino IDE, go to File > Examples > ESP32 > Camera and open the CameraWebServer example.

The following code should load.

ESP32 CameraWebServer Example

Before uploading the code, you need to insert your network credentials in the following variables:

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

Then, make sure you select the right camera module. In this case, we’re using the AI-THINKER Model.

So, comment all the other models and uncomment this one:

// Select camera model
//#define CAMERA_MODEL_WROVER_KIT
//#define CAMERA_MODEL_ESP_EYE
//#define CAMERA_MODEL_M5STACK_PSRAM
//#define CAMERA_MODEL_M5STACK_WIDE
#define CAMERA_MODEL_AI_THINKER

If none of these correspond to the camera you’re using, you need to add the pin assignment for your specific board in the camera_pins.h tab.

Now, the code is ready to be uploaded to your ESP32.

3. ESP32-CAM Upload Code

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

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.

Getting the IP address

After uploading the code, disconnect GPIO 0 from GND.

Open the Serial Monitor at a baud rate of 115200. Press the ESP32-CAM on-board Reset button.

The ESP32 IP address should be printed in the Serial Monitor.

Accessing the Video Streaming Server

Now, you can access your camera streaming server on your local network. Open a browser and type the ESP32-CAM IP address. Press the Start Streaming button to start video streaming.

You also have the option to take photos by clicking the Get Still button. Unfortunately, this example doesn’t save the photos, but you can modify it to use the on board microSD Card to store the captured photos.

There are also several camera settings that you can play with to adjust the image settings.

Finally, you can do face recognition and detection.

First, you need to enroll a new face. It will make several attempts to save the face. After enrolling a new user, it should detect the face later on (subject 0).

And that’s it. Now you have your video streaming web server up and running with face detection and recognition with the example from the library.

Troubleshooting

If you’re getting any of the following errors, read our ESP32-CAM Troubleshooting Guide: Most Common Problems Fixed

  • Failed to connect to ESP32: Timed out waiting for packet header
  • Camera init failed with error 0x20001 or similar
  • Brownout detector or Guru meditation error
  • Sketch too big error – Wrong partition scheme selected
  • Board at COMX is not available – COM Port Not Selected
  • Psram error: GPIO isr service is not installed
  • Weak Wi-Fi Signal
  • No IP Address in Arduino IDE Serial Monitor
  • Can’t open web server
  • The image lags/shows lots of latency

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

Wrapping Up

The ESP32-CAM provides an inexpensive way to build more advanced home automation projects that feature video, taking photos, and face recognition.

In this tutorial we’ve tested the CameraWebServer example to test the camera functionalities. Now, the idea is to modify the example or write a completely new code to build other projects. For example, take photos and save them to the microSD card when motion is detected, integrate video streaming in your home automation platform (like Node-RED or Home Assistant), and much more.

We hope you’ve find this tutorial useful. If you don’t have an ESP32-CAM yet, you can grab it here.

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



Build Web Server projects with the ESP32 and ESP8266 boards to control outputs and monitor sensors remotely. Learn HTML, CSS, JavaScript and client-server communication protocols DOWNLOAD »

Enjoyed this project? Stay updated by subscribing our newsletter!

397 thoughts on “ESP32-CAM Video Streaming and Face Recognition with Arduino IDE”

  1. TF card 4GB limit. Will larger capacity cards, i.e. 8GB work, but only 4GB will be usable? Smaller cards are getting harder to find. FAT-16 format required?

    Reply
  2. Thanks very much for this ESP32-CAM project, I am looking forward to learning the camera applications, it is my first.
    Unfortunatly I am getting the following error returned to the serial monitor after reset:

    SCCB_Write [ff]=01 failed
    SCCB_Write [12]=80 failed
    [E][camera.c:1085] esp_camera_init(): Camera probe failed with error 0x20001
    Camera init failed with error 0x20001

    I have updated the arduino IDE to 1.8.9 and ESP32 boards as per instructions, but cant find the problem. If you have any ideas I really appriecate it.

    Reply
    • Hi James.
      Did you select the right camera module in the code?
      Please double check that your camera is well connected to the board.
      I also found this issue: github.com/espressif/esp32-camera/issues/5
      It seems the same as yours, so it might help.
      Regards,
      Sara

      Reply
      • Hi Dan, yes I took Sara’s advice and selected the correct camera module in the code but commenting out the ones that don’t apply. I did also find reducing the upload speed made things more stable. I think my programmer is not the best.
        Very happy it works very well. Thanks again

        Reply
        • can you help me how to modify code to push stream to my public proxy url on the internet?
          I want to make a page which accessible publicly and don’t want to have public ip for my local network. so needs esp to stream to my proxy url itself

          Reply
      • Hi Dan, did you found the solution. I also purchase two units with different brand with same issue. (the first one have successed before but when retry to reupload the issue came).

        Try all suggestions here by changing board selection, changging cable, changging programmer device, changging pins selection, try with different PC and all have same problem.

        Reply
    • I Had the Same Camera init failed with error 0x20004. I powered the ESP32 with 5v and works great. May try the 5V to see if it goes away.

      THANKS For this great site and tutorials!!!!!

      Reply
  3. Any update on card sizes??? Brand name 4 GB cards are special order. When I find 4GB they are almost as expensive as 16/32GB sizes. Ebay takes forever anymore, and then you don’t know what you are getting. No name brand on Ali Express or Banggood.

    Reply
  4. Hi. Great tutorial; worked like a charm once used a separate 5V supply.

    Any way you know of to see the video stream or stills via a TFT display on another ESP through web browser or otherwise? I’ve used ESPNow between ESP12’s or 32’s for display of thermal cam images but they’re much smaller. Avoids need for phone or laptop tied up….
    Thanks
    Mel

    Reply
  5. Hi, thanks for the tutorial, but I’m getting 2 problems with the code :

    1. I can’t include the zip file through “Add .ZIP library” from Arduino IDE

    2. When I put it manually through extracting the zip file and moved it to my Arduino libraries folder, then compile the code, I got “no headers files (.h) found” error

    Any help would be appreciated, thanks again for the tutorial.

    Reply
    • Hi Mario.
      You don’t need to install any library. You just need to have the ESP32 add-on installed.
      The zip file that we provide contains all the code that you need.
      You just need to unzip the file, open the CameraWebServer folder and open the CameraWebServer.ino.
      Your arduino IDE should open the code and you’ll see three tabs at the top. Then, you just need to upload the code to your board.
      Alternatively, if you have the latest updated ESP32 add-on, you should have the code in your examples. Go to File > Examples > ESP32 > Camera and open the CameraWebServer example.
      I hope this helps.
      Regards,
      Sara

      Reply
      • i got this error when upload the code on esp32-cam using ftdt programer
        A fatal error occurred: Invalid head of packet (0x65)

        Reply
  6. I was looking for something like this for my recent project, Thanks! Great tutorial! But I think ESP32-CAM is “unofficial” combination of ESP32 with a camera. I think Espressif themselves released a dedicated “official” ESP32+camera board called ESP-EYE with their own “official” software library called ESP-WHO.

    Well I got all the information from here: https://www.ebay.com/itm/254177708782

    Have not tried that board myself. Can you make a tutorial on that as well since that is the “official” hardware and software and would have longer support from Espressif itself.

    Also a comparison between the 2 would be great too.

    I follow a lot of Random Nerd Tutorials. You guys make easy to follow guides. Cheers! Keep it up!

    Thanks!

    Reply
    • Hi Ryan.
      Thank you for your nice words.
      The ESP-EYE is an Espressif release.
      We haven’t fully tested the ESP-EYE yet. We’ve played with the example firmware that they provide and we made a blog post about it that you can read here: https://makeradvisor.com/esp-eye-new-esp32-based-board/
      At the moment, we don’t have any more tutorials with the ESP-EYE.
      Thank you for your interest in our content.
      Regards,
      Sara

      Reply
  7. Brownout detector was triggered

    ets Jun 8 2016 00:22:57

    rst:0xc (SW_CPU_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:10088
    load:0x40080400,len:6380
    entry 0x400806a4

    What happened? ¿Qué ocurre? Thx

    Reply
  8. Greetings and congratulations for the tutorial. You are a very nice couple.
    Is it possible to take this captured image to a server on the internet?
    Can I have this camera in my house and see what happens from my work?

    Thank you.

    Reply
  9. Hi Rui & Sarah,
    How do you set up face recognition ?
    I have the whole thing working as expected, however the Enroll face button does nothing ?

    Reply
    • It seems that face recognition is no longer working (at least with the example program) when using the 1.02 ESP core.
      Rolling back to the 1.01 core and using the example program belonging to that core, will ‘fix’ it (currently that is the program that Sara and Rui have on their Github

      Reply
  10. Hi Guys,
    I purchased two units and both fail with the following:

    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:10088
    load:0x40080400,len:6380
    entry 0x400806a4
    [D][esp32-hal-psram.c:47] psramInit(): PSRAM enabled

    [E][camera.c:1085] esp_camera_init(): Camera probe failed with error 0x20001
    Camera init failed with error 0x20001
    I’ve selected AI Thinker in the code and reduced the upload to 115200. Anyone have some insights? I have a M5Stack Camera which works pretty well with the code but these two are dead.
    Thanks
    Dan

    Reply
  11. Hi! good tutorial!, I need to put the upload speed 115200 and the flash frequency in 40Mhz to avoid a Guru Meditation Error: Core 0 panic’ed (InstrFetchProhibited) error if someone have the same problem 🙂

    Reply
    • There is a small red led (GPIO33 inverted) . The main led is controlled by GPIO4. In the example CamWebServer program there is AFAIK no possibility in the webserver to switch the main LED.
      Should be possible though to program Switching the LED and control it via say HASSio or OpenHab, with an MQTT command or something. If there are any unused pins, you could add a switch

      Reply
  12. I am having problems getting errors: camera_probe(): Detected camera not supported.
    esp_camera_init(): Camera probe failed with error 0x20003.

    That occurs selecting AI Thinker. The other two options give me the 0x20001 error. I bought the esp camera from DIYMORE.CC. The description in their ad prints AI Thinker on the chip, but my actual device does not have AI Thinker printed. It just has DM-ESP32-S.

    Any ideas?

    Reply
    • Did you find a solution or the correct IDE setting for your DM ESP32?
      I have the same modules but haven’t used them yet.
      I’d appreciate your input.

      Reply
    • i have the same DM board, used the same IDE settings as mentioned here, no problem with the arduino sample, except must use 5v power otherwise will keep getting brownout error

      Reply
  13. Thanks Great Job
    But i have almost the same problem as Neil.
    face recognition works very bad i get almost no yellow square
    how to ficks that?

    Reply
    • Hi.
      Face recognition is a bit slow, however we managed to make it work fine.
      Please make sure that you have proper lighting to make the face recognition process easier and more efficient. Also, when enrolling a new face, you need to be steady and don’t move much, so that it properly saves your face features and can recognize it in the future.
      Regards,
      Sara

      Reply
  14. Hi,
    Got my hardware last week from banggood. It had the issue “Brownout detector was triggered”. Seaching the web i found this video where they say to feed by 5v not 3.3v.
    https://www.youtube.com/watch?v=tzmcXZ-irIc ~2:30
    This solved the brownout issue for me.
    Then the web service did not appear in google chrome browser. Error message was something about too much header lines or so. In MS Edge it was ok. But i have no image from the cam. Cam must be broken. So i have to wait another month to get this as spare part. Have also ordered another ESP board with an external antenna hoping to get better connection to the router.

    Reply
    • Hi Patrick.
      I’m sorry you’re getting trouble using your ESP32-CAM.
      The brownout detector error usually means that the ESP32 is not being powered properly. You can read more about this on our troubleshooting guide, bullet 8: https://randomnerdtutorials.com/esp32-troubleshooting-guide/
      Our camera worked flawlessly following the steps we describe in our tutorial.
      The ESP32-CAM should work fine being powered either with 3.3V through the 3.3V pin or 5V through the 5V pin. You’re probably not providing enough current.
      Also, we didn’t have any trouble accessing the web server on Google Chrome.
      After you get a new camera, let us know how it went.
      Regards,
      Sara

      Reply
  15. Any ideas what would cause a 20003 error? I have tried all three camera types. The AI Thinker gives 20003. The other two cause a 20001 error

    Reply
    • Hi John.
      I’m sorry you’re having that issue.
      Those errors usually mean that the camera is not properly connected. So, or your camera module is faulty or it is not properly connected.
      If these are not the reasons, it is very difficult for us to understand what is going on.
      Can you try using a new camera probe?
      Regards,
      Sara

      Reply
  16. Thanks. The camera came installed. I bought 2 of them, and they both fail. I decided to buy from another source and see if that works.

    I am not sure what you are referring to regarding a new camera probe.

    Reply
  17. Dear ALL

    ESP32 doesn´t connect with mit Network and no text in Serial Monitor is being printed. SID and PW changed in coding. Any Ideas?
    Message in Arduino 1.8.8:

    Der Sketch verwendet 2233514 Bytes (71%) des Programmspeicherplatzes. Das Maximum sind 3145728 Bytes.
    Globale Variablen verwenden 50692 Bytes (15%) des dynamischen Speichers, 276988 Bytes für lokale Variablen verbleiben. Das Maximum sind 327680 Bytes.
    esptool.py v2.6-beta1
    Serial port COM9
    Connecting…….
    Chip is ESP32D0WDQ6 (revision 1)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
    MAC: cc:50:e3:b6:e5:90
    Uploading stub…
    Running stub…
    Stub running…
    Configuring flash size…
    Auto-detected Flash size: 4MB
    Compressed 8192 bytes to 47…

    Writing at 0x0000e000… (100 %)
    Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4096.1 kbit/s)…
    Hash of data verified.
    Compressed 17664 bytes to 11528…

    Writing at 0x00001000… (100 %)
    Wrote 17664 bytes (11528 compressed) at 0x00001000 in 1.0 seconds (effective 138.4 kbit/s)…
    Hash of data verified.
    Compressed 2233680 bytes to 1788374…

    Wrote 2233680 bytes (1788374 compressed) at 0x00010000 in 158.5 seconds (effective 112.7 kbit/s)…
    Hash of data verified.
    Compressed 3072 bytes to 134…

    Writing at 0x00008000… (100 %)
    Wrote 3072 bytes (134 compressed) at 0x00008000 in 0.0 seconds (effective 768.0 kbit/s)…
    Hash of data verified.

    Leaving…
    Hard resetting via RTS pin…

    Reply
    • Hi.
      It seems that your code was uploaded successfully.
      Make sure you open the serial monitor at a baud rate of 115200, so that you can see the text on the serial monitor.
      After uploading the code, you should disconnect GPIO from GND. Open the Serial monitor, and then press the ESP on-board reset button.
      Please make sure you’ve inserted the right network credentials.
      Can you access the web server when you insert the IP address on your browser?
      Regards,
      Sara

      Reply
  18. Dear Sara,
    may I ask you please to advise on the issue below.
    I purchased an AI Thinker, but it is not printed on the chip.
    This product contains the OV2640 Camera Module.

    Can you please advise on which Camera Model to use?
    The use of #define CAMERA_MODEL_AI_THINKER refers to the error. Also the other led to issues.

    Thanks

    Brownout detector was triggered

    ets Jun 8 2016 00:22:57

    rst:0xc (SW_CPU_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

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

    Reply
  19. Thank you very much for sharing. Using M5STACKcam I didn’t had image. After troubleshooting and comparing with other codes I changed setting for Y2_GPIO_NUM to 17. Now it works like a sharm 🙂 using ESP32 DevModule with Huge APP for partition scheme.

    Reply
  20. I faced different problems getting the module working. Since I am using the 5V-supply pin (instead of the 3.3V on the CAMERA_MODEL_AI_THINKER) everything is OK.

    Reply
  21. Hi . I have an esp32-cam and i went throught all the process to program the board and everything was going fine . At the end i’ve got the message telling me the ip adress to connect my board so i did in my browser and i ‘ve got the viewer that appeared in the screen but but when i press start stream or get still i don’t have any image on the screen !

    I tried with 2 boards and still the same problem . The only things in common is the software …

    Any idea ?

    Thanks .

    Reply
    • Patrick,

      I have the same problem. After I hit the “Start Stream” button, no image shown on the screen.

      Have you resolved the problem ?

      Regards,
      Ong Kheok Chin

      Reply
    • Hi Patrick,

      I have the same problem. I have a windows machine using Windows 10. I think the problem might be in the windows firewall. My camera streams fine on my android phone. Maybe someone can help us setup the windows firewall. If I can get it figured out, i’ll let you know.

      Reply
  22. Hi, i’m stuck right at the beginning with Arduino IDE 1.8.9 I have to select the board before i see any ESP32 examples – chose ESP32 Wrover module, however examples do not include Camera – any ideas? Thanks

    Reply
  23. Nice tutorial, everything worked. Could you please show us how we can broadcast the video stream to the internet (so that we can see the video from any computer)? Maybe using port forwarding of the ESP32-cam or using a dedicated service? It would also be great to have an example working offline to record the video on a SD card (I haven’t managed to do that). Thanks!

    Reply
    • Hi Oli.
      At the moment, we don’t have any tutorial about that subject.
      We’ve also been trying to use the SD card to save photos and record video, but at the moment, without success.
      Regards,
      Sara

      Reply
  24. Howdy Folks,

    I am getting this major bug in my serial monitor after disconnecting the GPIO0 cable and resetting it:

    Brownout detector was triggered

    ets Jun 8 2016 00:22:57

    rst:0xc (SW_CPU_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
    Guru Meditation Error: Core 0 panic’ed (LoadProhibited). Exception was unhandled.
    Core 0 register dump:
    PC : 0x4012fea1 PS : 0x00060031 A0 : 0xca400000 A1 : 0x3ffe3ac0
    A2 : 0x3ffaff7c A3 : 0x00000080 A4 : 0x3ffbf0ec A5 : 0x40090858
    A6 : 0x02ffffff A7 : 0x00000c00 A8 : 0x4008f290 A9 : 0x3ffe3a90
    A10 : 0x3ffbf0ec A11 : 0x000000fe A12 : 0x00000001 A13 : 0x00000000
    A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000001d EXCCAUSE: 0x0000001c
    EXCVADDR: 0x03000283 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

    Backtrace: 0x4012fea1:0x3ffe3ac0 0x4a3ffffd:0x3ffe3ae0 0x400dea6d:0x3ffe3ba0 0x400de992:0x3ffe3bc0 0x40083ec3:0x3ffe3bf0 0x400840f4:0x3ffe3c20 0x40078f2b:0x3ffe3c40 0x40078f91:0x3ffe3c70 0x40078f9c:0x3ffe3ca0 0x40079165:0x3ffe3cc0 0x400806da:0x3ffe3df0 0x40007c31:0x3ffe3eb0 0x4000073d:0x3ffe3f20

    Rebooting…
    unhandled.

    Guru Meditation Error: Core 0 panic’ed (StoreProhibited). Exception was unhandled. {Note that are about 60 of these in my Log}

    Guru Meditation E⸮ets Jun 8 2016 00:22:57

    rst:0x7 (TG0WDT_SYS_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

    Any Ideas?

    Reply
    • Hello Kurt, here’s what the error: “Brownout detector was triggered” means:

      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), try a different computer USB port or use a USB hub with an external power supply.

      Reply
      • Rui, I am using a USB CH340 and also a USB FTDI serial boards that connect directly to a Computer USB port, there are no cables, other than the Jumper wires. I have tried this on 3 different computers and about 3 to 4 USB ports on each one. I have also tested 2 CAM boards with the exact same results.

        The Brownout is the only thing listed on my previous post, there’s also the:

        “Guru Meditation Error: Core 0 panic’ed (StoreProhibited). Exception was unhandled. {Note that are about 60 of these in my Log}”
        Which spawn 60 TO 100 Messages before it Reboots.

        Reply
        • Hi.
          Some of our readers reported that when they power the ESP32-CAM with 5V, they don’t have the brownout error or guru meditation error anymore.
          Regards,
          Sara

          Reply
          • When I powered either one of them with 5V through the USB Serial dongle the LED on the ESP board lights up and stays on, while the Serial monitor shows nothing.

  25. HI all,
    I purchased a ESP32-Cam. I have had a lot of problems trying to get it to work.
    I could nbot get the sketch to upload and a couple of other small issues.
    What I found was (
    Its all to do with the voltages…..
    and the pin configuration is different on my usb-TTl compared to the pics on the web. ) –
    1. Set the usb-TTl to 3.3V.
    2. connect it to the ESP32-CAM as shown in all the diagrams, (but put the 3.3V from the usb-Tl to 3.3V on the ESP32-CAM.)
    3. Strap the Io0 and gnd.
    .. make sure the pins you have cables on are correct… very important.
    4. Power up and upload the sketch.
    Now to test the ESP32-CAM.
    1. Remove the IO0 and gnd jumper.
    2. Change the usb-TTl to 5v (changing the pin)
    3. Change the voltage on the ESP32-CAM to 5V pin.
    4. Power up.
    5. Open up the serial monitor.
    6. Press the reset button on the ESP32-CAM.
    7. get the IP address.

    Enter the IP address in your browser. Go to the bottom to Start streaming data.
    And It works like a charm.

    If I do not change the voltage on the pins (3.3v for uploading sketch and %v for operating then I could not get anything to work.

    I hope this helps other people who are having Issues.

    Reply
  26. Wonderful tutorial, quick set up….I have 1 little issue…Stills OK, Steaming NOT OK…. Everything seems to work well and good but when I press Start Steam, nothing streams. I can tell through the Monitor, and TTL connection that the Steaming mode is going, and when I stop the monitoring shifts down to lower FPS. Still captures work just fine. Am I missing something? Do I need an SD card installed to allow streaming? Arduino 1.8.9, ESP32 Espressif v1.0.2

    Reply
    • Hi.
      You don’t need SD card to see the streaming.
      I don’t known what can be the problem. Please note that you can only see the streaming on one client at a time. So, make sure that you don’t have any other browser tab making requests to the streaming URL.
      I’m sorry that I can’t help much.
      Regards,
      Sara

      Reply
  27. I am facing the following error while uploading code. Please help
    A fatal error occurred: Failed to connect to ESP32 cam: Timed out waiting for packet header

    Reply
  28. I edit code to use esp32 as accesspoint.
    on serial monitor show:

    IP address: 192.168.4.1
    Starting web server on port: ’80’
    Starting stream server on port: ’81’
    Camera Ready! Use ‘http://192.168.4.1’ to connect
    E (5687) wifi: addba response cb: ap bss deleted

    Reply
    • Hi.
      Unfortunately, I don’t know what that message means.
      If you find out, please share with us.
      Regards,
      Sara

      Reply
  29. Hola a alguien le ha dado el siguiente error
    [E][sccb.c:154] SCCB_Write(): SCCB_Write Failed addr:0x30, reg:0x23, data:0x00, ret:-1
    20:59:56.233 -> [E][camera.c:1215] camera_init(): Failed to set frame size
    20:59:56.233 -> [E][camera.c:1270] esp_camera_init(): Camera init failed with error 0x20002
    No se como solucionarlo, agradesco vuestra ayuda, saludos.

    Reply
    • Hi Arturo.
      Next time, post your questions in english so that everyone can understand.
      Which camera board are you using?

      Reply
        • Hi ARturo.
          That error you were referring to usually means that the camera is not properly connected or the ESP32 is not able to recognize the camera. That can be due to the following issues:

          – 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

          – Not enough power through USB source: Some ESP32-CAM boards required 5V power supply to work properly. We’ve tested all our examples with 3.3V and they worked fine. However, some of our readers reported that this issue was fixed when they power the ESP32-CAM with 5V.

          – Faulty FTDI programmer: Some readers also reported this problem was solved by replacing their actual FTDI programmer with this one: https://makeradvisor.com/tools/ftdi-programmer-board/

          – 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.

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

          I hope this helps.

          regards,
          Sara

          Reply
  30. Hi I did everything as explained and if I get ip and I can enter and start the camera but when selecting the face dectector does not work does not happen nothing does not detect the faces, I have remained still to see if it detects the face and does not work , esp32 I have it connected to the 5v pin because when I tried it with 3.3v I did not want to load the code

    Reply
    • I had the same problem and the camera needs to be in good lighting conditions to get it to do any of the recognition functions…….

      Reply
  31. hello I did everything as established, I charge the code and it gives me the ip and the entry in my browser and if it enters the platform of the camera and I can start the camera only that when selecting for the face detector it does not work I have been still to see if it detects but nothing appears, and if you notice that the quality of the camera is somewhat low and I do not know if that could be the cause, there is no way to turn on the led that includes the esp32 cam to work as flash

    Reply
    • Hi Jesus.
      What is the camera module that you’re using?
      If the camera board doens’t have PSRAM, it won’t be able to do face recognition and detection.
      Regards,
      Sara

      Reply
    • The face recognition and detection should work with that camera.
      Did you follow Neil suggestions?
      You really need to have good lighting, otherwise it won’t be able to recognize faces.
      Regards,
      Sara

      Reply
  32. Hello! Excellent tutorial, got me started real easy with the ESP32-Cam. I did got a bit stuck though:

    – First time I uploaded the CameraWebServer sample sketch, the upload process worked fine, though I could not see any traces back in the serial, even removing the GPIO 0 to GND jumper and resetting.

    – Then I tried to upload *again* and got only an error back:

    esptool.py v2.6
    Serial port COM5
    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

    – Since I had a second ESP32-CAM, I repeated the steps above, and the results were the same: first upload from the IDE succeeded, the next one failed with the error above.

    – I did try to change the upload speed to 115200 bps, but it did not change the results

    – I did not (yet) try pressing the ‘reset’ button in the board, because it is in the back side and I have the module in a protoboard. Since the first upload worked without pressing reset, I’m not sure I need to do it this time, but I’m open for suggestions 🙂

    Thoughts?

    Reply
    • *Update*: it was indeed the ‘reset’ button underneath; if anyone is facing the same problem, just remember to briefly hit the reset button as you’re about to upload the compiled firmware.

      Everything is working fine here now, thanks again for this nice tutorial.

      Reply
      • Hi Claudio,
        Yes, you need to press the reset button, otherwise you won’t be able to upload code.
        Regards,
        Sara

        Reply
  33. Hi, I want to thank you for all your articles, I learned a lot on this site.
    Following this tutorial my ESP32 Cam worked the first try.
    Now the part where I have some problems: I would like to connect some device through I2C like a BME280, a stepper motor and 2 relay but I have some difficult to locate the right pins (if available).
    Could you help me?

    TIA,
    Vince

    Reply
  34. I have 2 boards and cams and with both i have the same problem:

    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

    ……………………………………………………….

    I get endless dots , that’s it. Camera does not init. If I remove the cams from the boards that is detected and an error is printed.

    Reply
    • Hi Mirko.
      That usually happens when people forget to insert their network credentials or don’t insert the credentials properly.
      Please make sure that you’ve inserted your network credentials and double-check that they’re correct.
      Also, make sure that the ESP is relatively close to your router so that it is able to catch Wi-Fi signal.
      Some readers reported that powering the ESP32-CAM board with 5V solved the problem.

      Regards,
      Sara

      Reply
      • Thank you. That solved the problem.
        I was always thinking the ESP32 is opening up a own WiFi hotspot and so inserted credentials for that.
        I did not realize that it wants to connect to my Wifi and needs that credentials.
        I did not even think about that, because I thought that the ……. is a part of the camera initialisation 😉

        So again, thanx for the hint.

        Mirko

        Reply
  35. hello I still have the same problem that facial recognition does not work when I start it in the arduino ide serial monitor I start marking this

    MJPG: 8205B 209ms (4.8fps), AVG: 210ms (4.8fps), 134+61+0+0=196 0
    MJPG: 8220B 208ms (4.8fps), AVG: 210ms (4.8fps), 133+61+0+0=195 0
    MJPG: 8234B 207ms (4.8fps), AVG: 210ms (4.8fps), 133+61+0+0=195 0
    MJPG: 8253B 208ms (4.8fps), AVG: 210ms (4.8fps), 133+61+0+0=195 0
    MJPG: 8258B 239ms (4.2fps), AVG: 211ms (4.7fps), 136+62+0+0=198 0
    MJPG: 8244B 282ms (3.5fps), AVG: 215ms (4.7fps), 134+62+0+0=196 0

    but nothing appears in the view of the camera and if I give it in enrroll face sometimes I throw this error

    Guru Meditation Error: Core 0 panic’ed (LoadProhibited). Exception was unhandled.
    Core 0 register dump:
    PC : 0x40132f33 PS : 0x00060c30 A0 : 0x801333fb A1 : 0x3ffd5090
    A2 : 0x3ffc73fc A3 : 0x00000000 A4 : 0x00000000 A5 : 0x00000000
    A6 : 0x00000008 A7 : 0x00600002 A8 : 0x80132ea4 A9 : 0x3ffd5070
    A10 : 0x00000000 A11 : 0x0000000b A12 : 0x00000005 A13 : 0x00000020
    A14 : 0x00000020 A15 : 0x3ffbe140 SAR : 0x00000020 EXCCAUSE: 0x0000001c
    EXCVADDR: 0x00000001 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

    Backtrace: 0x40132f33:0x3ffd5090 0x401333f8:0x3ffd50c0 0x401334a0:0x3ffd50f0 0x40133755:0x3ffd5120 0x40094c89:0x3ffd5150 0x4008dae1:0x3ffd5190

    Reply
  36. It is also worth to say, that powering the Unit just from the Serial Converter leads to problems (at me) because the Module needs more/quicker Power than my Serial-Converter Module is able to deliver as you can see sometimes on the Serial-Monitor if there is “Brownout Detection …..”

    I just power it from any other “good” Source to work against the “inrush current” that the Module aparently needs to kick in with WiFi.

    Reply
  37. Hello, thank you for posting this material, it is very explanatory. I would like to report a problem with the ESP32-CAM I’m using. The image was stuck and locked. So I switched the voltage to 5V and now it works fine. Thank you

    Reply
  38. Hi guys. Thanks a lot for this tutorial. I’m using the esp32-cam without problems. The only question i have for you is: is there any way to rotate the image in 90º?

    Thanks again!

    Reply
  39. Hello,

    I am having trouble with my diymore esp32 cam. I believe it is a dev module so this is what I pick under boards (there is nothing that says diymore). I am getting connection timeouts using my adafruit programmer friend wired up the same way as the diagram. Using 3v3. Any suggestions?

    Reply
  40. Has anyone had any luck in integrating this tutorial with MQTT? I’d like to be able to publish a notification via MQTT to a topic when a recognised face is detected so I can integrate this with my Home Automation System – Thanks

    Reply
  41. Thanks for your post! i´m from Brazil and i trying using a board ESP32CAM of DiyMore but its no work…my first projeto with ESP32CAM was a AI-Thinker and works fine…
    But when i using ESP32CAM DiyMore not work.

    Maybe ESP32CAM DiyMore its a difrent pinout?

    Reply
  42. my problem as that :

    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

    any solutions pleaseee , thanks

    Reply
  43. Hi!
    can you help me how to modify code to push stream to my public proxy url on the internet?
    I want to make a page which accessible publicly and don’t want to have public ip for my local network. so needs esp to stream to my proxy url itself

    Reply
  44. Hello,

    My board is behaving little strange. Did anybody have this kind of message:

    sptool.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: cc:50:e3:b6:db:fc
    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 4134.8 kbit/s)…

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

    Best Regards,
    Milan

    Reply
  45. Hi Guys !
    Thanks very much for this tutorial !!, pretty straight forward and concise.
    I’ve got my cameras from Aliexpress, they look very much alike to AI’s one. DM instead of AI is the brand that appears on the rfshield.
    I’ve got a Raspberry Pi to serve as a WiFi HotSpot, assign the same IP to the ESP’s MAC address and from my mobile accessing the streaming.
    A bonus: Checking the schematics, I saw that it operates with 3.3v, so the 5v go to a LM1117-3.3v voltage regulator, and this 3.3v regulator is rated up to 15V input !!!. Long story short, I’ve cramped 4 AAA batteries (6v) and the ESP32-CAM inside a GoPro-like waterproof enclosure and VOILA !!!.. .it worked… 🙂 Underwater. at least surrounded by 3 ft of water :-). I had to lower the res down to 320×240 to keep the 23fps but still 🙂
    Guys, you’re awesome !.
    thanks again
    Gabriel

    Reply
    • it is my understanding that face recognition does not work in the 1.02 core of the ESP32. It does work in the 1.01 core.
      If you revert back to the 1.01 core, make sure you also use the Camera example that comes with that core

      Reply
  46. For this problem:

    rst:0xc (SW_CPU_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

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

    solution apply 5V to the card, to the 5v pin

    Reply
  47. Hi, mine won’t detect faces for some reason. Do you have to install a MicroSD card for facial recognition?

    Reply
  48. Hello Rui and Sara,
    there is a litte led on the board. Do you know if it is possible to put it ON via gpio ? The camera will be installed in birdhouse (almost dark) and I woul’d like to have a little bit more light inside. Otherwise I wil use other ports to lit external leds.
    Thank you for your great job and in advance for your answer.

    Reply
    • Hi Bernard.
      The LED is connected to GPIO 4.
      So, you just need to make the usual procedures to put a GPIO on.

      pinMode(4, OUTPUT);
      digitalWrite(4, HIGH);

      Regards,
      Sara

      Reply
      • Thanks a lot, but this little led have not enough power to give good light.
        I used extra leds strips to do the job via a wemos d1.
        Regards,
        Bernard

        Reply
  49. Hi everyone.
    Nice tutorial you’ve got here.

    I’m working on a door security system that would require a cam to take a picture of a face, compare it with already registered images on a database and have it trigger a lock mechanism on successfull validation. (without streaming or accessing via wifi.)

    Would this be possible with esp32 cam?

    Thanks.

    Reply
  50. Hello everyone,
    Can any one help i am getting following error while uploading the code.

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

    Sketch uses 2241942 bytes (71%) of program storage space. Maximum is 3145728 bytes.
    Global variables use 52696 bytes (16%) of dynamic memory, leaving 274984 bytes for local variables. Maximum is 327680 bytes.
    esptool.py v2.6
    Serial port COM8
    Connecting…..
    Chip is ESP32D0WDQ5 (revision 1)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
    MAC: 24:0a:c4:bb:65:c4
    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 4369.0 kbit/s)…

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

    Reply
  51. Hello, your site and your instructions are amazing,i believe that i do everything like you said in the video but it stops at this point. It doesent show me that it connects to the internet,i tried either with an antenna or without one. Please help me get through this if you can

    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

    Reply
  52. Hi guys…
    i have tired facing this problem.can you anyone please help me for solving this problem. I have got espressif ESP32-CAM two module. but i am unable to connect Camera,and i did not get any IP address with this module.
    thanks in advanced
    manu

    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:2
    load:0x3fff0018,len:4
    load:0x3fff001c,len:1100
    load:0x40078000,len:9232
    load:0x40080400,len:6412
    entry 0x400806a8
    Camera init failed with error 0x20004ets 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:2
    load:0x3fff0018,len:4
    load:0x3fff001c,len:1100
    load:0x40078000,len:9232
    load:0x40080400,len:6412
    entry 0x400806a8
    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:2
    load:0x3fff0018,len:4
    load:0x3fff001c,len:1100
    load:0x40078000,len:9232
    load:0x40080400,len:6412
    entry 0x400806a8
    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:2
    load:0x3fff0018,len:4
    load:0x3fff001c,len:1100
    load:0x40078000,len:9232
    load:0x40080400,len:6412
    entry 0x400806a8
    Camera init failed with error 0x20004

    Reply
  53. Hi Sara Santos. In a comment from may you mention that you have tried taking photos and saving them to the SD card, but failed. I managed to do this. Do you want me to dig out the code and show it to you?
    I also managed to take photos when an “intruder” is detected from a sensor. The only problem with that is that I did not manage to connect the sensor directly to the camera module. I had to use an auxiliary Arduino board with the sensor, and make it then send a command to the ESP32 module to make it take a picture. I am pretty sure there are much better ways of doing this, ideally without needing an arduino board.

    Reply
  54. Hi all.
    On a DIYMore Esp32-cam all I get from Arduino is
    board esp32 (platform esp32 package esp32) is unknown
    I installed the Esp32 addon, and tryed all the Esp32 boards on Arduino with the same result.
    I am missing something, I am sure..

    Thanks!!!!

    Reply
    • Hi Federico.
      I’ve never faced that issue.
      I’ve found this discussion: github.com/espressif/arduino-esp32/issues/2388
      See if some of the suggestions can help with your issue.
      Regards,
      Sara

      Reply
  55. Hi All,
    Nice Tutorial !!! Have not seen this issue posted anywhere. So here Goes:
    Followed tutorial, all worked perfectly until ESP32-Cam was removed from power. Then it acted like it had never been Flashed when power was restored. Even tried RST button, nothing shows up in the Serial Monitor. Can set back up to Flash and all goes well (all works) until power is removed then restored, again acts like it had never been Flashed. Bought 2 of these and both act the exact same way. Any help would be great. Thank You in Advance !!!
    CharlieBob

    Reply
  56. Hi Sara

    I connect esp32 cam with Lora but it cann’t be initiatized.
    It seems that deinit(); of the esp32_cam doesn’t work as commented in esp32_camera.h. Please kindly suggest how to coexist cam and lora on this esp32_cam module.

    Many thanks, PP

    Reply
    • Hi PP.
      Most of the GPIOs exposed on the ESP32-CAM are either being used by the camera or by the microSD card.
      So, it will be very difficult to interface a LoRa module with this board.
      Regards,
      Sara

      Reply
  57. Hi,
    Where i should buy this product? I am living in Denmark. I could not find suppliers for this product in my contry.
    Kind regards
    Salam

    Reply
  58. i can’t run esp32cam, i tried to define all modules and nothing, help. My module has nothing written on the board, what manufacturer it is, how to detect what module it is

    Reply
    • Hi.
      That should light up the flash. Have you defined the pin as an output?

      pinMode(4, OUTPUT);
      digitalWrite(4, HIGH);

      Regards,
      Sara

      Reply
  59. Arduino IDE 1.8.10
    The hardware (ESP, USB serial etc.) is the same as yours.
    Linux Mint (Xfce)
    I followed each and every step and this is what I get:

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

    Traceback (most recent call last):
    File “/home/swift/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py”, line 37, in
    import serial
    ImportError: No module named serial
    Multiple libraries were found for “WiFi.h”
    Used: /home/swift/.arduino15/packages/esp32/hardware/esp32/1.0.3/libraries/WiFi
    Not used: /opt/arduino-1.8.10/libraries/WiFi
    exit status 1
    Error compiling for board ESP32 Wrover Module.

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

    Reply
  60. I’ve installed “pyserial” and I don’t get the error “No module named serial” but I get this:

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

    Sketch uses 2097154 bytes (66%) of program storage space. Maximum is 3145728 bytes.
    Global variables use 53516 bytes (16%) of dynamic memory, leaving 274164 bytes for local variables. Maximum is 327680 bytes.
    esptool.py v2.6
    Traceback (most recent call last):
    File “/home/swift/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py”, line 2959, in
    _main()
    File “/home/swift/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py”, line 2952, in _main
    main()
    File “/home/swift/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py”, line 2652, in main
    esp = chip_class(each_port, initial_baud, args.trace)
    File “/home/swift/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py”, line 222, in __init__
    Serial port /dev/ttyUSB0
    self._port = serial.serial_for_url(port)
    File “/home/swift/.local/lib/python2.7/site-packages/serial/__init__.py”, line 88, in serial_for_url
    instance.open()
    File “/home/swift/.local/lib/python2.7/site-packages/serial/serialposix.py”, line 268, in open
    raise SerialException(msg.errno, “could not open port {}: {}”.format(self._port, msg))
    serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: ‘/dev/ttyUSB0’
    An error occurred while uploading the sketch

    When I run python -m serial.tools.list_ports in terminal I get this:
    /dev/ttyUSB0
    1 ports found

    Reply
  61. The dl_lib.h is related to the face recognition capabilities 2 (esp-face), and it was removed in version 1.0.3 of the Arduino core. That said, just comment it out and it should compile and work perfectly either if you are using the Arduino IDE. Other option is to revert to version 1.0.2 of the arduino core.

    Regards

    Reply
  62. 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
    • Raphael i added a solution over in https://randomnerdtutorials.com/esp32-cam-troubleshooting-guide, but here it is in case you dont see it…

      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
  63. hello Sara and Rui ….
    i m finished this beautiful project.Everything working well but when i forwarding port and conect camera via internet,GET STLL working but VIDEO STREAM not ,maybe you know whats the problem ???
    thanks in advance ,73 de 9a3xz Mikele Croatia

    Reply
    • Hi Mikele.
      I don’t know what can be the problem.
      In this example, video streaming only works on one client at a time. This means that if you have the web server opened in another tab, it will not work. Just one tab at a time.
      Thanks for following our work.
      Regards,
      Sara

      Reply
  64. Hi again. Great turtorial again. My Hiletgo ESP32-Cam runs as a Ai-thinker. Noticed the image is mirror image (reversed right to left). Module design should have had the reset button on the camera’s side or a reset pin available. so it can work in a breadboard.

    Reply
  65. Hi Sara,
    I am getting below error, please help…!

    Sketch uses 2100647 bytes (66%) of program storage space. Maximum is 3145728 bytes.
    Global variables use 53552 bytes (16%) of dynamic memory, leaving 274128 bytes for local variables. Maximum is 327680 bytes.
    esptool.py v2.6
    Serial port COM12
    Connecting….
    Chip is ESP32D0WDQ5 (revision 1)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
    MAC: 24:6f:28:46:97:64
    Uploading stub…
    Running stub…
    Stub running…
    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 5041.2 kbit/s)…

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

    Reply
  66. Just received my ESP32-CAM Ai-Thinker board. Everything works fine except no ‘Toggle settings’ pane on the webpage. Perhaps I received a hacked firmware in mine or did I do something wrong?

    I’ve backed up the firmware with esptool. Does anyone have a .bin file from a board that shows the toggle settings pane?

    Thanks Rui and Sara for your work.

    Reply
  67. 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

    [E][sccb.c:154] SCCB_Write(): SCCB_Write Failed addr:0x30, reg:0xff, data:0x01, ret:263
    [E][sccb.c:154] SCCB_Write(): SCCB_Write Failed addr:0x30, reg:0x12, data:0x80, ret:263
    [E][sccb.c:119] SCCB_Read(): SCCB_Read Failed addr:0x30, reg:0x0a, data:0x00, ret:263
    [E][sccb.c:119] SCCB_Read(): SCCB_Read Failed addr:0x30, reg:0x0b, data:0x00, ret:263
    [E][camera.c:1049] camera_probe(): Detected camera not supported.
    [E][camera.c:1249] esp_camera_init(): Camera probe failed with error 0x20004

    I get this error, any solution?

    Reply
    • Hi.
      The 0x2004 error means the camera is not supported.
      On your camera ribbon, which label do you have? Ours is LA AF2569 0927XA
      What label do you have in your camera model?
      Regards,
      Sara

      Reply
      • Hi Sara,
        I have two ESP32-CAM, both of then was working perfectly untill some time ago.
        Now, everytime that I upload a sketch to the modules, I get the this error message which is recurrently appearing here:

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

        I don’t know what is going on, because it happens in my two ESP32-CAM modules and they were working perfectly here in the last time I used then.

        The labels n the ribbon cable in both OV2560 cameras are:
        XRZ00D1 -V240 V2.0 1903

        Any ideas?

        Reply
    • Hi Antonio.
      It may be the Wi.Fi signal.
      Are you using the on-board antenna or an external antenna.
      If you’re using the on-board antenna, you need to be close to your router. The best way is to have an external antenna.
      Regards,
      Sara

      Reply
  68. Hi Sara,

    I cannot get the IP address.
    Here is what I am getting at 115200.
    I moved close to the router, and added an external antenna.

    Please help.

    Reply
    • I had a similar problem.
      The fact that you get occasional words suggests that the baud rate is right.
      I forget which problems that I had were solved by what, but I started out powering the module on the Vin pin and having a power line connected from the TTL and I ended up cutting all the power lines to the TTL and powering the module on the 5V pin.

      Reply
  69. Hey. Have you tried this camera as an IP cam (softcam)? With own name and IP address? I tried a sketch but I don’t get a video image but also no ip address provided via the Serial monitor. This sketch is in IDE. Do you know him?
    Greetings (old) Bert 🙂

    Reply
  70. Hello Mr Rui Santos
    Iam using in Example Arduino IDE – CameraWebServer

    Camera OV2640 – stack with high resolution
    camera resolution UXGA (1280 x 1024)
    Please select CIF or lower resolution before enabling this feature!

    then when iam try to get low resolution QVGA (320 x 240)
    face detection and face recognition done

    1. how to make camera OV2640 with high resolution using face detection and face recognition ?

    when iam opnened the web IP Adress ESP32 Cam – button get still
    then iam check on program i cant find the button is
    2. how to make button “Get Still” – save to SD Card ?

    then the code checked the image when false detected 0
    3. how to read the image then checked the image scan detected=true ?

    like this web, when camera detect (show on micro SD Card – intruder alert)

    Reply
  71. Hi, thanks for your tutorial.
    I followed all the steps above and get the ip address, but when I did it on browser it just can’t be reached.
    Whats going wrong? I have no idea whats happened.

    Reply
  72. Is it necessary to connect to the ESP32 Cam using the FTDI Programmer? I have a USB/TLS cable, meaning one side is USB, and on the other are red (VCC) , black (gnd), white (TX), and green (RX) which I use frequently to connect upload to ESP8266 w/o the FTDI programmer.

    With the ESP32 Cam I tried connecting the USB/TLS cables as follows:
    Red > VCC
    Black > Gnd
    White > U0T
    Green > U0R
    No luck yet: there’s still the issue of getting the ESP32 into bootloader mode.

    There’s the Reset button, but I’m used the the ESP32 and ESP8266 where you need two buttons

    I’ve read you can get ESP into bootloader mode by grounding certain pins.

    Overall the question is: Can I flash the the ESP32 Cam using a USB/TLS?

    Reply
    • Hi.
      The FTDI programmer we’re using has a mini-USB port. So, we just connect a mini-USB to USB cable to the FTDI programmer and then to the computer.
      Regards,
      Sara

      Reply
      • Hellow sara santos
        I have problem can you help me please that when I connected esp32 with my arduino and upload the code from arduino ide to arduino and it uploaded but when I opened the serial monitor that the IP address not appear that write camera_probe(): detected camera not supported
        esp_camera_init(): camera probe failed with error 0×20004
        So ,I can’t solved this problem can any one help me please …

        Reply
  73. Hello i have the ftdi i have the esp32-cam and females jumper wires my problem is how to i connect the ftdi programmer with my pc ?

    Reply
  74. Hi Sara,

    After uploading the file [CameraWebServer] to the ESP32-CAM board, the following message is shown on the Serial Monitor.
    After the ESP32-CAM IP address is typed on the browser, no any video. Pressing the Start Streaming button, also no video .
    I try it on Win10 & Win7 machine, same!
    I follow all your steps; AI Thinker board and ‘CAMERA_MODEL_AI_THINKER’ in the file are chosen. How to solve it ?

    message on Serial Monitor: (an SC card is inserted)
    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

    [E][sccb.c:154] SCCB_Write(): SCCB_Write Failed addr:0x30, reg:0x91, data:0xa3, ret:-1
    [E][sccb.c:154] SCCB_Write(): SCCB_Write Failed addr:0x30, reg:0xff, data:0x00, ret:263
    [E][sccb.c:154] SCCB_Write(): SCCB_Write Failed addr:0x30, reg:0xff, data:0x01, ret:-1
    .
    WiFi connected
    Starting web server on port: ’80’
    Starting stream server on port: ’81’
    Camera Ready! Use ‘http://192.168.1.110’ to connect

    Reply
  75. Hello.
    When I Verify/Compile I get this space error. I’ve not even connected my ESP32.
    Sketch uses 2053883 bytes (156%) of program storage space. Maximum is 1310720 bytes.
    Your trouble shooting mentions (for a space different error)
    Tools > Partition Scheme, select “Huge APP (3MB No OTA)“.
    but I don’t have this in Tools.
    I’m using IDE 1.8.12
    Thanks.

    Reply
  76. Thanks for the good tutorial, very helpful!

    I read that the logic level for the ESP should be 3.3 V!
    Not sure if you can fry your board with 5V logic levels.

    I had success using a FT232RL USB to TTL Serial Converter, using 5V from the side to power the ESP with cam and having the jumper set to 3.3V for the logic levels.

    Reply
    • Hi Thomas.
      You are right that you should use 3.3V with the ESP32-CAM.
      However, many of our readers had troubles when using 3.3V and those were solved when they used 5V instead.
      We didn’t have any problems when using one option or the other.
      Regards,
      Sara

      Reply
  77. Hey. Have you tried this camera as an IP cam (softcam)? With own name and IP address? I tried a sketch but I don’t get a video image but also no ip address provided via the Serial monitor. This sketch is in IDE. Do you know him?
    Greetings (old) Bert 🙂
    Its stil not working, need help.

    Reply
  78. Dear Sir
    very good work, it works for me, but the problem it is not saving recognized faces to microsd-card. Each time power on we have to start recognition again.

    To make sure there is no problem with the microsd-card or the board I try this “https://randomnerdtutorials.com/esp32-cam-take-photo-save-microsd-card/” and it works and save photos to microsd-card.
    So where is the problem ???

    Reply
  79. Hi,

    the installation went fine and when I enter the IP address (in chrome) I had video; also the integration with Home assistant went smoothly – so far so good.

    I however don’t have the “camera streaming server” with the config buttons and sliders and I can figure out how to fix that.

    Ideas / clues would be very appreciated.

    Best Regards,
    Ko (Netherlands, The Hague)

    Reply
  80. Just done with this project without any error. You people are doing great. Keep it up.
    One issue my eap32 cam is getting heated (the esp 32 side) so much, can you suggest why it’s happening. I am supplying power directly from a 12000mah power bank.

    Reply
    • Hi.
      That can happen if the ESP32-CAM is continuously streaming, specially during face detection and recognition.
      Regards,
      Sara

      Reply
  81. Hi…
    How can I use face recognition without wifi?
    I mean: I’ld like to open/close a box with ESP32-CAM and Servo…
    Maybe I’ll need sd-card of course…

    Thanks and have a nice day.

    Reply
  82. Hi, thank you very much for your tutorials. My second project has been the the esp32 camera. Just for knowing: your tip of connecting GPIO0 to GND when flashing is very important and solved my problem of “fatal error…”
    I would ask you if you have a tutorial for saving “faces” after a power loss, perhaps in your book?
    Thanks

    Reply
  83. I encountered A HORRIBLE problem and would like to share it with you folks with a solution of course 🙂

    Problem is:
    If you notice every time we have to press the RESET (RST) button to start our ESP32 CAM so that your program works…Now what if for some reason the power to ESP32 CAM board goes down? And say in 5 mins the power is back ON to the board..
    Will you go and press the RESET (RST) button over and over to get your program started ?
    How to let your ESP32 CAM board auto reload (call setup() function) when powered on without having to press the RESET (RST) button to get your code up and running.

    Answer:
    After you upload your code on the ESP32 CAM board, connect the GND wire to the GND pin  which is near the 5V pin of the board..Voila!!! This will solve your problem..
    This seems like a hardware bug linked to C15 on the ESP32 board..
    Hope this tip helps all folks…

    Reply
  84. I have had a lot of trouble programming some ESP32 cameras which are not on the list of cameras in the software.

    I found that I can program those boards if I use an Arduino, instead of the FTDI cable. Doing this I can select the AI Thinker board. I have always had time outs when trying to use the FTDI cable.

    I just wanted to mention this for anyone else who is having trouble with the programming cable method.

    Reply
  85. Hi Guys,
    I have two ESP32-CAM, both of then was working perfectly untill some time ago.
    Now, everytime that I upload a sketch to the modules, I get the this error message which is recurrently appearing here:

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

    I don’t know what is going on, because it happens in my two ESP32-CAM modules and they were working perfectly here in the last time I used then.

    The labels n the ribbon cable in both OV2560 cameras are:
    XRZ00D1 -V240 V2.0 1903

    I tested here my ESP32-CAM modules (conecting to the Wi-Fi, without initializing the camera) and they are working fine.
    I tryed many things here, including powering the ESP32-CAM with an external 5V source, but nothing worked so far.

    Is there any way to test if the camera is working (without the ESP32-CAM module)?
    Any ideas?

    Reply

    Reply
    • Hi.
      Thanks for your comment.
      Unfortunatley, at the moment, we don’t have any tutorials about the ESP32-CAM with MicroPython.
      Regards,
      Sara

      Reply
  86. Going to try this with Blynk. Can’t find ESP32 in my Arduino examples. Will try to update. I need an open GPpin Which one is open for use. Need to output HIGH and LOW. Don’t really care to store images only stream video.

    Reply
  87. Can a TFT display be connected to the ESP32 CAM to show Face Detection either instead of the web server, or both at the same time?

    Reply
  88. Could this be connected to Windows (7/10/etc)? I mean, I know that it can set the WIFI config in order to attach to any newtwork but I don’t know if it could be detected for Windows as IP Cam without problems.

    Reply
  89. Hi from Italt. I use your example and it works like a charme ut I don’t understand how the esp32 cam streams video. Do not exist an url to se video stream or to have a snapshot? the only solution is to press button from web server? that’s all? I need if possible a simple url for video strem and snapshot. Thanks so much from Italy

    Reply
  90. Hi Guys,
    I have two ESP32-CAM, both of then was working perfectly untill some time ago.
    Now, everytime that I upload a sketch to the modules, I get the this error message which is recurrently appearing here:

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

    I don’t know what is going on, because it happens in my two ESP32-CAM modules and they were working perfectly here in the last time I used then.

    The labels n the ribbon cable in both OV2560 cameras are:
    XRZ00D1 -V240 V2.0 1903

    I tested here my ESP32-CAM modules (conecting to the Wi-Fi, without initializing the camera) and they are working fine.
    I tryed many things here, including powering the ESP32-CAM with an external 5V source, but nothing worked so far.

    Is there any way to test if the camera is working (without the ESP32-CAM module)?
    This camera is making me mad..
    Any ideas?

    Reply
  91. Hi, this is cool project. Can we train the esp32cam so can detect face with mask and no mask?would be interisting if we can do with small board.

    Reply
        • Hi.
          I’m sorry, but I don’t have any links to show you.
          I’ve seen someone doing it on Instagram, I think, using an ESP32-CAM.
          However, with a quick search I couldn’t find any code. Probably, they haven’t shared the code online.
          I’m sorry that I can’t help much.
          Regards,
          Sara

          Reply
  92. When it is all programmed and you are getting the control interface page but no video feed… do not forget to turn off NOSCRIPT in your browser 🙂

    Reply
  93. Hello sara,
    nice work u done.
    I want to use same camera but in offline mode, I don’t have internet connection, can this work.

    Regards.

    Reply
  94. Have you seen the new esp32cam motherboard which is being sold on eBay very cheaply (search for esp32cam mb”?
    This is the only info. I have managed to find about it: hpcba.com/en/latest/source/DevelopmentBoard/HK-ESP32-CAM-MB.html
    It makes using the esp32cam so much easier as it functions just like any other esp32 development board with no wires, linking pins, removing power etc..
    The esp32cam does not have a reset pin and it seems the esp32cam supplied with the motherboard is a modified version where one of the GND pins has been changed to a reset when low pin despite still being labelled as GND.
    You can still use it with other esp32cam boards but you have to connect power whilst holding the program button to upload code.
    Mine will only work on slower serial upload speeds and the wifi signal is very poor whilst on the mother board (I am guessing this is why many of the suppliers offer the external antenna option) but well worth a look especially for first time users especially for the price.

    Reply
  95. Hello,
    I have followed this tutorial multiple times using two separate board sets, but I continue to receive this message in the Serial Monitor window when pressing the RST button .

    rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
    waiting for download

    The compilation and uploading process appears to be successful;

    Sketch uses 2100647 bytes (66%) of program storage space. Maximum is 3145728 bytes.
    Global variables use 53552 bytes (16%) of dynamic memory, leaving 274128 bytes for local variables. Maximum is 327680 bytes.
    esptool.py v2.6
    Serial port COM4
    Connecting….
    Chip is ESP32D0WDQ6 (revision 1)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
    MAC: 10:52:1c:5d:94:4c
    Uploading stub…
    Running stub…
    Stub running…
    Changing baud rate to 460800
    Changed.
    Configuring flash size…
    Auto-detected Flash size: 4MB
    Compressed 8192 bytes to 47…
    Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4369.0 kbit/s)…
    Hash of data verified.
    Compressed 17392 bytes to 11186…
    Wrote 17392 bytes (11186 compressed) at 0x00001000 in 0.3 seconds (effective 515.3 kbit/s)…
    Hash of data verified.
    Compressed 2100768 bytes to 1661717…
    Wrote 2100768 bytes (1661717 compressed) at 0x00010000 in 39.8 seconds (effective 422.1 kbit/s)…
    Hash of data verified.
    Compressed 3072 bytes to 119…
    Wrote 3072 bytes (119 compressed) at 0x00008000 in 0.0 seconds (effective 1536.0 kbit/s)…
    Hash of data verified.

    Leaving…
    Hard resetting via RTS pin…

    Hopefully the problem is glaringly obvious and simple to correct!

    Your help would be much appreciated.

    Reply
  96. compiles and loads, however when it attempts to start the following message appears;

    “Invalid library found in C:\Users\Bruce\Documents\Arduino\hardware\espressif\esp32\libraries\AzureIoT: no headers files (.h) found in C:\Users\Bruce\Documents\Arduino\hardware\espressif\esp32\libraries\AzureIoT”

    Sure enough, the AzureIoT folder is empty.

    Your thoughts?

    Reply
  97. Hi!
    I can’t find the FTDI programmer part in my country. Can i replace that part with arduino uno for example, or with something else?
    Thanks for answering!

    Reply
  98. hello,
    very tempted by this device, I bought 3 ESP32-CAM
    set up on my wifi on which I already have standard webcams.
    The installation works, I get many images of a very honorable quality.
    The problem is that the ESP32 heat up a lot and stop. So I can’t use them as 24/7 surveillance devices.
    I tried to lower the resolution from SXGA, to XGA, then SVGA but it’s not satisfactory.

    Am I the only one with this type of problem? Is there any way to stop these overheats?
    Thank you for your feedback.

    Reply
  99. Running Arduino 1.8.12 on Windows and I don’t see what you specify below

    CameraWebServer Example Code

    In your Arduino IDE, go to File > Examples > ESP32 > Camera and open the CameraWebServer example

    Reply
  100. Olá
    Tenho uma camara Ov2640 a funcionar num ESP32-CAM-MB
    Tentei substituir por uma camara ov5640, pois tem mais definição.
    Obtive erro: camara não compatível.
    Há maneira de instar a camara ov5640 num ESP32-CAM-MB?

    Reply
  101. If anyone is having issues with the esp-32 CAM not coming out of sleep mode you have to change the 10K out for a smaller resistor size.

    There are some errors not talked about though that I don’t know how to fix like Timeout waiting for VSYNC happens randomly which requires turning the whole system off and on.

    Also one time my SD card was corrupted and I had to reformat it losing all the photos. Lastly the photos sometimes don’t come out right, like only the top of the photo comes in or the entire photo is unviewable. I think this issue may be caused by the camera going into sleep mode before the picture is done being taken though, so maybe increasing the delay time will fix it.

    Reply
  102. Hi,
    ESP32-Cam is wonderful. It can be programmed with FTDI programmers of several kinds, however if I use an Arduino as a programmer (Tx to Tx and Rx to Rx) I have the following problem:
    With Arduino Duemilanove (FTDI driver) it works,
    Arduino Uno (CH340 driver) does not charge – does not communicate.
    I mention that:
    – ESP power supply is at 5V,
    – In series with Tx and Rx I put 1K resistors due to the voltage difference (3.3 – 5V) on the terminals.
    Does anyone have any idea.
    Thanks!

    Reply
  103. good day
    I apologize for using the English language compiler. In any such manual there is the use of an SD card and I ask how to do it without an SD card? Thank you

    Reply
    • Hi.
      I’m sorry, but I’m not sure that I understood your question.
      This example works without the SD card. You don’t need to insert an SD card to make it work.
      Regards,
      Sara

      Reply
  104. Hi
    everythings good but my program in serial monitor stops here itself

    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:2
    load:0x3fff0018,len:4
    load:0x3fff001c,len:1100
    load:0x40078000,len:10088
    load:0x40080400,len:6392
    entry 0x400806a4

    After this nothing appears neither the connection status nor the ip address

    Reply
  105. Hi!

    Video Streaming works fine for me, but Face Recognition and Detection don’t work.

    When I click the ‘Face Recognition’ button, the video freezes. The ESP32 crashes and reboots, according to the serial monitor error message:

    No Match Found

    CORRUPT HEAP: Bad head at 0x3ffe29ec. Expected 0xabba1234 got 0x00000008

    abort() was called at PC 0x400889a1 on core 1

    ELF file SHA256: 0000000000000000

    Backtrace: 0x4008df7c:0x3ffe1bc0 0x4008e1f5:0x3ffe1be0 0x400889a1:0x3ffe1c00 0x40088acd:0x3ffe1c30 0x400d9eaf:0x3ffe1c50 0x400d6141:0x3ffe1f10 0x400d60d0:0x3ffe1f60 0x40093521:0x3ffe1f90 0x400890e2:0x3ffe1fb0 0x40088899:0x3ffe1fd0 0x4000bec7:0x3ffe1ff0 0x400d1df9:0x3ffe2010 0x40108619:0x3ffe21c0 0x40108d21:0x3ffe21f0 0x40108dd9:0x3ffe2280 0x401091ac:0x3ffe22a0 0x40107898:0x3ffe22c0 0x401078ef:0x3ffe2300 0x4008fe76:0x3ffe2320

    Rebooting…
    ets Jun 8 2016 00:22:57

    rst:0xc (SW_CPU_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:10944
    load:0x40080400,len:6388
    entry 0x400806b4

    .
    WiFi connected
    Starting web server on port: ’80’
    Starting stream server on port: ’81’

    Do you have any suggestions to get it working? Thanks in advance!

    Reply
      • Hi.
        What’s the board that you’re using?
        Does your board have PSRAM?
        What’s your ESP32 boards version installed in your Arduino IDE?
        Regards,
        Sara

        Reply
        • I use the ESP32-CAM Module with OV2640 Camera. For me, the problem was solved by downgrading the ESP32 Library version from 1.0.5 to 1.0.4.

          No idea why face recognition doesn’t work in 1.0.5.

          Reply
          • The error causes by the codes as shown below.
            static esp_err_t capture_handler() {}
            static esp_err_t stream_handler() {}

            free(net_boxes->score);
            free(net_boxes->box);
            free(net_boxes->landmark);
            free(net_boxes);

            Please find out the codes and modify as shown below.

            /*
            free(net_boxes->score);
            free(net_boxes->box);
            free(net_boxes->landmark);
            free(net_boxes);
            */
            net_boxes = NULL;

            I modified the codes and face recognition worked well in 1.0.6.

  106. You mention that the board supports both the OV2640 and the OV7670 cameras, but it appears that the software example you used here does not support the OV7670.

    Do you know of a software example for this board that uses the OV75670?

    Reply
  107. Dont forget to turn off “Enable Client Isolation” in your access point / wireless router setting. If u checklist / enable those settings, your acess point won’t let you access another IP in your network

    Reply
  108. 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(5, ‘Access is denied.’)
    Failed to execute script esptool
    the selected serial port Failed to execute script esptool
    does not exist or your board is not connected

    Reply
  109. Hi,
    face detection and face recognition dont work. Should we have SD card inserted when we do face recognition?
    Do you have an example of complete code for face detection and recognition?

    Ty!!

    Reply
    • Hi.
      You need to use the ESP32 Boards add-on version 1.0.4. It doesn’t work with earlier versions. At least, at the moment.
      Regards,
      Sara

      Reply
  110. Hi,

    I might have found another issue with this.

    Here is the output of my Arduino. Not sure why this is happening.

    BTW, the instead on using the ground pin next to UOT pin, I.m using the ground pin next to the 5V pin instead,

    Arduino: 1.8.15 (Mac OS X), Board: “AI Thinker ESP32-CAM, 240MHz (WiFi/BT), QIO, 80MHz”

    Sketch uses 2594390 bytes (82%) of program storage space. Maximum is 3145728 bytes.
    Global variables use 56256 bytes (17%) of dynamic memory, leaving 271424 bytes for local variables. Maximum is 327680 bytes.
    esptool.py v3.0-dev
    Serial port /dev/cu.usbserial-1410
    Connecting……..__
    Chip is ESP32-D0WDQ6 (revision 1)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
    WARNING: Detected crystal freq 41.47MHz is quite different to normalized freq 40MHz. Unsupported crystal in use?
    Crystal is 40MHz
    MAC: 9c:9c:1f:ea:5d:d0
    Uploading stub…
    Running stub…
    Stub running…
    Changing baud rate to 460800
    Changed.
    Configuring flash size…

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

    couldn’t find what baud rate works unfortunately

    Any ideas or anybody is having the same issue?

    Regards
    Azrin

    Reply
  111. Thank you for this tutorial! I bought a pair of ESP32-CAM from the same vendor. Packing says DFROBOT. Chip says ATHINKER, so I used ATHINKER successfully. Following the steps on “Getting started with the ESP32-CAM” I finally got 1 to work, one to kind of work.
    Couple of troubleshooting tips:
    1) Putting the jumper in the 5V position and connecting to the 5V pin allowed me to load the sketch
    2) If, after loading your sketch, removing the programming jumper, reattaching the USB cable, the initialization just ends with an endless line of “………” every few seconds, your SSID or password is wrong. SSID is case sensitive.
    My problem:
    I have 2 ATHINKER ESP32-CAMs. My first one will not stream, but will take a still shot. When streaming it shows a small blank square with a broken icon. The second one will stream just fine. Same sketch, wiring, computer, cable. Any ideas why?

    Reply
  112. Hi,
    Would you happen to have a tutorial on how to send data or commands from the ESP32-Cam to a Nano? I have a pan/tilt setup that controls two servos with an ESP32-Cam and I would like the Nano to control the servos instead by getting commands from the ESP32-Cam object detection to move the servos. Is this possible?
    Thanks.

    Reply
  113. Hey hi thr,
    I am new too ESP-32 cam. I have been following your tutorials and those are really amazing. I did study both your codes and driver architect. Now i wonder esp_camera_fb_get(); how to use this function to read the exact frame rate (fps) or just give me an brief idea to read the frame rate (fps) of the ESP32-Cam with (ov264 module). I have a necessity of Video analysis and Photo analysis.

    Reply
  114. Hi there,
    Can u tell how to read the frame rate (fps) of the ESP32-cam module. I am using one ov264 cam ( AI Thinker CAM ).

    Reply
  115. hello Santos,

    please add to troubleshooting, if use ESP-CAM-MB with ESP32-CAM, ESP.getPsramSize() report 0 PSRAM and stream is incredibly slow.

    MJPG: 3972B 8169ms (0.1fps), AVG: 4106ms (0.2fps)

    Reply
  116. Hi,

    Thank you so much for all your efforts!

    I have bought several ESP32-CAMS and when I load (the same) CamWebServer_Example sketch all works well on each but some show the image in portrait mode and others in landscape.

    Why is this happening with the same code and configuration? Are the boards different in some way or is the camera module itself wired up differently?

    I would like all to operate in landscape mode – is there any way to make this happen or are these boards permanently different and how can I tell which one I’m buying?

    Thank you for any help you can give me – it would be much appreciated.

    Reply
  117. Hello,
    Thanks for this project, I have the camera up and running! I do have a question about integrating it with Home Assistant. I tried adding the picture card in my ui-lovelace.yaml file but the stream is not coming up.

    Here’s what I have:
    – icon: mdi:cctv
    title: Cameras
    cards:
    – type: picture
    tap_action:
    action: none
    hold_action:
    action: none
    image: ‘http://192.168.1.140/’

    Reply
    • Hi.
      The stream is only accessible to one client at a time.
      Close any other clients that may be connected to the ESP32-CAM video streaming.
      Regards,
      Sara

      Reply
  118. Hello, I’m thinking in a new project.
    I want to build a time lapse camera long term to record my house building.
    I think that programming the work hours and take any photos for a day.
    I want no attending camera or battery and catch the camera passing 8/9months.
    I read in the forum maybe don’t Support 32gb SD card… Isn’t it?.
    My project…. it’s possible?
    Thanks to all

    Reply
    • It is possible when u connect ur esp32cam with arduino board and supply the power supply like solar pannel. But not sure for long term since the esp32cam get hot when long term stream?

      Reply
  119. Hello Sara,
    I have one question to the ESP32-Cam:
    How can I rotate the picture 90 degrees? I cannot rotate the Cam in the case.

    Thanks and Merry Christmas.
    Ulli

    Reply
  120. You have written a great introduction. Thanks! Could the face recognition feature be trained to recognize a stationary logo (not a face) on a TV screen? Is there any gpio output when a face is recognized?

    Reply
  121. I’m wondering if the face recognition system could be used to recognise moods: can it tell a happy face from a grumpy one?
    I imagine that that would be easier than recognising different faces, but I have no idea how it works, so I wouldn’t know where to start.

    Reply
  122. I have got face recognition working after implementing a suggestion to download the ESP32 library to 1.04, the other suggestion to use 1.06 and edit the code did not work.

    Have you any plans to extend the tutorial to store and then load the data required for face recognition to the SD card?
    At the moment the information is lost when the board is re-powered?

    It is certainly something I will be looking into.

    Great tutorials.

    Reply
  123. I want to get rid of the text output giving info about the video produced. It comes out in the serial monitor and I want to put other info there without it being cluttered by the video info. Do you know where the code is which is producing this. I can’t see it in the camera library files.

    Reply
  124. rst:0xc (SW_CPU_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:2
    load:0x3fff0018,len:4
    load:0x3fff001c,len:1216
    ho 0 tail 12 room 4
    load:0x40078000,len:10944
    load:0x40080400,len:6360
    entry 0x400806b4

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

    Reply
  125. Hello,
    I always have the same problem, whether I compile ‘CameraWebServer’ on my Mac or my PC, I get the following error:

    CameraWebServerJB:65:12: error: ‘struct camera_config_t’ has no member named ‘fb_location’
    config.fb_location = CAMERA_FB_IN_DRAM;
    ^
    CameraWebServerJB:65:26: error: ‘CAMERA_FB_IN_DRAM’ was not declared in this scope
    config.fb_location = CAMERA_FB_IN_DRAM;

    Any idea?

    Reply
  126. Hello. I am a true newbie in this but learning a lot with you both. May you please tell me if it is possible to make this project conecting the arduino board to the ESP32-CAM Board with that same code? Thank you in advance. Regards from Lisboa, Portugal.

    Reply
  127. My camera got connected to the wifi and I got the IP address as well. The IP address cannot be reached through browser

    Reply
    • Hi Sara, i having my project using esp32cam and the dht22 on the io port 15 of the esp32cam. When it start streaming online, the dht22 on the serial monitor will failed to read the humidity and temperature data. How this happen?

      Reply
  128. Hi Sara, i having my project using esp32cam and the dht22 on the io port 15 of the esp32cam. When it start streaming online, the dht22 on the serial monitor will failed to read the humidity and temperature data. How this happen?

    Reply
  129. Hi Sara,

    I tried this “mounting” with ESP32-cam, it worked almost perfectly.
    I say this because although I followed all the steps, it does not connect to my WiFi network.
    The connection data are the correct ones (SSID and Password).
    It generates its own WiFi network with the address 192.168.4.1 to which I connected both with my phone and with my laptop.
    Am I wrong somewhere?
    In the serial monitor after reset I receive the following:
    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:2
    load:0x3fff0030,len:4
    load:0x3fff0034,len:6968
    load:0x40078000,len:13072
    ho 0 tail 12 room 4
    load:0x40080400,len:3896
    entry 0x40080688
    [0;32mI (30) boot: ESP-IDF v4.1-dirty 2nd stage bootloader[0m
    [0;32mI (30) boot: compile time 16:15:01[0m
    [0;32mI (30) boot: chip revision: 1[0m
    [0;32mI (33) boot_comm: chip revision: 1, min. bootloader chip revision: 0[0m
    [0;32mI (40) boot.esp32: SPI Speed : 40MHz[0m
    [0;32mI (45) boot.esp32: SPI Mode : DIO[0m
    [0;32mI (49) boot.esp32: SPI Flash Size : 4MB[0m
    [0;32mI (54) boot: Enabling RNG early entropy source…[0m
    [0;32mI (59) boot: Partition Table:[0m
    [0;32mI (63) boot: ## Label Usage Type ST Offset Length[0m
    [0;32mI (70) boot: 0 nvs WiFi data 01 02 00009000 00005000[0m
    [0;32mI (78) boot: 1 otadata OTA data 01 00 0000e000 00002000[0m
    [0;32mI (85) boot: 2 app0 OTA app 00 10 00010000 00300000[0m
    [0;32mI (93) boot: 3 spiffs Unknown data 01 82 00310000 000f0000[0m
    [0;32mI (100) boot: End of partition table[0m
    [0;32mI (104) boot_comm: chip revision: 1, min. application chip revision: 0[0m
    [0;32mI (112) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x1d2048 (1908808) map[0m
    [0;32mI (847) esp_image: segment 1: paddr=0x001e2070 vaddr=0x3ffbdb60 size=0x04d3c ( 19772) load[0m
    [0;32mI (856) esp_image: segment 2: paddr=0x001e6db4 vaddr=0x40080000 size=0x00400 ( 1024) load[0m
    [0;32mI (857) esp_image: segment 3: paddr=0x001e71bc vaddr=0x40080400 size=0x08e54 ( 36436) load[0m
    [0;32mI (879) esp_image: segment 4: paddr=0x001f0018 vaddr=0x400d0018 size=0x9df74 (647028) map[0m
    [0;32mI (1126) esp_image: segment 5: paddr=0x0028df94 vaddr=0x40089254 size=0x0b6a0 ( 46752) load[0m
    [0;32mI (1158) boot: Loaded app from partition at offset 0x10000[0m
    [0;32mI (1158) boot: Disabling RNG early entropy source…[0m

    SD Size: 7624MB OK
    PSRAM OK
    ESP32-CAM-MB

    Reply
  130. Hi there to all of you,
    Hi Sara,

    Nice tutorial. I made a “system” with ESP32 cam and one usb programmer, uploaded the code and surprise…. Won’t connect to my wifi network even if I gave the right credentials. It’s working on my phone and on my laptop (after I connect my laptop to the wifi network generated by esp32). That was yesterday, today at work, I realized that the ESP32 have a resident software inside and my code doesn’t upload. Why I am saying that? Simply because I forget to put IO0 to the ground. I soldered 7 pin socket 5 for USB programmer and 2 for a jumper, but I didn’t connect to ESP32…. My fault…. This evening I will make all connection “by the book” and try again. So the idea is that ESP32 have some program resident “by default”, which will be over written by us in the uploading process from Arduino IDE ..

    Reply
  131. Hi to All, This is regarding ESP32 CAM module. When upload the Camera Web Server programme to my ESP 32 CAM, always get basic adjustment menu and the picture. How to get ADVANCE SETTINGS on the menu that appearing below scan start button. .Anything to do with Version of the IDE or ESP 32 version. I tried but failed I can see In some utube demos this feature is visible. Please help to get going.
    Thanks
    Ranraj

    Reply
  132. 15:44:32.105 -> #⸮⸮
    15:44:32.105 -> ⸮⸮2⸮⸮b66⸮+>⸮3⸮2⸮⸮”c⸮⸮'{⸮⸮⸮*#⸮d’⸮⸮ 6:#⸮⸮⸮J⸮L⸮H_!L
    the output on serial monitor is this why please help me

    Reply
  133. Hi,
    there are few lines used ‘free’ like: free(net_boxes->score);
    may I know which library come out the ‘free’ variables please?
    Thanks
    Summer

    Reply
  134. Hi Sara
    Thanks for the great tutorials and projects.

    I can get the code uploaded and obtain the IP address for CameraWebServer, but when I try to connect via the browser with the IP address, there is no connection. There is no error message, just unable to connect to the CameraWebServer. After I uploaded the code, I got the following msg on the Serial monitor below, but there is no “Starting web server on port: ’80’ & Starting stream server on port: ’81’ ” msg in between, does that mean the CameraWebServer never got started and hence the no connection problem? If that is the case, what could be the source of the problem.
    “….
    WiFi connected
    Camera Ready! Use ‘http://XXX.XX.X.XXX’ to connect ”

    Thanks and Happy Thanksgiving.

    Reply
  135. Hello there,
    I can’t upload the code, and get the following error:
    Arduino: 1.8.19 (Windows 10), Board: “ESP32 Wrover Module, Huge APP (3MB No OTA/1MB SPIFFS), QIO, 80MHz, 921600, None, Disabled”

    Sketch uses 1496825 bytes (47%) of program storage space. Maximum is 3145728 bytes.

    Global variables use 71364 bytes (21%) of dynamic memory, leaving 256316 bytes for local variables. Maximum is 327680 bytes.

    esptool.py v4.2.1

    Serial port COM14

    Connecting………………………………..

    A fatal error occurred: Failed to connect to ESP32: No serial data received.

    For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html

    the selected serial port For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html

    does not exist or your board is not connected

    Reply
  136. Hello,
    I don’t know which module I should uncomment in the code, where my ESP-32S ESPRESSIF is printed on my board.
    please advise.

    Reply

Leave a Comment

Close ad

No comments:

Post a Comment