Step 3: Trigger provisioning on the device

Asset Tracker Template

tags
Asset Tracker Template

After onboarding, the device must contact the provisioning service to fetch its credentials. To trigger the contact immediately, use one of the following methods:

  • Thingy:91 X: Press and hold Button 1, which is the button on the top of the device, for about three seconds.
  • nRF9151 DK: Press and hold Button 1 for about three seconds.

The device polls the provisioning service, receives its credentials, and connects to nRF Cloud over CoAP. Provisioning can take up to a minute. Once it completes, the device appears under Fleet > Devices in the nRF Cloud portal. Each device page shows its provisioning status and the time it last checked in, so you can confirm that the credential exchange completed.

Note

It is normal for the LTE connection to disconnect and reconnect during provisioning. The modem must go offline temporarily while the library writes the credentials to its secure storage. For more information, see the What happens during provisioning section on this page.

What can you do after connecting

After your device is connected to nRF Cloud, you can perform the following:

  • Monitor device data: View real-time data from your device, including location, temperature, battery percentage, and other sensor readings in the nRF Cloud portal.
  • Retrieve data programmatically:
    • Use the Message Routing Service to automatically forward device messages to your own cloud infrastructure or application endpoints.
    • Query historical device messages using the List nRF9x Device Messages endpoint of the nRF Cloud API. The request needs an organization auth token with the device:read permission, and your organization and project slugs, which you find under Project Settings > General.

Retrieve historical messages
curl "https://api.nrfcloud.com/v1/organizations/${NRFCLOUD_ORG}/projects/${NRFCLOUD_PROJECT}/messages?deviceId=${DEVICE_ID}&pageLimit=10" \
  -H "Authorization: Bearer ${NRFCLOUD_OAT}" \
  -H "Accept: application/json"
The response lists the newest messages first. Filter by `appId`, or limit the time range with `start` and `end`. When more messages are available, pass the returned `pageNextToken` in the next request to fetch the next page.

  • Perform firmware updates: Deploy over-the-air firmware updates to your device. See Firmware updates (FOTA) for detailed instructions on preparing and deploying firmware updates through nRF Cloud.