Skip to content

Commit e2b9396

Browse files
juhaylinenSeppoTakalo
authored andcommitted
samples: nrf_provisioning: Update documentation and configuration
Improve documentation and add instructions how to test nrfCloud auto-onboarding. Add overlay to handle large certificates from nrfCloud. Change maximum number of provisioning commands to reduce RAM usage. Update coap_client configuration. Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
1 parent c69834f commit e2b9396

File tree

4 files changed

+48
-13
lines changed

4 files changed

+48
-13
lines changed

samples/cellular/nrf_provisioning/README.rst

+39-11
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ Overview
2828

2929
The sample shows how the device performs the following actions:
3030

31-
* Connects to nRF Cloud Provisioning Service.
32-
* Fetches available device-specific provisioning configuration.
33-
* Decodes the commands.
34-
* Acts on any AT commands, if available.
31+
* Connects to the nRF Cloud Provisioning Service.
32+
* Retrieves the device-specific provisioning configuration.
33+
* Decodes the received commands.
34+
* Executes any AT commands, if present.
3535
* Reports the results back to the server.
36-
In the case of an error, stops processing the commands at the first error and reports it back to server.
37-
* Sends ``FINISHED`` response if all the previous commands are executed without errors provided and ``FINISHED`` is one of the set provisioning commands.
36+
If an error occurs, stops processing further commands and reports the error to the server.
37+
* Sends a ``FINISHED`` response if all commands are executed successfully and ``FINISHED`` is one of the provisioning commands.
3838

3939
User interface
4040
**************
4141

42-
Device side interaction is not required.
43-
You must define the provisioning configuration at the server side.
44-
See `nRF Cloud provisioning configuration`_.
42+
No user interaction with the device is required.
43+
Provisioning configuration must be defined on the server side.
44+
Refer to `nRF Cloud device claiming`_ and `nRF Cloud provisioning configuration`_ for more details.
4545

4646
Configuration
4747
*************
@@ -115,6 +115,7 @@ The following files are available:
115115
* :file:`prj.conf` - Standard default configuration file.
116116
* :file:`overlay-coap.conf` - Enables CoAP transfer protocol support.
117117
* :file:`overlay-at_shell.conf` - Enables writing of large certificates from AT shell.
118+
* :file:`overlay-large_cert.conf` - Adjusts buffer sizes to handle nRF Cloud certificates.
118119

119120
Building and running
120121
********************
@@ -130,8 +131,7 @@ Testing
130131

131132
#. |connect_kit|
132133
#. |connect_terminal|
133-
#. Add a provisioning configuration using the nRF Cloud Provisioning Service.
134-
See `nRF Cloud provisioning configuration`.
134+
#. Add a provisioning configuration using the `nRF Cloud Provisioning Service <nRF Cloud provisioning configuration_>`_.
135135
#. Power on or reset your device.
136136
#. Observe that the sample starts and connects to the LTE network.
137137
#. Observe that provisioning pauses and resumes while fetching and executing provisioning commands.
@@ -172,6 +172,34 @@ The following is an example output when the sample is processing commands from t
172172
<inf> nrf_provisioning_sample: Provisioning done, rebooting...
173173
<inf> nrf_provisioning: Disconnected from network - provisioning paused
174174
175+
Provisioning with the nRF Cloud Provisioning Service using auto-onboarding
176+
==========================================================================
177+
178+
Auto-onboarding is the easiest method to provision and onboard devices to the nRF Cloud.
179+
180+
To enable support of large certificates when building the sample, add the ``-DEXTRA_CONF_FILE=overlay-large_cert.conf`` option to the build command.
181+
182+
Complete the following steps to provision your device:
183+
184+
1. |connect_kit|
185+
#. |connect_terminal|
186+
#. Enter command ``nrf_provisioning token`` to generate an `attestation token <nRF Cloud Generating attestation tokens_>`_ for the device
187+
#. Copy the content of the response.
188+
#. Log in to the `nRF Cloud`_ portal.
189+
#. Select **Security Services** in the left sidebar.
190+
A panel opens to the right.
191+
#. Select :guilabel:`Claimed Devices`.
192+
#. Click :guilabel:`Claim Device`.
193+
A pop-up opens.
194+
#. Copy and paste the attestation token into the **Claim token** text box.
195+
#. Select an existing provisioning rule or create a new rule to auto-onboard the device during the claiming process.
196+
#. Click :guilabel:`Claim Device`.
197+
The device is now claimed and an entry appears on the **Claimed Devices** page.
198+
#. Open the Serial Terminal and enter command ``nrf_provisioning now`` to start the provisioning process.
199+
The device connects to the nRF Cloud Provisioning Service and retrieves the provisioning configuration.
200+
201+
Refer to `nRF Cloud device claiming`_ for more details on managing claimed devices.
202+
175203
Dependencies
176204
************
177205

samples/cellular/nrf_provisioning/overlay-coap.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ CONFIG_COAP=y
88
CONFIG_COAP_EXTENDED_OPTIONS_LEN=y
99
CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=64
1010
CONFIG_COAP_CLIENT=y
11-
CONFIG_COAP_CLIENT_MESSAGE_SIZE=1536
11+
CONFIG_COAP_CLIENT_BLOCK_SIZE=512
12+
CONFIG_COAP_CLIENT_MESSAGE_SIZE=1024
13+
CONFIG_COAP_CLIENT_STACK_SIZE=2048
1214

1315
CONFIG_NET_IPV6=n
1416
CONFIG_NET_IPV4=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Adjust provisioning and buffer sizes to handle nRF Cloud certs
2+
CONFIG_NRF_PROVISIONING_RX_BUF_SZ=4096
3+
CONFIG_NRF_PROVISIONING_TX_BUF_SZ=4096
4+
CONFIG_NRF_PROVISIONING_CODEC_AT_CMD_LEN=2048
5+
CONFIG_NRF_PROVISIONING_CODEC_RX_SZ_START=2048

samples/cellular/nrf_provisioning/prj.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CONFIG_ZCBOR=y
2222
CONFIG_ZCBOR_CANONICAL=y
2323

2424
# Max provisioning commands per response
25-
CONFIG_NRF_PROVISIONING_CBOR_RECORDS=20
25+
CONFIG_NRF_PROVISIONING_CBOR_RECORDS=10
2626

2727
# Maximum length between provisioning requests
2828
CONFIG_NRF_PROVISIONING_INTERVAL_S=86400

0 commit comments

Comments
 (0)