This is an old revision of the document!


ESP32 DIGITAL CAMERA

Introduction

The objective of this project is to use Internet of Things Devices to create a wireless, interactive camera streaming system that can transmit live footage from an ESP32-CAM module to a another ESP32 board that has a 2.8” touchscreen display through a Flask-based web server is also part of the configuration for processing, control, and gallery administration. This project demonstrates how computer vision and user interfaces may be integrated with Internet of Things components like the ESP32 to create responsive, real-time video applications for hobbyist, educational, or surveillance purposes.

Concept

Images are captured by the ESP32-CAM module in JPEG format and sent to a local Flask server over HTTP POST via Wi-Fi.

Incoming frames are processed by the server, which then uses OpenCV and PIL to apply filters like grayscale, sepia, and cartoon effects before sending them to a second ESP32 device and a web dashboard.

The second ESP32 functions as a wireless receiver and has an XPT2046 touchscreen and a 320×240 TFT display. Through an easy-to-use touch-based user interface, it retrieves the most recent frames from the Flask server, shows them in real time, and facilitates interaction.

Hardware Description

• ESP32-CAM: Captures and uploads JPEG frames to the Flask server every 100 ms (~10 FPS). Flash control is available via GPIO4, synchronized with server-side toggle requests.

• ESP32-TFT Display: Uses the TFT_eSPI and TJpg_Decoder libraries to render the MJPEG stream on-screen. The touch interface (XPT2046) enables selecting filters, capturing snapshots, toggling flash, and browsing the image gallery.

• Flask Server (Python): Receives and redistributes camera frames, applies live filters, handles snapshot saving, and serves a responsive web dashboard with gallery access and filter controls.

Functionality Breakdown

ESP32-CAM Logic:

• Connects to WI-FI and initializes camera hardware, after that it captures frames using the esp_camera_fb_get() function allowing it to send evert 100ms JPEG images to the Flash server via the /upload endpoint. Also, polls /get_flash_state every loop cycle to synchronize the onboard flash LED with user toggles from the dashboard or ESP32 Display.

Flask Server Logic:

• Receives images from the ESP32-CAM and stores the latest frame in memory which is displayed on the dashboard and also sent to the ESP32Display via the /video_feed. Maintains a JSON compatible snapshot gallery index, used by the ESP32 display for navigation/

ESP32 Display Logic:

• Connects to the same WI-FI network and begins pooling /video_feed from the server. Decodes JPEG frames and renders them using TJpg_Decoder, overlaying visual filters via direct pixel manipulation. Offers a touch UI with 4 buttons allowing the user to apply a visual filter, access the snapshot gallery, take a snapshot, and toggle on and off the LED flash.

Synchronization and Interactivity

• All of the components are synchronized via the Flask server, establishing the following data flows:

                            ESP32-CAM --> Flask (/upload,/get_flash_state)
                            Flask --> ESP32-Display (/video_feed, /snapshots)
                            Web Dashboard --> Flask (/set_filter, /set_flash,etc.)
                            ESP32-Display <--> Flask(/save_snapshot, /gallery_list)
iothings/proiecte/2025sric/digitalcamera.1748190819.txt.gz · Last modified: 2025/05/25 19:33 by adrian.vladescu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0