How jackgamercyt/iot-project3- works
Smart Energy Monitoring is an end-to-end IoT system: the ESP32 measures energy and locally sheds or restores lower-priority loads, while MQTT carries telemetry and commands; the backend persists history and serves APIs, and the web dashboard combines live data with historical views and a data assistant. Paths for firmware subsystems are supported by the README; backend and dashboard responsibilities share their single source files. The sampled backend excerpt is partial, so uncertain internal routing is omitted.
Main entry points: esp32_firmware.ino ESP32 Firmware · index.html Web Dashboard · main.py REST API
Components 17
Device Control
- ESP32 Firmware
firmware/esp32_firmware/esp32_firmware.ino - Measurement & Energy
firmware/esp32_firmware/esp32_firmware.ino - Load Management
firmware/esp32_firmware/esp32_firmware.ino - RTC & Offline Buffer
firmware/esp32_firmware/esp32_firmware.ino
Messaging
- MQTT Broker
Backend Data
- MQTT Ingest
backend/main.py - REST API
backend/main.py - Energy & History
backend/main.py - Data Assistant
backend/main.py - Time-Series Database
backend/main.py
Dashboard
- Web Dashboard
index.html - Live Monitoring
index.html - History & Costs
index.html - Commands & ACKs
index.html - Assistant Interface
index.html
Other components
- Operator
- Fan & LED Loads
Connections 22
- Operator → Web Dashboard: uses
- ESP32 Firmware → Measurement & Energy: samples
- Measurement & Energy → Load Management: provides readings
- Load Management → Fan & LED Loads: switches
- RTC & Offline Buffer → ESP32 Firmware: supplies time
- ESP32 Firmware → MQTT Broker: publishes telemetry
- MQTT Broker → ESP32 Firmware: dispatches commands
- ESP32 Firmware → RTC & Offline Buffer: buffers offline
- MQTT Broker → MQTT Ingest: delivers topics
- MQTT Ingest → Time-Series Database: writes records
- MQTT Ingest → MQTT Broker: publishes commands
- REST API → Time-Series Database: reads and writes
- Energy & History → Time-Series Database: queries history
- Data Assistant → Energy & History: uses queries
- Web Dashboard → MQTT Broker: subscribes live
- Web Dashboard → REST API: requests REST data
- Live Monitoring → Web Dashboard: renders live data
- History & Costs → Web Dashboard: renders history
- Commands & ACKs → MQTT Broker: publishes commands
- MQTT Broker → Commands & ACKs: delivers ACKs
- Assistant Interface → REST API: sends questions
- REST API → Assistant Interface: returns answers