Skip to content

Commit b647c4f

Browse files
committed
samples: nrf_cloud: review docs for cell_location
Fix issues found in the documentation of the cell location samples. Add examples of connection errors. Signed-off-by: Maximilian Deubel <[email protected]>
1 parent d0f84cb commit b647c4f

File tree

6 files changed

+64
-33
lines changed

6 files changed

+64
-33
lines changed

samples/cellular/nrf_cloud_coap_cell_location/README.rst

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,8 @@ If it is not, follow the instructions in `Device on-boarding <nrf_cloud_coap_cel
2525
Overview
2626
********
2727

28-
The sample works in both single-cell and multi-cell mode.
29-
30-
After the sample initializes and connects to the network, it enters the single-cell mode and sends a single-cell location request to nRF Cloud.
31-
For this purpose, the sample uses network data obtained from the :ref:`modem_info_readme` library.
32-
In the multi-cell mode, the sample requests for neighbor cell measurement using the :ref:`lte_lc_readme` library.
33-
34-
If the modem provides neighbor cell data, the sample sends a multi-cell location request to nRF Cloud.
35-
Otherwise, the request is single-cell.
36-
37-
In either mode, the sample sends a new location request if a change in cell ID is detected.
28+
After the sample initializes and connects to the network, it sends a cell location request to nRF Cloud.
29+
For this purpose, the sample uses network data obtained from the :ref:`lib_location` library.
3830

3931
See the `nRF Cloud Location Services documentation`_ page for additional information.
4032

@@ -137,6 +129,26 @@ The network carrier does not provide date and time
137129
The sample requires the network carrier to provide date and time to the modem.
138130
Without a valid date and time, the modem cannot generate JWTs with an expiration time.
139131

132+
Credentials are missing on the configured sec tag:
133+
134+
.. note::
135+
136+
CoAP connections require a different root CA certificate compared to REST and MQTT.
137+
It is possible to provision both certificates on the same sec tag.
138+
139+
.. code-block:: console
140+
141+
[00:00:03.067,291] <err> nrf_cloud_coap_transport: Could not connect to nRF Cloud CoAP server coap.nrfcloud.com, port: 5684. err: -111
142+
[00:00:03.067,321] <err> nrf_cloud_coap_cell_location_sample: Connecting to nRF Cloud failed, error: -111
143+
144+
Credentials are not registered or the device ID does not match the registered one:
145+
146+
.. code-block:: console
147+
148+
[00:00:05.081,756] <err> nrf_cloud_coap_transport: Device not authenticated; reconnection required.
149+
[00:00:05.081,787] <inf> nrf_cloud_coap_transport: Authorization result_code: 4.01
150+
[00:00:05.583,435] <err> nrf_cloud_coap_cell_location_sample: Connecting to nRF Cloud failed, error: -13
151+
140152
Dependencies
141153
************
142154

samples/cellular/nrf_cloud_coap_cell_location/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ int main(void)
176176

177177
k_sem_take(&lte_connected, K_FOREVER);
178178

179-
/* A-GNSS/P-GPS needs to know the current time. */
179+
/* JWT authentication requires a valid time. */
180180
if (IS_ENABLED(CONFIG_DATE_TIME)) {
181181
LOG_INF("Waiting for current time");
182182

samples/cellular/nrf_cloud_mqtt_cell_location/README.rst

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,8 @@ If it is not, follow the instructions in `Device on-boarding <nrf_cloud_mqtt_cel
2525
Overview
2626
********
2727

28-
The sample works in both single-cell and multi-cell mode.
29-
30-
After the sample initializes and connects to the network, it enters the single-cell mode and sends a single-cell location request to nRF Cloud.
31-
For this purpose, the sample uses network data obtained from the :ref:`modem_info_readme` library.
32-
In the multi-cell mode, the sample requests for neighbor cell measurement using the :ref:`lte_lc_readme` library.
33-
34-
If the modem provides neighbor cell data, the sample sends a multi-cell location request to nRF Cloud.
35-
Otherwise, the request is single-cell.
36-
37-
In either mode, the sample sends a new location request if a change in cell ID is detected.
28+
After the sample initializes and connects to the network, it sends a cell location request to nRF Cloud.
29+
For this purpose, the sample uses network data obtained from the :ref:`lib_location` library.
3830

3931
See the `nRF Cloud Location Services documentation`_ page for additional information.
4032

@@ -131,6 +123,21 @@ The network carrier does not provide date and time
131123
The sample requires the network carrier to provide date and time to the modem.
132124
Without a valid date and time, the modem cannot generate JWTs with an expiration time.
133125

126+
Credentials are missing on the configured sec tag:
127+
128+
.. code-block:: console
129+
130+
[00:00:03.698,913] <err> nrf_cloud_transport: Could not connect to nRF Cloud MQTT Broker mqtt.nrfcloud.com, port: 8883. err: -111
131+
[00:00:03.698,974] <err> nrf_cloud_mqtt_cell_location_sample: NRF_CLOUD_EVT_TRANSPORT_CONNECT_ERROR: -9
132+
133+
Credentials are not registered or the device ID does not match the registered one:
134+
135+
.. code-block:: console
136+
137+
[00:00:08.287,078] <err> nrf_cloud_transport: MQTT input error: -128
138+
[00:00:08.287,139] <err> nrf_cloud_transport: Error disconnecting from cloud: -128
139+
[00:00:08.287,170] <err> nrf_cloud_mqtt_cell_location_sample: NRF_CLOUD_EVT_TRANSPORT_DISCONNECTED
140+
134141
Dependencies
135142
************
136143

samples/cellular/nrf_cloud_mqtt_cell_location/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ int main(void)
219219

220220
k_sem_take(&lte_connected, K_FOREVER);
221221

222-
/* A-GNSS/P-GPS needs to know the current time. */
222+
/* Waiting for valid time. */
223223
if (IS_ENABLED(CONFIG_DATE_TIME)) {
224224
LOG_INF("Waiting for current time");
225225

samples/cellular/nrf_cloud_rest_cell_location/README.rst

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,8 @@ If it is not, follow the instructions in `Device on-boarding <nrf_cloud_rest_cel
2525
Overview
2626
********
2727

28-
The sample works in both single-cell and multi-cell mode.
29-
30-
After the sample initializes and connects to the network, it enters the single-cell mode and sends a single-cell location request to nRF Cloud.
31-
For this purpose, the sample uses network data obtained from the :ref:`modem_info_readme` library.
32-
In the multi-cell mode, the sample requests for neighbor cell measurement using the :ref:`lte_lc_readme` library.
33-
34-
If the modem provides neighbor cell data, the sample sends a multi-cell location request to nRF Cloud.
35-
Otherwise, the request is single-cell.
36-
37-
In either mode, the sample sends a new location request if a change in cell ID is detected.
28+
After the sample initializes and connects to the network, it sends a cell location request to nRF Cloud.
29+
For this purpose, the sample uses network data obtained from the :ref:`lib_location` library.
3830

3931
See the `nRF Cloud Location Services documentation`_ page for additional information.
4032

@@ -133,6 +125,26 @@ The network carrier does not provide date and time
133125
The sample requires the network carrier to provide date and time to the modem.
134126
Without a valid date and time, the modem cannot generate JWTs with an expiration time.
135127

128+
Credentials are missing on the configured sec tag:
129+
130+
.. code-block:: console
131+
132+
[00:00:02.738,159] <err> nrf_cloud_jwt: Failed to generate JWT, error: -8
133+
[00:00:02.745,574] <err> nrf_cloud_rest: Failed to auto-generate JWT, error: -8
134+
[00:00:02.753,601] <err> nrf_cloud_rest: Could not format HTTP auth header, err: -8
135+
[00:00:02.761,962] <err> nrf_cloud_rest_cell_location_sample: Request failed, error: -8
136+
137+
Credentials are not registered or the device ID does not match the registered one:
138+
139+
.. code-block:: console
140+
141+
[00:00:07.062,957] <err> nrf_cloud_codec_internal: REST error msg: Auth token is malformed.
142+
[00:00:07.071,990] <err> nrf_cloud_rest: nRF Cloud REST error code: 40100
143+
[00:00:07.079,437] <err> nrf_cloud_rest: REST request was rejected. Response status: 401
144+
[00:00:07.088,226] <err> nrf_cloud_rest: Response body: {"message":"Auth token is malformed.","code":40100}
145+
[00:00:07.098,846] <err> nrf_cloud_rest_cell_location_sample: Request failed, error: -77
146+
[00:00:07.107,574] <err> nrf_cloud_rest_cell_location_sample: nRF Cloud error code: 40100
147+
136148
Dependencies
137149
************
138150

samples/cellular/nrf_cloud_rest_cell_location/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ int main(void)
189189

190190
k_sem_take(&lte_connected, K_FOREVER);
191191

192-
/* A-GNSS/P-GPS needs to know the current time. */
192+
/* JWT authentication requires a valid time. */
193193
if (IS_ENABLED(CONFIG_DATE_TIME)) {
194194
LOG_INF("Waiting for current time");
195195

0 commit comments

Comments
 (0)