The template consists of the following core modules:
- Main module: Implements the business logic and controls the overall application behavior.
- Storage module: Stores data from enabled modules.
- Network module: Manages LTE connectivity and tracks network status.
- Cloud module: Handles communication with nRF Cloud using the Constrained Application Protocol (CoAP).
- Location module: Provides location services using Global Navigation Satellite System (GNSS), Wi-Fi, and cellular positioning.
- Button module: Reports button press events for user input.
- FOTA module: Manages firmware over-the-air updates.
Unlike the other modules, the Main module is not in the modules folder.
The following modules are specific to the Thingy:91 X:
- 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: Suspends and resumes the UART when 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, the Main module requests sampling in parallel from the Power, Environmental, and Location modules. It publishes the requests on
power_chan,environmental_chan, andlocation_chan. - The Storage module buffers the sampled data. When the number of buffered records reaches
storage_threshold, the Main module requests the buffered data from the Storage module, and the Cloud module sends it to nRF Cloud. You can configure the threshold at build time withCONFIG_APP_STORAGE_INITIAL_THRESHOLDor 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.