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.
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.
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.
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.
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.
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.
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
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.
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.
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.
Once everything is finished you will be able to see this message.
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: