ESP 32 Camera Streaming Video Over WiFi |Getting Started With ESP 32 CAM Board

Introduction: ESP 32 Camera Streaming Video Over WiFi |Getting Started With ESP 32 CAM Board

About: I am an engineering student and i just love doing electronic (mcu's) and programming (C,C++,JAVA) based projects.

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.

Step 1: Components Required :

Step 2: Pin Configuration & Features

The smallest 802.11b/g/n Wi-Fi BT SoC moduleLow

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 cardSupports multiple sleep modes

Embedded Lwip and FreeRTOSSupports STA/AP/STA+AP operation mode

Support Smart Config/AirKiss technology

Support for serial port local and remote firmware upgrades (FOTA)

Pins used for microSD card reader:
GPIO 14: CLKGPIO 15: CMDGPIO 2: Data 0GPIO 4: Data 1 (also connected to the on-board LED)GPIO 12: Data 2GPIO 13: Data 3

Step 3: Install ESP 32 Boards in Arduino IDE

Please refer this video to add ESP32 Boards in Arduino IDE

ESP 32 Boards Link : https://dl.espressif.com/dl/package_esp32_index.json

Step 4: Code

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

OR Download the code from here :

https://electronicguru.in/wp-content/uploads/2019/...

Step 5: Schematics for Programming the Board

The ESP32-CAM doesn’t have a USB connector, so you need to use FTDI to upload code through the U0R and U0T pins (serial pins) in ESP32 CAM Board.

Please refer the schematics below

Step 6: Uploading of the Code

Before uploading the code, you need to input your wifi credentials in the following part of code:

const char* ssid = "REPLACE_WITH_YOUR_SSID";

const char* password = "REPLACE_WITH_YOUR_PASSWORD";

and make sure you select the right camera module.

As here we’re using the AI-THINKER Model so select the following So, comment all the other models and uncomment this one:

#define CAMERA_MODEL_AI_THINKER

follow these steps to upload the code : Go to Tools > Board and select ESP32 Wrover ModuleGo to Tools > Port and select the COM port the ESP32 is connected toIn Tools > Partition Scheme, select “Huge APP (3MB No OTA)“Then, click the upload button to upload the code.

Step 7: Getting IP From Serial Monitor

Remove the jumper connected between GPIO0 & GND then,

Open the Serial Monitor with the baud rate : 115200. Press the ESP32-CAM on-board Reset button and wait for the IP to appear and wait for few seconds and then hit reset again.

Step 8: Its Time to Check the Video Stream

Open your browser and make sure your PC is connected to same network as ESP32 CAM and then type the IP and click on stream button and you’ll get similar video stream.

For Detailed Info Please watch the video.

IoT Challenge

Participated in the
IoT Challenge

7 People Made This Project!

Recommendations

  • First Time Author Contest

    First Time Author Contest
  • Maps Challenge

    Maps Challenge
  • DIY Summer Camp Contest

    DIY Summer Camp Contest

23 Comments

0
doumbefritz73
doumbefritz73

Question 6 weeks ago

bonjour sil vous plaît quand jentres dans le gestionnaire de carte de arduino lesp32 ny est pas comment faire pour l'ajouter en tant que carte ?
Doumbefritz73@gmail.com

0
Rafeul
Rafeul

Question 5 months ago

Device not connecting hotspot and not providing any data on serial monitor

0
Suchitra ns
Suchitra ns

Question 6 months ago

Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0x0, SizeID=0x0), defaulting to 4MB
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4096.0 kbit/s)...
A fatal error occurred: Timed out waiting for packet header
A fatal error occurred: Timed out waiting for packet header



please help me i am getting this error

0
NaveenK200
NaveenK200

Question 6 months ago

.
WiFi connected
Starting web server on port: '80'
Starting stream server on port: '81'
Camera Ready! Use 'http://192.168.0.112' to connect


I got the IP , but when i load the url, it shows nthng, url is not working

0
d.frasier0951
d.frasier0951

7 months ago on Step 7

I've completed allthese task to the ESP32S-CAM. However,the IP address never comes up. I;ve tried everything except add a capacitor to the board. I know all about the power, wire;s ect... But what do you do when NOTHING works.... Im including a copy of the code I'm getting without any IP address ever showing up.... Please, Please, Please, help me with this, and yes everone is still having the same issue's. Something has to change....

Writing at 0x001a4000... (100 %)
Wrote 2100784 bytes (1661757 compressed) at 0x00010000 in 150.1 seconds (effective 112.0 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 119...
Writing at 0x00008000... (100 %)
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...

0
dmiba
dmiba

Question 2 years ago on Step 8

I have problem with streaming. I have tried URL: http://esp_ip:81 but there is no stream. Camera URL http://esp_ip works OK with menu. How could I stream video from esp32 camera?

0
mmorlan62
mmorlan62

Answer 8 months ago

If you look near the bottom of the app_httpd.cpp file included with the Arduino code, you will find a void startCameraServer() function. Inside that is a list of each of the URLs to view and control your ESP. It appears that http://esp_ip:81/stream will show a full-frame stream.

0
markshancock
markshancock

Answer 1 year ago

Hook the ESP-32 to USB and then open up the Arduino Serial console. The app will usual provide connection information out the serial port.

0
MattiV
MattiV

1 year ago

not working i has do manytime same what all instruction have but error alltime, Arduino: 1.8.13 (Windows 7), Board: "ESP32 Wrover Module, Huge APP (3MB No OTA), QIO, 80MHz, 921600, None"
sketch\app_httpd.cpp: In function 'esp_err_t capture_handler(httpd_req_t*)':
app_httpd.cpp:286:25: error: 'box_array_t {aka struct tag_box_list}' has no member named 'score'
free(net_boxes->score);

sketch\app_httpd.cpp: In function 'void startCameraServer()':

app_httpd.cpp:632:17: error: 'struct mtmn_config_t' has no member named 'type'

mtmn_config.type = FAST;

app_httpd.cpp:632:24: error: 'FAST' was not declared in this scope

mtmn_config.type = FAST;

app_httpd.cpp:635:17: error: 'struct mtmn_config_t' has no member named 'pyramid_times'

mtmn_config.pyramid_times = 4;

Multiple libraries were found for "WiFi.h"

Used: C:\Users\masawee\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFipois
exit status 1
'box_array_t {aka struct tag_box_list}' has no member named 'score'



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

0
benoitmorrissette
benoitmorrissette

1 year ago

It works fine on the first try, thank you. Where can i find the displayed web page (the html file) please?

0
KevinG309
KevinG309

1 year ago

The frame rate for me is really low. Have I configured the ESP32 incorrectly?
I'll check on the serial port, but at SVGA I'm only getting 1-2 frames per second.

0
firdoshdiakus26
firdoshdiakus26

Reply 1 year ago

Make sure you use a good psu 5v 2 amps and use an external antenna. This way I get between 8 and 10 frames/s on SVGA

0
cjanner
cjanner

1 year ago

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

After switch from 3.3V to 5V it worked.

0
PedroA64
PedroA64

1 year ago


What type of battery could you use with this camera and what voltage and amperage does it contain?

0
bcs111cc
bcs111cc

Question 1 year ago on Step 8

Sir! Please tell me the distance that wifi covers and still connected and support streaming on pc.

0
dr_sollo
dr_sollo

1 year ago

Hi! How to set default resolution for video (e.g. 800x600) at the start of ESP32 ?

0
doug.crawford.1253
doug.crawford.1253

1 year ago

My sketch looks good and camera is ready .. but still fighting the issue not having an IP address .. I have tried including a static IP and still have no luck .. here is a copy from my serial monitor: ANY IDEAS what I can do to solve this issue?

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:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac
WiFi connected
Starting web server on port: '80'
Starting stream server on port: '81'
Camera Ready! Use 'http://0.0.0.0' to connect

0
claudiasmith2881
claudiasmith2881

Reply 1 year ago

The following forum is explanatory and commendable.I have an issue with streaming in my Arlo pro 2 and I am unable to check the ARP tables to cross the reference Mac and the IP addresses.I have tried out the following functions https://netgears.support/arlo-security-camera/.Guide us what to do next?

0
shariq azim
shariq azim

Question 1 year ago

Can we use it without esp board? Or board is absolutely required..
Also how to connect to a local wifi network please explain?