How tcrakn/islamic-prayer-times-display-esp32 works
Project type and purpose
• This is an embedded IoT application running on an ESP32‐based TTGO T‑Display board.
• It fetches geolocation and prayer‐time data over WiFi, renders maps and schedules on a small TFT, and manages deep‐sleep/WAKE cycles.
(implied) file structure
• Top‐level sketch folder (“Islamic Prayer Times Display‑TTGO”) containing:
– The main .ino/Arduino sketch
– Library includes (WiFiManager, ArduinoJson, TFT_eSPI)
– Configuration files (User_Setup_Select.h modifications)
• Ancillary docs: ChangeLog.md, LICENSE, README.md
README insights
• Uses muwaqqit.com JSON API for prayer times
• Uses Google Maps/Geocoding API for location and static map images
• Incorporates NTP time‑sync, captive‐portal WiFiManager, deep‑sleep, OTA update via portal
• Handles button inputs for UI navigation (map zoom, view toggle, config portal, WAKE)
Main components and relationships
1. ESP32 SoC + peripherals
• SPI bus → ST7789 TFT display
• GPIO → buttons (top, bottom, wake)
• Li‑Po battery & power‐management IC
2. Persistent storage
• Flash (stores WiFi credentials & firmware bin)
B. Software modules (middle layer)
1. Boot & Wake Manager
• Handles reset, deep‐sleep entry/exit based on button or timer
2. WiFi Manager
• Auto‐connect to stored SSID/PW or launch captive‐portal (SSID “Muwaqqit-AP”)
• Handles OTA binary upload via HTTP
3. Time Sync (NTP Client)
• Queries NTP server to set RTC
4. Geolocation Module
• HTTP GET → Google Geocoding API for address & static map
• Parses image URL or JPEG/PNG response
5. Prayer Times Module
• HTTP GET → muwaqqit.com API
• ArduinoJson to parse Fajr, Dhuhr, etc.
6. & Graphics (TFT_eSPI)
• UI state machine with timeout transitions
7. Button Handler
• Maps button presses to zoom in/out, view toggle, skip to timetable, enter config
8. Deep‐Sleep & Power Manager
• After inactivity or display cycle completion → ESP32 deep‐sleep
C. External Services (top layer)
• NTP Pool (time)
• Google Maps/Geocoding API (address + map)
• muwaqqit.com Prayer Times API
Final checklist
• Arrowheads indicating request/response or data flow direction