How raushanraja/ec200ucn works
Project type and purpose
• This is an embedded IoT firmware project written in C++ using PlatformIO (configured via pyproject.toml and platformio.ini).
• The firmware runs on a microcontroller paired with a Quectel EC200UCN cellular modem. It publishes/subscribes to a remote MQTT broker over TLS.
• A Python helper (cert.py) plus the QFlash tool are used to upload the CA root certificate into the modem’s flash.
File structure
• Top-level config
– platformio.ini: build, upload and board settings
– pyproject.toml: Poetry environment for PlatformIO + cert.py
– .vscode, .gitignore
• Firmware code
– include/: public headers for application
– lib/mqtt/: AT-command-based MQTT client and helper modules
– src/main.cpp: entry point, orchestrates init, sensor read, MQTT calls
• Utilities & tests
– cert.py: Python script to push CA cert to modem via AT+QFUPL
– test/: (future) harness or unit tests
• README.md: developer onboarding, build & upload instructions, serial console notes, QFlash procedure
README for additional insights
• The architecture is implied: developer PC → build & upload → device → cloud.
• Dependencies: PlatformIO, Poetry, minicom (or any serial terminal), QFlash.
a. Main components
• Developer Workstation (IDE, Poetry, PlatformIO CLI, cert.py, QFlash UI)
• Build & Upload Path (PlatformIO toolchain + USB/serial)
• Target Hardware
– MCU (runs the firmware)
– Cellular Modem (EC200UCN) with CA store
• Firmware Modules
– Application logic (main.cpp)
– MQTT client library (lib/mqtt)
– Certificate helper (in-modem storage & usage)
• External Service
– MQTT Broker (cloud)
b. Relationships & data flows
• Dev PC → (PlatformIO via USB/serial) → MCU flash
• cert.py + QFlash UI → (AT+QFUPL over serial) → Modem CA storage
• MCU firmware → (AT commands over UART) → Modem → (cellular network) → MQTT Broker
c. Architectural patterns & principles
• Layered separation:
– Hardware abstraction (AT serial interface)
– Communication layer (MQTT client & helper)
– Application layer (main.cpp sensor read + publish logic)
• Single responsibility: cert.py solely handles certificate upload
• Modularity: independent lib/mqtt that could be reused/tested
d. Key technologies & libraries
• PlatformIO (gcc-arm toolchain, u-upload)
• Poetry (Python env for cert.py + PlatformIO plugin)
• C++17, AVR/ARM SDK (as per board)
• MQTT over AT commands
• Quectel EC200UCN, QFlash tool