The template consists of the following core modules:
- Main module: Implements the business logic and controls the overall application behavior. Uniquely, it is not in the
modulesfolder. - Storage module: Stores data from enabled modules.
- Network module: Manages LTE connectivity and tracks network status.
- Cloud module: Handles communication with nRF Cloud using CoAP.
- Location module: Provides location services using GNSS, Wi-Fi, and cellular positioning.
- Button module: Reports button press events for user input.
- FOTA module: Manages firmware over-the-air updates.
Thingy:91 X specific modules:
- Environmental module: Collects environmental sensor data (temperature, humidity, pressure).
- LED module: Controls an RGB LED for visual indication.
- Power module: Monitors battery status and provides power management.
- UART Power Control module: UART suspend/resume on VBUS changes.
The following diagram shows the system architecture and how the modules interact with each other. The modules communicate through zbus channels.
The following steps show the simplified flow of a typical operation:
- The Main module schedules periodic triggers or responds to a short button press reported on the
button_chanchannel. - When triggered by timeout or button press, it requests sampling from the Power, Environmental, and Location modules in parallel by publishing on
power_chan,environmental_chan, andlocation_chan. - Sampled data is stored by the Storage module and sent to the cloud when the number of buffered records reaches
storage_threshold(configured at build time viaCONFIG_APP_STORAGE_INITIAL_THRESHOLD, or at runtime through the device shadow). See Configuration. - Throughout the operation, the Main module controls the LED module over the
led_chanchannel to provide visual feedback about the system state.