Ai-Thinker ESP32-CAM in the Arduino IDE

camera-web-server-screen.jpg

Setting up the Ai-Thinker ESP32-CAM with the Arduino IDE Camera Web Server example.

The AI-Thinker ESP32-CAM module features an ESP32-S chip, an OV2640 camera and a microSD card slot. They have them on AliExpress here. There are other ESP32 based camera modules available that should work if the pins are set in the sketch.

If you prefer to work with your ESP32 in the Espressif IDF there’s another guide here: ESP32 Camera Module with Face Recognition

Adding or Updating the ESP32 Range in the Arduino IDE

If you’ve never used an ESP32 board in the Arduino IDE you need to follow the first part of this tutorial: ESP32 Built-in OLED Heltec WiFi Kit 32
If you already have the ESP32 boards available in your IDE then you just need to update to the latest version of the board libraries. To do this, open the Arduino IDE and in the menu: Tools > Board:xxxxx > Boards Manager:

Boards Manager

Search for ESP32:

Boards Manager ESP32

Update this to the 1.0.1 version. Face detection is broken in 1.0.2.

Connections

The ESP32-CAM doesn’t come with a USB connector so you need either a CP2102 or a FT232RL USB to TTL Serial Converter to connect it to your PC. When using WiFi the ESP32 can use more current than is supplied via USB through these devices resulting in the module crashing and rebooting. I found the top device worked fine (I bought it here) but the FT232RL didn’t work for me. If you use a FT232 with 5v and 3.3v, set the voltage jumper to 3.3v. You might be able to use the 5V from the side of the board to power the 5v pin on the camera.

USB to ESP32-CAM Wiring Diagram

 

Wire the module according to the diagram above. The green connection should be connected when flashing the module and disconnected when running.

Running the Camera Web Server Example

Plug in your module and change the board settings to these:

IDE Camera Settings

Open the Sketch by navigating  File > Examples > ESP32 > Camera > CameraWebServer:

Camera Web Server Sketch

Edit the Sketch defines to look like this (assuming you are using the Ai-Thinker module):

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

Change the following two lines to match your WiFi connection details:

const char* ssid = "NSA";
const char* password = "orange";

Click Upload to build and flash the Sketch to your device.

If you get an error that the device fails to connect. Check that the IO0 pin (green in the diagram) is connected to GND and press the reset button under the module and try again.

When the device has completed flashing, unplug IO0 from GND.

Open the serial monitor via Tools > Serial Monitor.

Press the reset button on the ESP32-CAM and watch the start up sequence in the serial monitor:

Camera Web Server Startup

Look for the IP address that the ESP32 has been given on your network.

Type that IP address into your browser. You should be able to see a GUI on the left where you can control elements of the camera, set face detection and face recognition. Click Get Still to take a photo. Click Start Stream to see a video stream from the camera.

ESP-WHO GUI

On-Board vs IPEX Antenna

A few people have commented that they have received the board with the antenna jumper set for an external antenna rather than the on-board antenna. You can see the two different settings below:

Antenna Jumper Settings on the ESP32-CAM

If you have a low frame rate or poor reception this might well be the problem. You can either move the jumper with a bit of very careful soldering or buy an IPEX WiFi antenna which will improve the signal.

ESP32-CAM Video Playlist

IF you prefer your tutorials in video format you can visit the Robot Zero One YouTube channel and view the ESP32-CAM playlist here: https://www.youtube.com/channel/UCpqVEutU_Jcq34ws4tyUReQ/playlists

Resources

Here’s a list of resources that I used to get this working:
https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Camera/CameraWebServer – Arduino Camera Web Server example
https://github.com/espressif/esp-who – Homepage for the face recognition library

120 Replies to “Ai-Thinker ESP32-CAM in the Arduino IDE”

  1. Chris Lidyard says:

    Thanks for the article. Sorted me out and have donated. Keep posting, I’m interested in your adventures with the MAIX board.

    1. WordBot says:

      That’s great thanks! The MAIX is very interesting but they have a way to go to get to where the Espressif boards are with libraries etc.

  2. who_took_my_nick says:

    Brownout detector was triggered

    ets Jun 8 2016 00:22:57

    rst:0xc (SW_CPU_RESET),boot:0x1b (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

    It is power issue, as i can see from the forums. I power it as you suggested. From the same TTL adapter i use 5V and GND and connect it to 5V and GND on the ESP32 cam board. ESP module is little bit hot. Not sure is it ok. Any idea?

    1. WordBot says:

      I found that with the FT232RL connected with a USB cable that when the wifi started up it would crash with the brown out error. The other connector I plugged straight into my PC (no cable) and this was fine. It could be your adaptor or the USB cable that can’t carry the current needed. You can connect your own supply of 5v to the board (without the 5v and ground of the connector being connected) to see if that works.

      1. Richard D Marbury says:

        i got this device to work by connecting a 1000 ufd capacitor across 5v and gnd pins to reduce brownout errors

  3. _rp_ says:

    Thanks for this…

    Any ideas on how to activate the flash light?

    rp

    1. WordBot says:

      Not yet. I’ll write a note if I find out.

      1. Piebe says:

        GPIO4 is the Flash

        1. _rp_ says:

          Thanks.
          That thing is bright…

  4. victor says:

    Do you have an example of how to save a photo to the card?

    1. WordBot says:

      Here’s a start – https://github.com/raphaelbs/esp32-cam-ai-thinker/tree/master/examples/sd_jpg but this is for the Espressif IDF. I’ve not tried it myself.

    2. WordBot says:

      This tutorial has a section for saving photos to the microSD card – https://robotzero.one/time-lapse-esp32-cameras/

  5. Richard Luckman says:

    Just in case anyone has the same problem that I had whereby the module worked fine plugged directly into the PC but as soon as I moved it to photograph the bird table just outside the window I lost connection. On my module the jumper next to the IPEX connector was set to use the IPEX connector and not the circuit board antenna. Pictures I have seen on the web show it jumpered the other way. As it happened my eventual plan was to use it with an external antenna so it saved me having to alter the jumper

    1. Tony Yeung says:

      Can you provide details of how the jumper is supposed to be configured? I can’t find the information of how to set it to IPEX versus PCB antenna.

  6. Ian Muir says:

    After booting and watching the serial monitor mine just shows dots going across the screen and nothing else.
    I am running off a seperate 5v power supply.
    any Ideas?

    1. WordBot says:

      The dots are shown while it’s trying to connect to the your wifi network. Double check your wifi settings and maybe move closer to the router.

      Also – see this comment: https://robotzero.one/esp32-cam-arduino-ide/#comment-2703

      1. Ian Muir says:

        Thanks.
        It now connects and I can log on to it with a web browser.
        There is no camera picture, the controls show but the camera picture is just black.

        1. WordBot says:

          Press f12 in the browser to open the console. Go to the network tab and then click Get Still or Start Stream on the controls do you see an error in the network tab?

          1. Ian Muir says:

            No errors, it just records a black screen. Tried 2 units both with the same results.

            1. WordBot says:

              I have another tutorial to finish this week that uses the camera in a different way. We can see if it works with this.

  7. Leszek Niedziela says:

    Thank you for the detailed explanation! Have a coffee! 🙂

    1. WordBot says:

      Appreciated! Thanks.

  8. Clavier pierre says:

    Merci pour ce tuto il fonctionne parfaitement. J’ai passé des jours à fouiller internet sans jamais réussir à faire fonctionner esp32cam encore un grand merci. Serait-il possible de connecter le module directement sur un écran tft lcd?

    1. WordBot says:

      It’s going to be difficult to connect a screen to the Ai-thinker board because nearly all the pins are used by the camera or SD-card reader http://wiki.aithinker.com/esp32-cam (scroll down).

    2. Clavier pierre says:

      Re bonjour je viens de trouver et tester ce projet intéressant :G6EJD :ESP32-and-how-to-use-ili9341-TFT-Display. (sur Github) quand pensez-vous ?peut-être que comme ça l’image de la caméra pourrais apparaître sur l’écran ?

  9. Mike says:

    Thank you very much for this, three ESP32-Cams are now working smooth within my HomeAssistant / MotionEye – wonderful 😉
    After each reconnect of the ESP32-Cam to power, i have to press this little reset button once, for connecting to the WLAN – is there a pin layout to solder a bigger button to the Cam?
    So again, thank you very much for this!!!

    1. WordBot says:

      I just tried with mine and reconnecting power (at least via USB) causes it to reconnect to the WiFi.

  10. day tripper says:

    Thanks very much for this publication, I received a pair of the esp32-cam modules yesterday and had them both running by this afternoon.

    The one question I have is if anyone has integrated control of the hella bright LED into this kit? It doesn’t appear to be “wired” into the code (though I did notice it tends to have a weak glow).

    fwiw, I strongly recommend fitting some kind of heat sink to the SOC shield (and hope there’s some thermal compound under it) as it runs pretty toasty while streaming.

    Cheers!

  11. Michael Zwicky-Ross says:

    Great tutorial. Except… I have the same problem as Ian Muir in that the ESP never connects to WiFi. I’ve checked and double checked the credentials and I’ve also flashed another sketch that I know works because I have it running on a basic ESP32. And the router is only 6 feet away. Any other ideas very welcome! Thank you

    1. WordBot says:

      Can you see how the tiny connector next the aerial socket is soldered?

      1. joe mckee says:

        Most of them come IPEX enabled , i have 10 and they are all the same – small jumper needs to be removed and soldered to internal aerial or an IPEX 2.4ghz aerial fitted

  12. Faiz Alfaizin says:

    can you help me with the problem “A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header”
    Thanks

    1. WordBot says:

      Is IO0 connected to GND? Try pressing the reset button and uploading the Sketch again.

  13. Faiz Alfaizin says:

    Can you help me.
    I have successfully uploaded a sketch and can switch to the web server. but the video played has a delay. when I put IO4 in my hand, the flash light went on and the video went smoothly without delay, could it be possible that the cable I used was wrong or was there a way for the video to run optimally without touching IO4?
    thank you

    1. WordBot says:

      Do you mean the frame-rate of the video is low? It’s possible the LED is making the scene brighter so the camera quality is improved. Try using a bright light on your subject.

      1. Faiz Alfaizin says:

        in the serial monitor “MJPG: 5173B 76ms (13.2fps), AVG: 101ms (9.9fps), 0+0+0+0=0 0”

        if i touch the IO4 pin “5173B 76ms (13.2fps)” change to be faster and read serial monitor

        does the IO4 pin affect fps?

        1. WordBot says:

          I don’t see how it could affect the fps

        2. Jim says:

          I also found that the framerate improved from around 2fps to 13fps (!) when I put my hand near the board. I then realised that (as others have found) the onboard antenna was not connected. Jumpering the onboard antenna cured the problem, and I now get a consistent good framerate 🙂

          1. WordBot says:

            Ah! Thanks for the comment. I didn’t imagine that this could be the problem!

            I looked at the cameras I have and found one was jumpered for the IPEX connector so I’ve added a bit explaining this to the tutorial.

    2. Jan says:

      Hmmm… this sounds familiar. In my setup I have the IO0 signal connected through a few cm long wire to a button going to ground. Framerate is horrible, then I read this post, noticed that when I touched all the headers with my fingers, framerate increased. So I searched for what this could be and noticed that the IO0 line isn’t for the bootloader only. Adding some extra pullups to IOo didn’t help either. Pushing the button during streaming stops it all. So I figured that the quickest way to solve this was to remove the wire to my button. Then everything worked beautifully.
      So to make a long short short, don’t have anything connected to IO0 during runtime (of the example as shown here)! According to my multimeter which doesn’t measure 0 or 3.3V it measures something in between. I wouldn’t be surprised if this is a high frequency signal (clocksignal) of some kind, that may not be disturbed by adding any kind of load. A simple wire can add like a capacitance. The funny thing is, that I cannot find a decent schematic or some document explaining what IO0 is and does during runtime.

      1. WordBot says:

        Interesting. I’ll have to try with and without wire attached.

        Schematic here: https://www.reddit.com/r/esp32/comments/b6wyjt/aithinker_esp32cam_schematic/?st=jw91hm41&sh=39f04507 I guess you saw the pins diagram: https://wiki.ai-thinker.com/esp32-cam

        If only Ai-Thinker had added a few more pins, made it dual core and fixed the reset so it didn’t need the manual reset each time it would have been a great product.

  14. Minde says:

    Thanks a lot for a great tutorial, works like a charm. However I would like to change Camera Web Server ports (originally 80 and 81) and I am unable to find how to do it… Could You help?

    1. WordBot says:

      You can change the port number in the Arduino code in the function startCameraServer but you also have to change it in the HTML that the ESP32 is serving (here: j.src = `${c+’:81′}/stream`). This HTML is found in the camera_index.h file in the index_html_gz variable. This is the page source GZIP’d and converted to HEX. I have a tutorial in the works for this.

      UPDATE: Tutorial here: https://robotzero.one/esp32-cam-custom-html/

      1. Andre says:

        Hello,
        Thank you for this thoughtful information.
        I managed to make the HTML GZIP transformation work but I can not get it working (here: j.src = `$ {c + ‘: 81’} / stream`), I have to put the code wrong .
        my new port is: 6060, the still image is playing correctly but not the video the result is still (my address; 6060; 70
        Thank you in advance for your reply.
        Automatic translation english french
        A G

        1. WordBot says:

          Hi, Did you change the line
          config.server_port += 1;

          in app_httpd.cpp to show the new port? Something like

          config.server_port 6060;

          You should then be able to see the video at http://your-ip-address:6060/stream. If that works then the j.src should work with the 81 replaced by your 6060

          1. andre says:

            Thank you for your quick reply
            I have
            config.server_port 6060;

            I get on the serial port
            WiFi connected
            Starting the web server on the port: ‘6060’
            Start the feed server on the port: ‘6061’
            Camera Prete! Address ‘http: //xxx.xxx.0.22’ Log in
            by inspecting the image (tiny) I read
            http: //xxx.xxx.0.22: 6060 / http: /192.168.0.22: 6060: 81 / stream
            I have: 6060 but more: 81
            however, the still image is correct and has the correct address
            Again thank you for taking into account my request
            AG

            1. WordBot says:

              It’s this part you need to change:

              config.server_port += 1;
              config.ctrl_port += 1;
              Serial.printf(“Starting stream server on port: ‘%d’\n”, config.server_port);

              to

              config.server_port = 6060;
              config.ctrl_port += 1;
              Serial.printf(“Starting stream server on port: ‘%d’\n”, config.server_port);

              Then test on http://192.168.0.22:6060/stream

  15. Jacques says:

    Thanks for a great tutorial, but get the same problem as Ian Muir. There is no camera picture, just the close icon and the controls.
    Can anyone help?

    1. WordBot says:

      Do you see any errors in the serial monitor or in the browser console? I have three of these and one of them came with a broken camera where there also was no image.

      1. Jacques says:

        I am seeing a pending status on the stream and image capture commands when pressed. This is under the network tab.

        1. WordBot says:

          What can you see in the Serial Monitor (Tools > Serial Monitor). Any clues there?

        2. BAMS808 says:

          I also have the same issue, can capture image, and see it in the serial and browser console, however when trying to access stream nothing shows up. all other changes can be seen in the browser console , turning off and on face recognition. make me think something might be wrong in just the streaming part of code or hardware.

          1. WordBot says:

            Most likely the hardware. The first one I bought did the same.

  16. Faiz Alfaizin says:

    can you help me for esp32-cam web socket ?

  17. Faiz Alfaizin says:

    I mean, so that the esp32-cam ip can be accessed by the internet with a public network

    1. Jim says:

      You should first change the camera ports from 80 and 81 to something higher like eg 8802 8804 as explained in a previous comment above. Then you need to set a couple of port forward entries in your router. EG if your camera IP is 192.168.1.92 then add a couple of forward entries – port 8802 > 192.168.1.92:8802 and port 8804 > 192.168.1.92:8804

      Then from the internet you should be able to access your camera by going to
      http://:8802
      Note that here is you external IP address and can be found by going to whatismyiPaddress.com Note that this address may change each time your router is rebooted.

      1. Jim says:

        Oops!- part of my text went a bit strange. It should have said;

        Then from the internet you should be able to access your camera by going to
        http://'your public IP address’:8802
        Note that ‘your public IP address’ here is your external IP address and can be found by going to whatismyiPaddress.com Note that this address may change each time your router is rebooted.

  18. Jan-Gerard says:

    _Trigger events (pin I/O) with face recognition without web-interface?_
    Great tutorial. It workded directly. Only I want to take it a step further.
    I am looking for examples or documentation of the face recognition API to trigger events (like switching I/O pins of the ESP32-CAM board). Especially without using the web-interface. I would like to only use the web interface to train the recognition, but then just power the ESP32, have it start face recognition automatically, and respond by switching a voltage on one of the IO pins.
    Is that possible? And where do I find which commands to use for that?

    1. WordBot says:

      I’ll try to work out something this week for setting a pin high when a face is detected.

      1. WordBot says:

        I’ve added a new tutorial that explains how to do this: https://robotzero.one/esp32-face-door-entry/

  19. Petrovjan says:

    Hi, I’d like to turn the web-server example into a standalone presence detector, that would send a message to IFTTT whenever it detect someone. So far I’ve managed to update the Arduino IDE example and add the IFTTT call, but I’m not able to make it run all the time, not just when someone is accessing the ESP-CAM’s website.
    Is there a simple way to change the code to make it run all the time? Thanks!

    1. WordBot says:

      I need to look at the example code and see if I can work out how to make the face detection work outside of the web-server example. Hopefully this week.

      1. WordBot says:

        I’ve worked it out and written another tutorial for face recognition. If you want face detection only it should be pretty simple to modify. https://robotzero.one/esp32-face-door-entry/

  20. O-Zone says:

    Thanks a lot for your post! However, on compiling i got an error because the sketch use 106% of available space. Any hint how to fix?

    1. WordBot says:

      Do you have the partition scheme set to ‘Huge APP’ in the tools menu?

  21. Henk says:

    Arduino say the sketch is to big for the ESP32 CAM module. 172%. What to do now?

    In Dutch:
    De schets gebruikt 2257451 bytes (172%) programma-opslagruimte. Maximum is 1310720 bytes.
    Globale variabelen gebruiken 51488 bytes (15%) van het dynamisch geheugen. Resteren 276192 bytes voor lokale variabelen. Maximum is 327680 bytes.

  22. Francis says:

    Hey! Thanks for this tutorial.

    From my understanding the HTML GetStill button tells the camera to push a jpeg to the server.

    How can I do this directly from my loop on the Esp32 ? (Eg. Just call GetStill(); in code instead of clicking the button on the webapp.

    1. WordBot says:

      Hi, Did you want to take a picture at a certain interval or as a result of some other input? It’s probably better to rewrite the code so your interval or input testing is in the loop and this then calls a function that grabs an image from the camera. You could also modify the HTML side of things to call GetStill and then do something with the resulting jpg.

      1. Francis says:

        Thanks for your reply.

        I am quite familiar with C/C++ – Not so much with html / http requests. I will be able to handle the interval at which the code is executed etc.

        Currently when the GetStill button is clicked, the image in the webapp changes to the latest screen capture. This functionality suits me and I would like to be able to do that without clicking but rather from the ESP32’s void loop. Some sensor will eventually trigger this functionality rather than a button press.

        1. WordBot says:

          I’m working on a tutorial for this.. It should be published today.

          1. Francis says:

            Awesome! Will be buying you a few more coffee’s for that! Thank you for your time.

            1. WordBot says:

              It’s taking a bit longer than I thought. It’s nearly done except

              esp_http_client_handle_t client = esp_http_client_init(&config);

              from here: https://github.com/espressif/esp-idf/blob/master/examples/protocols/esp_http_client/main/esp_http_client_example.c

              Crashes in the Arduino. I’ll look for another method to POST images.

              1. Francis says:

                No problem! Thank you so much, helping my little brother out with his arduino project. I am a C++ programmer by trade though, so maybe I can help find the source of the crash on my side; I’ll give that example code a try!

                I’m just suprised this isn’t just a series of already available functions we need to combine as the functionality seems to be there by default. In any case thanks again, more well deserved coffees for you!

                1. WordBot says:

                  If you want to look I set up a simple example – https://pastebin.com/ixwVaSG7 crashes at esp_http_client_init
                  Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.

                  1. WordBot says:

                    Finally I have POST working in this example – https://robotzero.one/time-lapse-esp32-cameras/ They’ll be a version later where the image capture is triggered rather than timed.

  23. Kingtech says:

    Hi, I read all post but nobody seems to have a camera error. Maybe my camera is defective.
    Someone solved this kind of issues?

    1. WordBot says:

      IF you see a camera error in the serial monitor it could be defective. Have you tried removing it and replacing it? It could also be a power issue. What error message do you see?

      1. Kingtech says:

        Yes i try to removing and replacing it.
        Here the error message:
        12:49:38.464 -> ets Jun 8 2016 00:22:57
        12:49:38.464 ->
        12:49:38.464 -> rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
        12:49:38.464 -> configsip: 0, SPIWP:0xee
        12:49:38.464 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
        12:49:38.464 -> mode:DIO, clock div:1
        12:49:38.464 -> load:0x3fff0018,len:4
        12:49:38.464 -> load:0x3fff001c,len:1100
        12:49:38.464 -> load:0x40078000,len:10088
        12:49:38.464 -> load:0x40080400,len:6380
        12:49:38.464 -> entry 0x400806a4
        12:49:40.467 ->
        12:49:40.670 -> [E][camera.c:1085] esp_camera_init(): Camera probe failed with error 0x20001
        12:49:40.670 -> Camera init failed with error 0x20001

        I do somes research it seem that others than me have this kind of issue

  24. FotoAmg says:

    Hi!
    I am keep on finding the same basic example for this esp/cam combo, and did not find other kind of examples.
    Do you have them or can you give me suggestions how to achieve?
    I plan to use 2 modules as want to create Stereo 3D (left-right camera side by side) pictures.
    For this I need the 2 unit’s still capture to be synchronized.

    Easy option would be to make a separate outer frame html and with some trick trigger both from UI side but not sure how good shouzld it work as it would be cross domain due to different IP.

    I want to use my mobile phone as preview and control to start video capture. Can these modules be connected to an android mobile phone wifi without wifi network, and can 2 device connected at the same time?
    Many questions…
    or Other solution would be to connect the 2 modules as there are som free pins as I see and one module would be a slave checking the high/low state on an inut PIN to trigger photo capture…..

    It is ok for me it pictures are stored in a microSD as this module has microSD slot too.
    Did not find any examples to handle saving to microSD…

    Also other step would be to reach the recorded left and right pictures, for this I would need to host the microSD image older content of each module in the web server and can merge the image pairs side by side later, maybe by the webapp.

    Thanks for the advices!

    1. WordBot says:

      Hi,
      I’m pretty sure you can’t use the pins to trigger if you want to use the SD card as well. You can probably trigger on pins and POST the image (just got POSTing images working). Probably the best solution is use JavaScript to put two camera srcs on one page and grab images simultaneously when you press a button. How many pictures do you need to capture? This weekend I should have tutorials posted for writing to SD cards, POSTing images and triggering captures.

      You should be able to set up the phone as a hotspot and connect both devices. One will host the page with the two streams.

  25. Frank says:

    Hi,
    i’ve got a problem with bad MJPG quality.
    It produce random horizontal lines in different colors which are jumping around.
    Only Still-Pictures are free of this lines and looking good.
    I’ve tried to change the VCC down to 3.3V, add capacitor to the VCC, also tried to change the pixelclk, but nothing helps.

    btw. my board doesn’t work at 5V. Max is 4.7Volts. Anything above let it crash or it wont boot.

    thanks for help
    Frank

    1. WordBot says:

      Hi. I’m not sure but I think it’s just poor build quality on some of the cameras. Maybe poor voltage regulation on the board itself.

  26. Evans says:

    my ESP32 cam has that resistor connected to a an external antenna, so i connected it to an external resistor, still no ip adress on my serial monitor, just endless dots, what could be the problem?

    1. WordBot says:

      Can you try one of the example Sketches that use WiFi and see if the problem persists?

  27. Rod says:

    Hello – I’m just trying to add this camera into MotionEye. Can you offer a brief explanation?

  28. Svein says:

    Help, I do not have File->Examples->ESP32->Camera ? I use Arduino v.1.8.9
    Did I need to change to v. 1.8.7 ????

    1. WordBot says:

      Can you see File>Examples>ESP32? Maybe you need to update the boards? https://robotzero.one/wp-content/uploads/2019/01/boards-manager.jpg

  29. Svein says:

    Yes I see:ESP32->AnalogOut, ChipID, DeepSleep,ESPNow
    But no Camera.

        1. WordBot says:

          How strange! Not sure if it will appear in the menu but you can try copying the files from here https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples into C:\Users\**yourusername**\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.2\libraries\ESP32\examples. If not you can just add the files into your Arduino folder as another sketch and use it like that.

        2. WordBot says:

          Looks like the face detection isn’t working on 1.0.2 at the moment.

  30. Steve says:

    Thanks for a great article.
    Just a comment on using FTDI board. You need to leave link for power in 3v3 position, ( to drive ESP32 safely) and the connect 5V as shown for power. You may damage driving Tx at 5v from other units, maybe put a couple hundred ohm resistor in series.
    I struggle in my workshop to get it working (modded aerial !! Thanks) as signal a bit weak from router. What needs changing to make it work as a wireless access point so can be used anywhere?
    Stevewidg

  31. WordBot says:

    Thanks for the comment. I’ve updated the article. I’ll try to make another tutorial for connecting in AP mode. It’s not difficult.

  32. Steve says:

    Thanks Wordbot,
    Actually FTDI is even easier. With USB to top, link from center pin to right for 3v3, and the left pin is 5v. The center pin goes to VCCIO ( the in/out voltage on chip) and to the bottom VCC pin, so that it will only drive a safe 3v3 to ESP 32.
    That would be really terrific if you could do access point. Im not interested in face recognition, but would really like to do some VERY siimple computer vision, by manipulating an array, and modifying pixels, say invering colour for example. Also like to be able to draw a cursor and get position from web app.Thinkthis is done with GFX functioon,
    Coffee on its way, enjoy while its hot!! Beer+ available with above tutorial!!
    Steve

  33. Florian says:

    I’m having huge problems with heap errors when using face detection or recognition.

    like this one:
    MJPG: 7361B 246ms (4.1fps), AVG: 412ms (2.4fps), 133+93+0+0=227 0
    CORRUPT HEAP: Bad tail at 0x3ffdfbfc. Expected 0xbaad5678 got 0x00000000
    assertion “head != NULL” failed: file “/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/heap/multi_heap_poisoning.c”, line 214, function: multi_heap_free
    abort() was called at PC 0x400dcb93 on core 1

    Backtrace: 0x40091b44:0x3ffdc760 0x40091d75:0x3ffdc780 0x400dcb93:0x3ffdc7a0 0x400917b9:0x3ffdc7d0 0x4008840a:0x3ffdc7f0 0x400899b5:0x3ffdc810 0x4000bec7:0x3ffdc830 0x400e424a:0x3ffdc850 0x400d2da7:0x3ffdc8d0 0x4012a995:0x3ffdca80 0x40129be9:0x3ffdcab0 0x40129cc5:0x3ffdcb40 0x4012a0d0:0x3ffdcb60 0x40129206:0x3ffdcb80 0x40129258:0x3ffdcbc0 0x4008dae1:0x3ffdcbe0

    any ideas?

    1. WordBot says:

      I was seeing this the other day but I don’t remember what I was doing when I saw the errors. What board version do you have? https://robotzero.one/wp-content/uploads/2019/01/boards-manager-esp32.jpg

    2. AnttiDuino says:

      I got this kind of a message when I simply ran out of memory.

  34. AnttiDuino says:

    Great article and great piece of software. But I have one problem: when I call cmd_handler using

    view.src = `${baseHost}/control?var=abc&val=2`

    the parameters are passed ok, but at the same time the video-stream is closed. Any ideas how to do call cmd_handler without closing the stream.

    Have a nice coffee!

    1. WordBot says:

      Thanks for the coffee! I guess the command you are sending (ie res = s->set_saturation(s, val);) is crashing the camera.

  35. FELIPE MESSIAS MASCATE says:

    Congratulations on the tutorial worked perfectly here, I would like to implement login and password on the web page that configures the camera, would you have any idea?

    1. WordBot says:

      It’s going to be a bit tricky but you could modify the static esp_err_t index_handler(httpd_req_t *req){ function which loads the main web page to look for a password in the request. The stream URL will still be available to anyone who knows it though.

      1. FELIPE MESSIAS MASCATE says:

        I was able to implement an efficient login and password in my main page of the camera following your html modification tutorial, thank you, if you wish I can share the solution here

        1. WordBot says:

          That would be great to share it! Maybe put it on Pastebin so the formatting is kept?

        2. Maurizio says:

          I need this feature, please write the solution.

  36. Pinou Gaston says:

    bonjour,
    ça fonctionne .
    mon problème est que quand j ‘appelle l’adresse ip , j ‘ai l’image mais je n’ai pas la bande de setting sur le coté avec les réglages.
    Comment faut il faire ?
    Cordialement.

    1. WordBot says:

      Hi, That’s bit odd. If you go the IP address (something like http://123.123.123.123) you should only see the settings on the left and nothing else. You only see the image when you press one of the buttons.

  37. Wild_Cake says:

    Hi!
    I have a toruble:
    “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

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

    I tried connect external power (5V, 2+A) – same errors…((

    1. WordBot says:

      This sounds like the wrong camera has been chosen. You sure you have this #define CAMERA_MODEL_AI_THINKER without the double forward slash commenting?

  38. John says:

    Thanks for the tutorial on the esp32-cam.
    I sent you a large cup of coffee. 🙂

    1. WordBot says:

      That’s great. Big coffee appreciated!

  39. Stuart Megson says:

    Hi. Can you please help. I have 2 x ESP32-cam. But face detection is not working on both.
    I have Resolution set to QVGA, Start Stream is on, Face Detection is on. But no box around any face for picture.
    I am able to Get Still picture.
    I an unable to find any solution to this problem.

    1. WordBot says:

      Hi, Are you using 1.0.1 of the boards library? 1.0.2 doesn’t work properly – https://robotzero.one/wp-content/uploads/2019/01/boards-manager-esp32.jpg

  40. Stuart Megson says:

    Hi. I have version 1.0.3-rc1 installed.
    Thanks for the reply.

    1. WordBot says:

      Pretty sure it’s broken in that version as well. Some of the other tutorials on the site only work with the latest version though.

  41. Stuart Megson says:

    O.K Thanks, will try it with the later version.
    Thanks for the info.

  42. Saepul Hidayatuloh says:

    this is mh probelm. I use esp32 cam. it shows in serial monitor :

    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

    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

    any solutions?
    thanks

    1. WordBot says:

      Sounds like either the wrong camera is selected or there’s a hardware problem with the camera.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

scroll to top