Skip to content

nrfconnect/Asset-Tracker-Template

Repository files navigation

Asset Tracker Template

Oncommit

Target tests

Nightly

Target_tests Power Consumption Badge

RAM Usage thingy91x FLASH Usage thingy91x

Overview

The Asset Tracker Template is a modular framework for developing IoT applications on nRF91-based devices. It is built on the nRF Connect SDK and Zephyr RTOS, and provides a modular, event-driven architecture suitable for battery-powered IoT use cases. The framework supports features such as cloud connectivity, location tracking, and sensor data collection.

The system is organized into modules, each responsible for a specific functionality, such as managing network connectivity, handling cloud communication, or collecting environmental data. Modules communicate through zbus channels, ensuring loose coupling and maintainability.

Supported hardware:

If you're new to nRF91 series and cellular IoT, consider taking the Nordic Developer Academy Cellular Fundamentals Course.

Quick Start

The fastest way to get started is to download and run the Quick Start app in nRF Connect for Desktop. It provides a guided setup and provisioning process that gets your device connected to nRF Cloud in minutes.

Alternatively, you can download pre-built firmware binaries from the latest release and flash them directly to your device. See the release artifacts documentation for details.

Setting up the development environment

To build the firmware from source, you need the nRF Connect SDK development environment (setup guide). There are two options for setting up and building the project. For a detailed walkthrough, see the Getting Started Guide.

Option 1: nRF Connect for VS Code (Recommended)

Use the nRF Connect for VS Code extension for an integrated development experience:

  1. Open VS Code and go to the nRF Connect extension.
  2. Select Create New ApplicationBrowse nRF Connect SDK add-on Index.
  3. Search for Asset Tracker Template and create the project.
  4. Use the Actions panel in the extension to build and flash the application.

For more details, see the Getting Started Guide.

Option 2: Command line

1. Initialize workspace
  1. Install nRF Util. Follow the nRF Util documentation for installation instructions.

  2. Install sdk-manager:

    nrfutil install sdk-manager
  3. Install toolchain:

    nrfutil sdk-manager install v3.1.0
  4. Launch toolchain:

    nrfutil sdk-manager toolchain launch --ncs-version v3.1.0 --terminal

    This will launch a new terminal window with the specified toolchain activated, use this terminal in the coming steps.

  5. Initialize workspace:

    west init -m https://github.com/nrfconnect/Asset-Tracker-Template.git --mr main asset-tracker-template
    cd asset-tracker-template/project/app
    west update
2. Build and flash

For Thingy:91 X:

west build --pristine --board thingy91x/nrf9151/ns
west thingy91x-dfu  # For Thingy:91 X serial bootloader
# Or with external debugger:
west flash --erase

For nRF9151 DK:

west build --pristine --board nrf9151dk/nrf9151/ns
west flash --erase

Provision device to nRF Cloud

After building and flashing (using either option above), you need to provision the device to connect to nRF Cloud.

Provisioning steps
  1. Get the device attestation token. Open a serial terminal connected to the device (115200 baud) and run the following AT command in the device shell:

    at at%attesttoken

    Note: The token is also printed automatically to the serial log on first boot of unprovisioned devices.

  2. Log in to the nRF Cloud portal.

  3. Navigate to Security ServicesClaimed DevicesClaim Device.

  4. Paste the attestation token, set rule to "nRF Cloud Onboarding", and click Claim Device.

    If "nRF Cloud Onboarding" rule is not showing:

    Create a new rule using the following configuration:

    Claim Device
  5. After claiming, wait for the device to provision credentials and connect to nRF Cloud over CoAP. Once connected, the device will be available under Device ManagementDevices.

[!NOTE] The device polls the provisioning service at its own interval. This means it may take a few minutes for the device to pick up the claim and complete provisioning. If you want a quicker response, press Button 1 on the device or reset it to trigger an immediate provisioning poll.

See Provisioning to nRF Cloud for more details.

System Architecture

Core modules include:

  • Main: Central coordinator implementing business logic
  • Storage: Data collection and buffering management
  • Network: LTE connectivity management
  • Cloud: nRF Cloud CoAP communication
  • Location: GNSS, Wi-Fi, and cellular positioning
  • LED: RGB LED control for Thingy:91 X
  • Button: User input handling
  • FOTA: Firmware over-the-air updates
  • Environmental: Sensor data collection
  • Power: Battery monitoring and power management

System overview

Key Features

  • State Machine Framework (SMF): Predictable behavior with run-to-completion model
  • Message-Based Communication: Loose coupling via zbus channels
  • Modular Architecture: Separation of concerns with dedicated threads for blocking operations
  • Power Optimization: LTE PSM enabled by default with configurable power-saving features

The architecture is detailed in the Architecture documentation.

Table of Content

Module Documentation

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors