Before getting started, make sure you have a proper nRF Connect SDK development environment. Follow the official Getting started guide
thingy91x/nrf9151/ns
nrf9151dk/nrf9151/ns
Before initializing, start the toolchain environment:
nrfutil toolchain-manager launch --
To initialize the workspace folder (asset-tracker-template) where the firmware project and all nRF Connect SDK modules will be cloned, run the following commands:
# Initialize asset-tracker-template workspace
west init -m https://github.com/nrfconnect/Asset-Tracker-Template.git --mr main asset-tracker-template
cd asset-tracker-template
# Update nRF Connect SDK modules
west update
Complete the following steps for building and running:
- Navigate to the project folder:
cd asset-tracker-template/app
- To build the application, run the following command:
west build -p -b thingy91x/nrf9151/ns
- When using the serial bootloader on thingy91x, you can update the application using the following command:
west thingy91x-dfu
- When using nrf9151dk or an external debugger on thingy91x, you can program using the following command:
west flash --erase
west build -p -b thingy91x/nrf9151/ns -- -DEXTRA_CONF_FILE="overlay-memfault.conf;overlay-upload-modem-traces-to-memfault.conf;overlay-etb.conf" -DCONFIG_MEMFAULT_NCS_PROJECT_KEY=\"memfault-project-key\"
Provisioning steps based on nRF Cloud Utils.
Do you already have an nRF Cloud account? If not, please visit nrfcloud.com and register. Then, click on the burger on the top-right to get to your user account. Take note of your API key, you will need it soon. Note that if you are part of multiple teams on nRF Cloud, the API key will be different for each one.
Flash device with Asset Tracker Template firmware.
Open device shell via serial and set network disconnect mode:
att_network disconnect
Close serial and run following commands
Install nrfcloud-utils package
pip3 install nrfcloud-utils
Create a local certificate authority (CA)
create_ca_cert
Now, you should have three .pem files containing the key pair and the CA certificate of your CA.
Install credentials onto the device
device_credentials_installer -d --ca *_ca.pem --ca-key *_prv.pem --coap --cmd-type at_shell
Upon success, you can find an onboard.csv file with information about your device. We need this file to register the certificate with your account.
nrf_cloud_onboard --api-key $NRFCLOUD_API_KEY --csv onboard.csv
Your device should now be registered to Nrfcloud. You can reset device and wait for cloud connection.