- Project: ESP32-CAM Remote v1.0
- Author: Suprovo Basak
- Date: 23-January-2026
- License: Apache License 2.0
- GitHub: https://github.com/SuprovoRGB
- IDE: Arduino IDE v2.3.7
- Boards Manager: esp32 by Espressif Systems v3.3.5
- Board: AI Thinker ESP32-CAM
- CPU Frequency: 240MHz (WiFi/BT)
- Core Debug Level: None
- Erase All Flash Before Sketch Upload: Disabled
- Flash Frequency: 80MHz
- Flash Mode: QIO
- Partition Scheme: Huge APP (3MB No OTA/1MB SPIFFS)
- Camera: OV2640
- SD Card: MicroSD / MicroSDHC (FAT32)
- Programmer Module: ESP32-CAM-MB (Recommended)
This project implements a high-performance ESP32-CAM-based remote control and live video streaming system. It is designed as a flexible base for any ESP32-CAM project, allowing easy expansion and customization for different applications. The entire firmware is written in a single file with structured sections and guided comments for educational and learning purposes.
- The code demonstrates the following
- Proper ESP32 + FreeRTOS usage (Core0 for system tasks and Core1 for user tasks)
- Non-blocking MJPEG video streaming
- SD card photo capture from live stream
- Single-client web interface locking
- Reliable Wi-Fi auto reconnect logic
- Single-file object-oriented source code with guided comments (beginner-friendly and educational)
- High-performance, stable MJPEG video streaming with FPS display (performance depends on Wi-Fi and quality settings)
- QVGA: Up to ~50 FPS
- VGA: Up to ~25 FPS
- Adjustable resolution and JPEG quality with image rotation
- Real-time FPS display on the top-left corner of the remote UI
- ESP32-CAM can operate as a remote device even if the OV2640 camera is not connected
- SD Card support using 1-bit mode (MicroSD / MicroSDHC, FAT32)
- Saves GPIO pins
- Firmware runs normally even without an SD card
- Photo capture from live stream
- Capture via the UI and save directly to the SD card
- On-board LED remains ON during capture
- Free usable GPIO pins
- Always free: GPIO 1, 3, 12, 13, 16
- Additionally free: GPIO 2, 14, 15 (when SD card is not inserted)
- Wi-Fi behavior
- Device waits until first successful Wi-Fi connection
- Automatic Wi-Fi reconnection
- On-board LED blinks at ~2 Hz during connect or reconnect attempts
- Clean, responsive, and lightweight web-based remote UI
- Directional buttons support press-and-hold operation
- Flash LED control via UI
- Single-client access enforcement
- If UI is opened on one device, other devices are blocked with a message
- If connection is lost for 30 seconds, a new device is allowed to connect
- Bluetooth disabled by default to improve Wi-Fi stability and performance
- Open this code in the Arduino IDE on a PC
- Install the appropriate ESP32 Boards Manager if it is not already installed
- Modify the code as needed and update the Wi-Fi SSID and password (router credentials) in the setup() function
- Connect the ESP32-CAM to the PC
- Select the correct Board and Port, and verify all required settings in the Tools menu
- Open the Serial Monitor and set the baud rate to 115200
- Upload the firmware to the ESP32-CAM
- Wait until the on-board LED stops blinking (Wi-Fi connected)
- Note the assigned Wi-Fi IP address shown in the Serial Monitor (if not shown, perform an ESP32-CAM hardware reset and wait)
- Disconnect the ESP32-CAM from the PC and power it in your project
- Wait until the on-board LED stops blinking again (Wi-Fi connected)
- Enter the ESP32-CAM IP address in a web browser (mobile device recommended) connected to the same router
- The remote UI will open and can be used to control the ESP32-CAM
- If the UI does not open, reconnect the ESP32-CAM to the PC and recheck the IP address
- For any other issues, please recheck the code and project circuit (mentioned in the Caution section)
- Provide a stable power supply of 5V and at least 500 mA to avoid power issues and brownouts
- Boot-sensitive GPIOs must be handled carefully
- GPIO 0 must be HIGH during boot and LOW during sketch upload
- GPIO 2 and 12 must be LOW during boot
- GPIO 15 must be HIGH during boot
- Serial output is disabled by default after the initial status print to free GPIO 1 and 3
- Any further Serial usage must be handled carefully
- The OV2640 camera and SD card should not be inserted or removed while the ESP32-CAM is powered on
- Power off the ESP32-CAM only when it is NOT writing to the SD card
