nRF Provisioning AT commands
This page describes AT commands for the nRF Device Provisioning service. The provisioning client connects to the nRF Cloud Provisioning Service over CoAP or DTLS and applies device configuration commands (credentials, settings, and firmware updates) issued from the cloud.
To use the provisioning service with the nRF91M1 module, you must first claim the device using its attestation token:
Retrieve the attestation token with the
AT%ATTESTTOKENcommand.Enter the token as described in the nRF Cloud Provisioning Service documentation.
Run the
AT#XNRFPROVcommand to trigger provisioning, as described in Trigger provisioning #XNRFPROV. During the session, the host must respond to the#XNRFPROV: 1and#XNRFPROV: 2notifications. The host takes the modem offline to write credentials, and then brings it back online to reconnect to the provisioning server. See the unsolicited notifications section for details.
Trigger provisioning #XNRFPROV
The #XNRFPROV command triggers an immediate provisioning attempt.
Set command
The set command starts a provisioning session immediately, independently of the configured schedule interval.
Syntax
AT#XNRFPROV
Response syntax
OK
Unsolicited notifications
One of the following #XNRFPROV notifications is emitted when the provisioning session completes, an event occurs, or host action is required:
#XNRFPROV: <status>
The parameters and their defined values are the following:
- <status>
0- Provisioning successful, or no pending commands on the server. The two cases are not distinguished.1- Host action required: deactivate LTE. The host must take the modem offline (for exampleAT+CFUN=4) so that credentials can be written safely.The provisioning client waits until the modem reports offline functional mode before continuing or times out after 120 seconds.
2- Host action required: activate LTE. The host must bring the modem back online (for exampleAT+CFUN=1) to reconnect to the provisioning server.The provisioning client waits until the modem reports LTE registration before continuing or times out after 120 seconds.
-1- Provisioning failed. The host can retry provisioning by triggering the#XNRFPROVcommand again.-2- Device not claimed on nRF Cloud. The device must be claimed using its attestation token. Refer to the nRF Cloud Provisioning Service documentation for more information.-3- Wrong root CA certificate. Provision the correct nRF Cloud root CA certificate.-4- No valid datetime reference. The modem must have a valid time before provisioning can proceed.
-5- Too many commands received from the server. The maximum number of records is 5.
-6- Fatal error: the provisioning client encountered an irrecoverable error.
Example
The provisioning client requests the host to manage the LTE connection during the session.
The host must respond to the #XNRFPROV: 1 and #XNRFPROV: 2 notifications accordingly.
AT#XNRFPROV
OK
#XNRFPROV: 1
AT+CFUN=4
OK
#XNRFPROV: 2
AT+CFUN=1
OK
#XNRFPROV: 0
Test command
The test command returns the command syntax.
Syntax
AT#XNRFPROV=?
Response syntax
#XNRFPROV