How henrynguyen1204/esp32_gps_mqtt works
Project Type and Purpose
• This is an embedded systems project built with ESP-IDF for the ESP32, and it integrates several hardware components:
• A GPS Module for reading NMEA data via UART.
• A SIM Module, also communicating via UART, used to publish GPS information over MQTT.
• An SSD1306 OLED display connected over I2C, which shows real-time GPS data.
• The overall purpose is to collect location data from the GPS, display it locally on the OLED, and publish it to an MQTT broker, demonstrating real-time communication.
File Structure Insights
• The project's file tree shows a top-level CMakeLists.txt with a dedicated "main" directory containing the application source.
• Source files (gps.c, sim_uart.c, ssd1306.c, main.c) and corresponding header files indicate distinct modules handling specific hardware functionality.
• The presence of an idf_component.yml implies the project is structured as an ESP-IDF component, which typically enforces modular separation.
System Components and Their Relationships
a. Main Processing Unit (ESP32):
• Acts as the central controller.
• Executes main.c and coordinates among the different modules.
b. GPS Module:
• Interfaces via UART to the ESP32.
• Responsible for capturing and parsing NMEA data.
c. SIM Module:
• Also uses UART, and handles MQTT connectivity.
• Transmits the GPS data over MQTT to a specified broker.
d. SSD1306 OLED Display:
• Connected over I2C.
• Displays live GPS information.
e. MQTT Broker (External Service):
• Receives data pushed from the SIM module via an established topic.
Architectural Patterns & Technologies
• Modular design: Each hardware element (GPS, SIM, Display) is implemented as a separate module integrated within the main app.
• Communication Pattern:
• UART communications are used for both the GPS module and SIM module.
• I2C is used for the OLED display.
• MQTT is used for sending data to the external broker.
• ESP-IDF Framework: Leverages ESP32-S3 hardware capabilities, and the component-based architecture provided by ESP-IDF.