|
2 | 2 |
|
3 | 3 | Device provisioning establishes credentials for secure communication with nRF Cloud CoAP. |
4 | 4 |
|
| 5 | +<details> |
| 6 | +<summary><strong>What happens during provisioning?</strong></summary> |
| 7 | + |
| 8 | +The Asset Tracker Template uses the `nrf_provisioning` library to handle device provisioning automatically. The library provisions the root CA certificate for the provisioning service to the modem during boot if it's not already present. During provisioning, the following steps occur: |
| 9 | + |
| 10 | +1. **Secure Connection**: The library establishes a secure DTLS connection to the nRF Cloud CoAP Provisioning Service. The device verifies the server's identity using the root CA certificate. |
| 11 | + |
| 12 | +2. **Device Authentication**: The device authenticates itself using a JWT (JSON Web Token) signed with the modem's factory-provisioned Device Identity private key. This key is securely stored in the modem hardware and cannot be extracted. |
| 13 | + |
| 14 | +3. **Command Retrieval**: After successful authentication, the device requests provisioning commands from the server. These commands typically include cloud access credentials and configuration settings. |
| 15 | + |
| 16 | +4. **Modem Configuration**: To write the received credentials and settings, the library: |
| 17 | + - Suspends the DTLS session (to maintain the connection state) |
| 18 | + - Temporarily sets the modem offline |
| 19 | + - Writes the credentials to the modem's secure storage |
| 20 | + |
| 21 | +5. **Result Reporting**: After executing the commands, the library resumes or re-establishes the DTLS connection (if needed), authenticates again with JWT, and reports the results back to the server. Successfully executed commands are removed from the server-side queue. |
| 22 | + |
| 23 | +6. **Validation**: The device uses the newly provisioned credentials to connect to nRF Cloud CoAP services. |
| 24 | + |
| 25 | +> [!NOTE] |
| 26 | +> The modem must be offline during credential writing because the modem cannot be connected to the network while data is being written to its storage area (credential writing). |
| 27 | +> Therefore its normal that LTE is disconnected/connected multiple times during provisioning. |
| 28 | +> |
| 29 | +> The attestation token is different from the JWT - it's used during the initial device claiming process to prove device authenticity to nRF Cloud, not during the provisioning protocol itself. |
| 30 | +
|
| 31 | +For more details on the provisioning library, see the [nRF Cloud device provisioning documentation](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/networking/nrf_provisioning.html). |
| 32 | + |
| 33 | +</details> |
| 34 | + |
5 | 35 | ## Manual Provisioning |
6 | 36 |
|
7 | 37 | 1. Get the device attestation token: |
@@ -36,6 +66,19 @@ Device provisioning establishes credentials for secure communication with nRF Cl |
36 | 66 |
|
37 | 67 | 1. Once connected, the device will be available under the **Devices** section in the **Device Management** navigation pane on the left. |
38 | 68 |
|
| 69 | + <details> |
| 70 | + <summary><strong>What can I do after provisioning?</strong></summary> |
| 71 | + |
| 72 | + After your device is provisioned and connected, you can: |
| 73 | + |
| 74 | + - **Monitor device data**: View real-time data from your device including location, temperature, battery percentage, and other sensor readings in the nRF Cloud portal. |
| 75 | + |
| 76 | + - **Retrieve data programmatically**: Use the [Message Routing Service](https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/MessagesAndAlerts/MessageRoutingService/ReceivingMessages.html) to automatically forward device messages to your own cloud infrastructure or application endpoints. |
| 77 | + |
| 78 | + - **Perform firmware updates**: Deploy over-the-air firmware updates to your device. See [Firmware Updates (FOTA)](fota.md) for detailed instructions on preparing and deploying firmware updates via nRF Cloud. |
| 79 | + |
| 80 | + </details> |
| 81 | + |
39 | 82 | ### REST API Alternative |
40 | 83 |
|
41 | 84 | You can also use the REST API as an alternative for provisioning by running the following command: |
|
0 commit comments