Overview :
● This project implements a real-time MJPEG video stream server using the ESP32-CAM module.
● The ESP32-CAM connects to a Wi-Fi network and serves a live camera feed accessible through a web browser.
● The stream is handled using a simple socket-based HTTP server that delivers continuous JPEG frames to simulate video.
Features :
● Real-time MJPEG video streaming over Wi-Fi.
● Simple HTML interface for viewing the live feed.
● Socket-based HTTP server running directly on ESP32-CAM.
● Lightweight and browser-accessible stream.
Requirement :
Hardware :
● ESP32-CAM module
● UART connector (for flashing and serial communication)
● Wi-Fi connection (2.4 GHz)
Dependencies :
Ensure the ESP32-CAM has:
● MicroPython firmware with camera, network, socket, and time modules enabled.
Installation & Setup :
● Flash the ESP32-CAM with a compatible MicroPython firmware.
● Connect to the device using UART and upload the script.
● Modify the script with your Wi-Fi credentials.
● Run the script on the ESP32-CAM via REPL or main.py.
● Script File:
esp32cam_stream_server.py
How It Works ?
Wi-Fi Connection :
The ESP32-CAM connects to the configured Wi-Fi network using network.WLAN().
Camera Initialization
The onboard camera is initialized using the camera.init() method.
Stream Server
● The ESP32-CAM starts a simple socket server on port 80.
● If the browser requests /stream, the server responds with a continuous stream of
JPEG frames (MJPEG).
● A simple HTML page is served for easier viewing of the live stream.
Output :
● Live MJPEG stream accessible from the ESP32-CAM IP (shown in serial output).
● Basic HTML viewer with responsive stream display.
● Console logs for client connections and errors.
Running the Capture Script :
To view the live stream:
1. Power on the ESP32-CAM.
2. Connect to the serial monitor to see the IP address.
3. Open a browser and navigate to: http://
4. The live camera feed should appear on the page.