The application follows the shared Architecture. It consists of the following modules:
- Main module: Implements the business logic and controls the overall application behavior. Uniquely, it is not in the
modulesfolder. - Network module: Brings the PPP link to the modem up and down, and tracks connectivity status.
- Cloud module: Handles communication with nRF Cloud using CoAP.
- FOTA module: Manages firmware over-the-air updates of the host application.
- Location module: Collects Wi-Fi and cell measurements for the nRF Cloud location service, with one backend per board type.
- Battery module: Samples the nPM1300 fuel gauge. Only built on the nRF93M1 DK.
- Buttons module: Publishes DK button presses, and their
buttonshell equivalents, onbutton_chan. It has no state machine or thread of its own. See Buttons and shell commands. - Modem AT module: Serializes access to the modem AT pipe behind
modem_at_run(). It has no zbus channel and no state machine, and is called directly by the Location module's modem AT backend and the host shell. See Reaching Serial Modem AT commands.
The following diagram shows how the modules interact. Each module owns one channel, and both the requests sent to a module and the notifications it publishes go on that channel.
The following steps show the simplified flow of a typical operation:
- The Network module connects on startup, and publishes
NETWORK_CONNECTEDon thenetwork_chanchannel once the PPP link carries IP traffic. - The Main module responds by requesting a cloud connection with
CLOUD_CONNECTon thecloud_chanchannel. The Cloud module waits for valid time and installed credentials, connects to nRF Cloud, and publishesCLOUD_CONNECTED. - While the cloud connection is up, the Main module runs a periodic cloud synchronization: it sends a device message, triggers a location search, polls the device shadow, requests a FOTA poll, and posts pending remote debugging data.
- A location search runs asynchronously. The Location module collects its measurements and publishes them as
LOCATION_SEARCH_WIFI_CELL_RESULT, which the Main module forwards to the Cloud module for resolution by the nRF Cloud location service. - If the FOTA poll finds a job, the FOTA module downloads the update and asks the Main module to reboot with
FOTA_REBOOT_REQUEST.
See Application behavior for the full startup sequence, cloud synchronization, buttons and shell commands, and configuration options.