How pangcrd/cyd-esp32-touchscreen-qr-web-ui works
This ESP32 firmware provides a touchscreen QR display with WiFi setup and a browser-facing web interface. The main loop initializes LVGL and the UI, then services the web server; browser-submitted text or URLs are turned into QR codes for the screen. On-device WiFi scanning and connection are handled separately, with credentials persisted in NVS and a device-address QR refreshed after connection. The README documents additional web assets, themes, and mDNS access. Several application modules it describes are absent from the supplied tree, so their paths and internal wiring cannot be verified here.
Main entry points: wifi_manager.cpp WiFi manager · main.cpp Application loop · lvgl.h LVGL runtime · lv_draw.c LVGL drawing
Components 19
Firmware runtime
- Application loop
src/main.cpp - LVGL port
src/lvgl_port.cpp - NTP service
Network access
- HTTP web server
- Web assets
- mDNS discovery
- WiFi manager
src/wifi_manager.cpp - WiFi credentials
src/wifi_manager.cpp - Web themes
Touchscreen interface
- QR generation
- Device UI
- Touch input
lib/XPT2046_Touchscreen/XPT2046_Touchscreen.cpp - Brightness control
LVGL framework
- LVGL runtime
lib/lvgl-9.3.0/lvgl.h - LVGL drawing
lib/lvgl-9.3.0/src/draw/lv_draw.c
Other components
- Browser user
- WiFi network
- NVS storage
- Touch display
Connections 21
- Application loop → LVGL port: initializes
- Application loop → Device UI: initializes
- Application loop → NTP service: starts and updates
- Application loop → HTTP web server: services
- Browser user → HTTP web server: submits text
- HTTP web server → Web assets: serves
- HTTP web server → QR generation: passes content
- QR generation → Device UI: provides QR
- Device UI → LVGL runtime: uses
- LVGL runtime → LVGL drawing: dispatches drawing
- LVGL drawing → Touch display: renders
- Touch input → LVGL runtime: provides input
- Device UI → Brightness control: offers control
- HTTP web server → Web themes: supports
- WiFi manager → WiFi network: scans and connects
- WiFi manager → Device UI: updates WiFi list
- WiFi manager → WiFi credentials: loads and saves
- WiFi credentials → NVS storage: persists
- WiFi manager → QR generation: updates address code
- WiFi manager → HTTP web server: initializes server
- mDNS discovery → HTTP web server: advertises access