Configure the firmware
To configure the firmware, complete the following mandatory steps:
Run the following command to print the Azure IoT DPS ID scope, which your devices use during device provisioning:
node cli info -o iotHubDpsIdScope
Use this ID scope as the value for the
CONFIG_AZURE_IOT_HUB_DPS_ID_SCOPE
configuration variable.Use
11
as the value forCONFIG_AZURE_IOT_HUB_SEC_TAG
.Use
11
as the value forCONFIG_AZURE_FOTA_SEC_TAG
.Comment in the remaining Azure settings in the
prj.conf
file:CONFIG_AZURE_IOT_HUB=y CONFIG_AZURE_IOT_HUB_DPS=y CONFIG_AZURE_IOT_HUB_AUTO_DEVICE_TWIN_REQUEST=y CONFIG_AZURE_IOT_HUB_DEVICE_ID_APP=y CONFIG_AZURE_IOT_HUB_MQTT_PAYLOAD_BUFFER_LEN=2048 CONFIG_AZURE_IOT_HUB_MQTT_RX_TX_BUFFER_LEN=2048 CONFIG_AZURE_IOT_HUB_TOPIC_PROPERTY_BAG_PREFIX=n CONFIG_AZURE_IOT_HUB_STACK_SIZE=4096 CONFIG_AZURE_FOTA=y CONFIG_AZURE_FOTA_TLS=y
Comment in the Azure logging settings in the
overlay-debug.conf
file:CONFIG_AZURE_FOTA_LOG_LEVEL_DBG=y CONFIG_AZURE_IOT_LOG_LEVEL_DBG=y CONFIG_AZURE_JOBS_LOG_LEVEL_DBG=y
Comment out the nRF Connect for Cloud settings in the
prj.conf
file:# CONFIG_AGPS=y # CONFIG_AGPS_SRC_NRF_CLOUD=y # CONFIG_NRF_CLOUD=y # CONFIG_NRF_CLOUD_AGPS=y # CONFIG_NRF_CLOUD_CONNECTION_POLL_THREAD=y # CONFIG_NRF_CLOUD_PGPS=n # CONFIG_NRF_CLOUD_SEND_TIMEOUT=y # CONFIG_GPS_MODULE_NMEA=y
Comment out the nRF Connect for Cloud logging settings in the
overlay-debug.conf
file:# CONFIG_NRF_CLOUD_FOTA_LOG_LEVEL_DBG=y # CONFIG_NRF_CLOUD_GPS_LOG_LEVEL_DBG=y # CONFIG_NRF_CLOUD_LOG_LEVEL_DBG=y
After completing the configuration, compile the firmware either using your own development environment or using Docker and then create the device credentials.
Note
See the documentation on nRF9160: Asset Tracker v2 application (1.6.0) for all available configuration options.