A universal ESP32 webserver and SDMMC file manager with full-screen PNG/JPEG viewer, slideshow, touch control, and support for LovyanGFX, TFT_eSPI, and Arduino_GFX displays.
A clean, structured, universal image viewer and webserver for ESP32-based TFT setups. touch, PNG/JPEG images, SD_MMc, and a WiFi-accessible web interface.
- Universal TFT support: LovyanGFX, TFT_eSPI, Arduino_GFX selection
- Image formats: PNG + JPEG (with automatic scaling and color correctness)
- Touch interface: XPT2046 controller (with debounce, auto-coordinates)
- WiFi: Auto-connects, auto-reconnects, mDNS, WiFi symbol on TFT, local IP display
- SDMMC Card: Loads image list from SD, randomizes slideshow, directory browsing
- Webserver: Browse, upload/delete/rename files, display images directly on your TFT, JSON directory listing, supports file download
- Slideshow: Automatic, periodically changes displayed image; touch swaps next image
-
Wiring & Setup
- ESP32S3-LILYGO THMI ST7789 Parrel 8 bit or powered with appropriate TFT and XPT2046 touch wiring
- MicroSD wired for SD_MMC (see
clk,cmd,d0pin assignments in code) - Optionally update WiFi credentials (
ssid,passwordin code)
-
Install Required Libraries
Use Arduino IDE's Library Manager or PlatformIO:- LovyanGFX, TFT_eSPI, Arduino_GFX_Library
- XPT2046_Touchscreen
- JPEGDecoder, PNGdec
- ESPmDNS, WiFi, WebServer, SD_MMC
-
Prepare SD Card
- Create
/pictures/directory and put some.jpgor.pngimages inside
- Create
-
Upload Code
- Place provided code in
src/main.inoor directly into Arduino IDE - Add
Lilylogo.handindex_html.cpp(which you reference for the TFT splash and web interface)
- Place provided code in
-
Build & Flash
- Flash ESP32 using Arduino IDE, PlatformIO, or esptool
- Open serial monitor for debug logs (baud 115200)
- Connect device; TFT will show splash, WiFi status, and images
-
Access Webserver
- From a browser on your WiFi network, open
http://esp32.localor check the TFT for your ESP32’s IP
- From a browser on your WiFi network, open
- List images and directories (JSON)
- Direct image display (
/display?path=...) - Upload, rename, delete, create directory
- Download files
Library selection is at compile-time via:
#define TFT_LIBRARY 0 // 0 = LovyanGFX, 1 = TFT_eSPI, 2 = Arduino_GFXChange to match your hardware and installed library.
MIT License (see LICENSE file).
By NILESH DARAWADE — see comments for contributors.
Inspired by ESP32 universal TFT projects.