Skip to content

Commit 4dffaaa

Browse files
committed
doc: Updates to Asset tracker template docs
Updates to Asset tracker template docs. Signed-off-by: divya pillai <[email protected]>
1 parent 1e8d76e commit 4dffaaa

21 files changed

+452
-314
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414

1515
## Overview
1616

17-
The Asset Tracker Template is a modular framework for developing IoT applications on nRF91-based devices. Built on [nRF Connect SDK](https://www.nordicsemi.com/Products/Development-software/nRF-Connect-SDK) and [Zephyr RTOS](https://docs.zephyrproject.org/latest/), it provides an event-driven architecture for battery-powered IoT use cases with cloud connectivity, location tracking, and sensor data collection.
17+
The Asset Tracker Template is a modular framework for developing IoT applications on nRF91-based devices.
18+
It is built on the [nRF Connect SDK](https://www.nordicsemi.com/Products/Development-software/nRF-Connect-SDK) and [Zephyr RTOS](https://docs.zephyrproject.org/latest/), and provides a modular, event-driven architecture suitable for battery-powered IoT use cases.
19+
The framework supports features such as cloud connectivity, location tracking, and sensor data collection.
1820

19-
The system uses modules that communicate through [zbus](https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/zbus/index.html) channels for loose coupling and maintainability. It's suitable for asset tracking, environmental monitoring, and other IoT applications requiring modularity and power efficiency.
21+
The system is organized into modules, each responsible for a specific functionality, such as managing network connectivity, handling cloud communication, or collecting environmental data.
22+
Modules communicate through [zbus](https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/zbus/index.html) channels, ensuring loose coupling and maintainability.
2023

2124
**Supported hardware**: [Thingy:91 X](https://www.nordicsemi.com/Products/Development-hardware/Nordic-Thingy-91-X), [nRF9151 DK](https://www.nordicsemi.com/Products/Development-hardware/nRF9151-DK)
2225

23-
> **Note**: If you're new to nRF91 series and cellular IoT, consider taking the [Nordic Developer Academy Cellular Fundamentals Course](https://academy.nordicsemi.com/courses/cellular-iot-fundamentals).
26+
> [!NOTE]
27+
> If you're new to nRF91 series and cellular IoT, consider taking the [Nordic Developer Academy Cellular Fundamentals Course](https://academy.nordicsemi.com/courses/cellular-iot-fundamentals).
2428
2529
## Quick Start
2630

@@ -29,9 +33,9 @@ For detailed setup instructions using the [nRF Connect for VS Code extension](ht
2933
For pre-built binaries, refer to the latest tag and release artifacts documentaion; [release artifacts](docs/common/release.md).
3034

3135
> [!TIP]
32-
> Use the [Download nRF Connect for Desktop Quick Start application](https://www.nordicsemi.com/Products/Development-tools/nrf-connect-for-desktop/download#infotabs) for a guided setup and provisioning process.
36+
> Download and run the [Quick Start app](https://docs.nordicsemi.com/bundle/nrf-connect-quickstart/page/index.html) in the [nRF Connect for Desktop](https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Connect-for-desktop)`_ for a guided setup and provisioning process.
3337
>
34-
> You can also refer to [Exercise 1](https://academy.nordicsemi.com/courses/cellular-iot-fundamentals/lessons/lesson-1-cellular-fundamentals/topic/lesson-1-exercise-1/) in [Nordic Developer Academy Cellular Fundamentals Course](https://academy.nordicsemi.com/courses/cellular-iot-fundamentals).
38+
> You can also refer to [Exercise 1](https://academy.nordicsemi.com/courses/cellular-iot-fundamentals/lessons/lesson-1-cellular-fundamentals/topic/lesson-1-exercise-1/) in [Nordic Developer Academy Cellular Fundamentals Course](https://academy.nordicsemi.com/courses/cellular-iot-fundamentals) for more details.
3539
3640
### Prerequisites
3741

docs/common/architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This document provides an overview of the architecture and explains how the diff
1313
The Asset Tracker Template is built around a modular architecture where each module is responsible for a specific functionality. The template consists of the following modules:
1414

1515
- **[Main module](../modules/main.md)**: The central coordinator that implements the business logic and controls the overall application flow.
16+
- **[Storage module](../modules/storage.md)**: Forwards or stores data from enabled modules.
1617
- **[Network module](../modules/network.md)**: Manages LTE connectivity and tracks network status.
1718
- **[Cloud module](../modules/cloud.md)**: Handles communication with nRF Cloud using CoAP.
1819
- **[Location module](../modules/location.md)**: Provides location services using GNSS, Wi-Fi, and cellular positioning.
@@ -224,9 +225,8 @@ In the image, the black dots and arrow indicate initial transitions.
224225
In this case, the initial state is set to `STATE_RUNNING`. In the state machine definition, initial transitions are configured, such that the state machine ends up in `STATE_DISCONNECTED_SEARCHING` when first initialized.
225226
From there, transitions follows the arrows according to the messages received and the state machine logic.
226227

227-
!!! important "Important"
228-
229-
In a hierarchical state machine, the run function of the current state is executed first, and then the run function of the parent state is executed, unless a state transition happens, or the child state marks the message as handled using `smf_state_handled()`.
228+
> [!IMPORTANT]
229+
> In a hierarchical state machine, the run function of the current state is executed first, and then the run function of the parent state is executed, unless a state transition happens, or the child state marks the message as handled using `smf_state_handled()`.
230230
231231
### State machine context
232232

docs/common/configuration.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ curl -X PATCH "https://api.nrfcloud.com/v1/devices/$DEVICE_ID/state" \
5353

5454
*For shadow structure details, see `Asset-Tracker-Template/app/src/cbor/device_shadow.cddl`*
5555

56-
### Configuration Flow
56+
### Configuration flow
5757

58-
* **Initial Setup**
58+
* **Initial setup**
5959

6060
- The device starts with default interval from `CONFIG_APP_MODULE_TRIGGER_TIMEOUT_SECONDS`.
6161
- Upon cloud connection, the device automatically requests shadow configuration.
6262

63-
* **Runtime Configuration**
63+
* **Runtime configuration**
6464

6565
- Cloud module receives and processes shadow updates.
6666
- Device maintains last known configuration during offline periods.
6767

68-
* **Impact on Device Behavior**
68+
* **Impact on device behavior**
6969

7070
The `update_interval` configuration controls the frequency of:
7171

@@ -78,17 +78,17 @@ curl -X PATCH "https://api.nrfcloud.com/v1/devices/$DEVICE_ID/state" \
7878

7979
The Asset Tracker supports multiple location methods that can be prioritized based on your needs. Configuration is done through board-specific configuration files.
8080

81-
### Available Location Methods
81+
### Available location methods
8282

8383
The following are the available location methods:
8484

8585
- GNSS (GPS)
8686
- Wi-Fi® positioning
8787
- Cellular positioning
8888

89-
### Configuration Examples
89+
### Configuration examples
9090

91-
* **Thingy91x Configuration** (Wi-Fi available):
91+
* **Thingy91x configuration** (Wi-Fi available):
9292

9393
```
9494
CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_FIRST_WIFI=y
@@ -97,21 +97,21 @@ The following are the available location methods:
9797
CONFIG_LOCATION_REQUEST_DEFAULT_WIFI_TIMEOUT=10000
9898
```
9999
100-
* **nRF9151 DK Configuration** (Wi-Fi unavailable):
100+
* **nRF9151 DK configuration** (Wi-Fi unavailable):
101101
102102
```
103103
CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_FIRST_GNSS=y
104104
CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_SECOND_CELLULAR=y
105105
```
106106
107-
## Storage Mode Configuration
107+
## Storage mode configuration
108108
109109
The storage module handles collected data in two modes: **Passthrough** (forward immediately, default) or **Buffer** (store and transmit in batches for lower power consumption).
110110
See [Storage Module Documentation](../modules/storage.md) for details.
111111
112112
**Basic configuration** in `prj.conf`:
113113
114-
Passthrough mode is the default mode, to enable buffer mode use:
114+
Passthrough mode is the default mode. To enable buffer mode use:
115115
116116
```bash
117117
CONFIG_APP_STORAGE_INITIAL_MODE_BUFFER=y
@@ -124,7 +124,7 @@ CONFIG_APP_STORAGE_MAX_RECORDS_PER_TYPE=8 # Records per data type
124124
CONFIG_APP_STORAGE_BATCH_BUFFER_SIZE=256 # Batch buffer size
125125
```
126126

127-
For minimal use include the `overlay-storage-minimal.conf` overlay
127+
For minimal use, include the `overlay-storage-minimal.conf` overlay.
128128

129129
**Runtime control** (shell commands when `CONFIG_APP_STORAGE_SHELL=y`):
130130

@@ -156,7 +156,7 @@ The Asset Tracker supports both LTE Cat NB1 (NB-IoT) and LTE Cat M1 (LTE-M) cell
156156
- Mobile applications.
157157
- Lower latency requirements.
158158

159-
#### Network Mode Selection
159+
#### Network mode selection
160160

161161
The following network modes are available (`LTE_NETWORK_MODE`):
162162

@@ -168,7 +168,7 @@ The following network modes are available (`LTE_NETWORK_MODE`):
168168
- **LTE-M and NB-IoT**: Both LTE-M and NB-IoT enabled.
169169
- **LTE-M, NB-IoT and GPS**: Both LTE modes with GPS .
170170

171-
#### Network Mode Preference
171+
#### Network mode preference
172172

173173
When multiple network modes are enabled (LTE-M and NB-IoT), you can set preferences (`LTE_MODE_PREFERENCE`):
174174

@@ -188,11 +188,11 @@ CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT_GPS=y
188188
CONFIG_LTE_MODE_PREFERENCE_LTE_M_PLMN_PRIO=y
189189
```
190190

191-
### PSM (Power Saving Mode)
191+
### Power Saving Mode (PSM)
192192

193193
PSM allows the device to enter deep sleep while maintaining network registration. Configuration is done through Kconfig options:
194194

195-
#### PSM Parameters
195+
#### PSM parameters
196196

197197
* **Periodic TAU (Tracking Area Update)**
198198

@@ -223,7 +223,7 @@ The following are the Key aspects:
223223
- Stays active for the duration specified by RAT.
224224
225225
226-
### APN (Access Point Name)
226+
### Access Point Name (APN)
227227
228228
The Access Point Name (APN) is a network identifier used by the device to connect to the cellular network's packet data network. Configuration options:
229229
@@ -243,7 +243,7 @@ Common scenarios for APN configuration:
243243
> [!NOTE]
244244
> In most cases, the default APN provided by the carrier should work without additional configuration.
245245
246-
## LED Status Indicators
246+
## LED status indicators
247247
248248
The Asset Tracker Template uses LED colors to indicate different device states:
249249
@@ -252,7 +252,7 @@ The Asset Tracker Template uses LED colors to indicate different device states:
252252
- **Blue** (Blinking, 10 repetitions): Device is in lower power mode state between samples.
253253
- **Purple** (Blinking, 10 repetitions): FOTA download in progress.
254254
255-
### Example: Setting LED Colors
255+
### Example: Setting LED colors
256256
257257
You can control the LED colors through the LED module using zbus messages. The following is an example of how to set different LED patterns:
258258

docs/common/customization.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To add a new zbus event, complete the following procedure:
3333
};
3434
```
3535

36-
2. Implement publishing of VBUS connected and disconnected events by modifying the existing `event_callback()` function in `power.c`:
36+
1. Implement publishing of VBUS connected and disconnected events by modifying the existing `event_callback()` function in `power.c`:
3737
```c
3838
if (pins & BIT(NPM13XX_EVENT_VBUS_DETECTED)) {
3939
LOG_DBG("VBUS detected");
@@ -70,7 +70,7 @@ To add a new zbus event, complete the following procedure:
7070
}
7171
```
7272

73-
3. Make sure the channel is included in the subscriber module (for example, `main.c`). Add the channel to the channel list:
73+
1. Make sure the channel is included in the subscriber module (for example, `main.c`). Add the channel to the channel list:
7474

7575
```c
7676
# define CHANNEL_LIST(X) \
@@ -84,7 +84,7 @@ To add a new zbus event, complete the following procedure:
8484
X(POWER_CHAN, struct power_msg) \
8585
```
8686

87-
4. Implement a handler for the new events in the subscriber module (for example, in the main module's state machine in `running_run`):
87+
1. Implement a handler for the new events in the subscriber module (for example, in the main module's state machine in `running_run`):
8888

8989
```c
9090
if (state_object->chan == &POWER_CHAN) {
@@ -136,7 +136,7 @@ To add a new zbus event, complete the following procedure:
136136
}
137137
```
138138

139-
5. Test the implementation by connecting and disconnecting VBUS to verify the LED patterns change as expected.
139+
1. Test the implementation by connecting and disconnecting VBUS to verify the LED patterns change as expected.
140140

141141
## Add environmental sensor
142142

@@ -171,7 +171,7 @@ Thingy:91 X is used as an example, as it is a supported board in the template wi
171171
};
172172
```
173173

174-
2. Update the environmental module's state structure to include the magnetometer device reference and data storage:
174+
1. Update the environmental module's state structure to include the magnetometer device reference and data storage:
175175

176176
```c
177177
struct environmental_state_object {
@@ -187,7 +187,7 @@ Thingy:91 X is used as an example, as it is a supported board in the template wi
187187
};
188188
```
189189

190-
3. Initialize the device reference using the devicetree label:
190+
1. Initialize the device reference using the devicetree label:
191191

192192
```c
193193
struct environmental_state_object environmental_state = {
@@ -196,7 +196,7 @@ Thingy:91 X is used as an example, as it is a supported board in the template wi
196196
};
197197
```
198198

199-
4. Update the sensor sampling function signature to include the magnetometer device:
199+
1. Update the sensor sampling function signature to include the magnetometer device:
200200

201201
```c
202202
static void sample_sensors(const struct device *const bme680, const struct device *const bmm350)
@@ -208,7 +208,7 @@ Thingy:91 X is used as an example, as it is a supported board in the template wi
208208
sample_sensors(state_object->bme680, state_object->bmm350);
209209
```
210210

211-
5. Implement sensor data acquisition using the Zephyr Sensor API:
211+
1. Implement sensor data acquisition using the Zephyr Sensor API:
212212

213213
```c
214214
err = sensor_sample_fetch(bmm350);
@@ -241,7 +241,7 @@ Thingy:91 X is used as an example, as it is a supported board in the template wi
241241
};
242242
```
243243

244-
6. Update the `environmental_msg` structure in `environmental.h` to include the magnetic field data:
244+
1. Update the `environmental_msg` structure in `environmental.h` to include the magnetic field data:
245245

246246
```c
247247
struct environmental_msg {
@@ -254,9 +254,9 @@ Thingy:91 X is used as an example, as it is a supported board in the template wi
254254
};
255255
```
256256

257-
The magnetometer data is now part of the environmental message and will be automatically handled by the storage module through the existing `ENVIRONMENTAL` data type. No changes to `storage_data_types.h` or `storage_data_types.c` are needed since the existing `environmental_check()` and `environmental_extract()` functions will handle the entire structure including the magnetic field data.
257+
The magnetometer data is now part of the environmental message and will be automatically handled by the storage module through the existing `ENVIRONMENTAL` data type. No changes to `storage_data_types.h` or `storage_data_types.c` are needed since the existing `environmental_check()` and `environmental_extract()` functions will handle the entire structure, including the magnetic field data.
258258

259-
7. Add cloud integration in the `send_storage_data_to_cloud()` function in `cloud.c` to send magnetometer data to nRF Cloud. Add this code after the existing environmental sensor data handling:
259+
1. Add cloud integration in the `send_storage_data_to_cloud()` function in `cloud.c` to send magnetometer data to nRF Cloud. Add this code after the existing environmental sensor data handling:
260260

261261
```c
262262
#if defined(CONFIG_APP_ENVIRONMENTAL)
@@ -316,14 +316,14 @@ To add your own module, complete the following steps:
316316
mkdir -p app/src/modules/dummy
317317
```
318318

319-
2. Create the following files in the module directory:
319+
1. Create the following files in the module directory:
320320

321321
- `dummy.h` - Module interface definitions.
322322
- `dummy.c` - Module implementation.
323323
- `Kconfig.dummy` - Module configuration options.
324324
- `CMakeLists.txt` - Build system configuration.
325325

326-
3. In `dummy.h`, define the module's interface:
326+
1. In `dummy.h`, define the module's interface:
327327
328328
```c
329329
#ifndef _DUMMY_H_
@@ -363,7 +363,7 @@ To add your own module, complete the following steps:
363363
#endif /* _DUMMY_H_ */
364364
```
365365

366-
4. In `dummy.c`, implement the module's functionality:
366+
1. In `dummy.c`, implement the module's functionality:
367367

368368
```c
369369
#include <zephyr/kernel.h>
@@ -521,7 +521,7 @@ To add your own module, complete the following steps:
521521
K_LOWEST_APPLICATION_THREAD_PRIO, 0, 0);
522522
```
523523

524-
5. In `Kconfig.dummy`, define module configuration options:
524+
1. In `Kconfig.dummy`, define module configuration options:
525525

526526
```kconfig
527527
menuconfig APP_DUMMY
@@ -557,20 +557,20 @@ To add your own module, complete the following steps:
557557
endif # APP_DUMMY
558558
```
559559
560-
6. In `CMakeLists.txt`, configure the build system to include the source files of the module:
560+
1. In `CMakeLists.txt`, configure the build system to include the source files of the module:
561561
562562
```cmake
563563
target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/dummy.c)
564564
target_include_directories(app PRIVATE .)
565565
```
566566
567-
7. Add the module to the main application's CMakeLists.txt:
567+
1. Add the module to the main application's CMakeLists.txt:
568568
569569
```cmake
570570
add_subdirectory(src/modules/dummy)
571571
```
572572
573-
8. Increase `CONFIG_TASK_WDT_CHANNELS` in the `prj.conf` file to accommadate for the new module's task watchdog integration.
573+
1. Increase the value of the `CONFIG_TASK_WDT_CHANNELS` Kconfig option in the `prj.conf` file to accommadate for the new module's task watchdog integration.
574574
575575
The dummy module is now ready to use. It provides the following functionality:
576576

0 commit comments

Comments
 (0)