Please enable JavaScript to view this site.

Waijung 2 User Guide

Navigation: ESP32 target > Tutorials > ESP32-CAM

Project 0: ESP32 IP Camera

Scroll Prev Top Next More

In this example, we’re going to create a web server to display videos or photos in a web browser. Anyone who has access to the server can view the camera feed online.

 

Required hardware:

ESP32 board with a camera, Here I'm using ESP32_camera board

USB to TTL converter (To upload code)

5 female to female pin headers (To connect TTL converter to the board)

Power source if needed.

How to use waijung camera block

camera_project_0_1

Select Stream Mode to "Stream as IP camera (JPEG output)" and then select the Camera Module. If the user cannot find the Camera Module, select Custom Camera and enter the pins correctly. Pin configuration can be found in the user manual of the board.

 

More settings about the video/image.

camera_project_0_2

Note: When the video resolution/quality is increased, lag will be increased simultaneously.

This block required a WIFI setup block first. Wifi can be configured in AP mode or STA mode. Both of these modes can be used with the camera block. For a beginner, I would suggest to use AP mode which is easier to configure the settings.

 

AP mode

camera_project_0_3

In the AP mode, esp32 will create its own wifi network. There, the user has to input SSID and Password to connect any device to the network. Under the wifi setup block configurations, users can specify the streaming IP address in the text field marked by the blue color box.

camera_project_0_4

For example, this will transmit the still image to http://192.168.0.1/capture. Video will be streamed by http://192.168.0.1:81/stream web address. Users can view it from any web browser. Make sure all devices are connected to the same network.

 

STA mode

camera_project_0_5

In STA (station) mode, user requires an external network connection to connect to esp32. Under the Wifi setup block, select the correct mode to proceed. In this mode, esp32 will be connected to another host network and the IP of the esp32 can be monitored in the serial monitor when it established the connection. The blue-colored box in the following picture shows where the IP can be found for the user.

camera_project_0_6

Same as the AP mode, this can also get the videos and still images from the web browser by the link below.

http://(esp32 ip address)/capture

http://(esp32 ip address):81/stream

 

How to prepare the board to upload the code.

ESP32-CAM board does not have any USB port to upload the code. There we have to use a USB to TTL converter. The picture below shows, how to prepare the board for the code upload. Once the TTL converter is connected to the computer, make sure to press the reset button. Then the board will initiate the download mode.

camera_project_0_7

Upload to the ESP32-CAM board

Users can upload the code. If users cannot see the C CODE tab, follow the picture to enable it.

Click Embedded Coder in the APPS tab.

camera_project_0_8

 

Navigate to the C CODE tab and click the build button to upload the code. This will take some time to generate the code and flash it to the board.

camera_project_0_9

 

Once everything is finished you will be able to see this message.

camera_project_0_10

Test Web Server

Connect the PC or device to the correct network. Then open a web browser and enter the correct server address. You will be able to see the still image or video from the server.

 

http://(esp32 ip address)/capture

http://(esp32 ip address):81/stream

 

Please find the example files from here:

AP mode demo

STA mode demo

Copyright 2024 Aimagin Co.,Ltd. Rev.1659