How aclab-hcmut/thesis_mdt263_weather_monitor works
Project Type and Purpose
• This project is an embedded firmware project for an IoT device (likely ESP32/ESP8266). It is designed to interface with various sensors (including an ultrasonic sensor and potentially a GPS) and communicate with external services (via MQTT and HTTP) while serving a local web interface through SPIFFS. It also includes OTA (over-the-air) update functionality.
• Key external libraries (ESPAsyncWebServer, ElegantOTA, ArduinoJson, ArduinoHttpClient, ThingsBoard, and MQTT client libraries) indicate that network connectivity, remote telemetry, and OTA updates are core to the project.
Analyzing the File Structure
• The top-level directories (include, lib, src, data, boards, test) reveal both the modular firmware code and supporting assets.
– The “src” directory contains the main.cpp and multiple task files (ServerTask, TaskGPS, TaskMQTT, TaskSensor, WifiTask, TaskModbus485) which represent distinct modules or threads.
– The “include” folder holds configuration headers (like Global_config.h) that likely provide global definitions.
– The “lib” directory contains external libraries divided into several submodules (ArduinoJson, ElegantOTA, ThingsBoard, etc.) that the firmware uses for communication, OTA, and JSON handling.
– The “data” directory contains HTML, JavaScript, and CSS files which serve as a web interface (loaded via SPIFFS).
• Other files such as platformio.ini and project_config.h.example are important for build and deployment configuration.
– Start with the Hardware layer (ESP board, connected sensors and communication interfaces).
– Next, illustrate a “Firmware” block subdivided into:
• Connectivity: “WiFi Task”
• Data and Sensor Management: “Sensor Task”, “GPS Task”, “Modbus485 Task”
• Communication: “MQTT Task” (linking to ThingsBoard) and “HTTP/OTA Module”
• User Interface: “Server Task” (serving web assets from SPIFFS)
• The Internet with an “MQTT Broker/Cloud Server (ThingsBoard)” block.
• A “Web Client” block connecting to the local web server.