Issues connecting nRF9151-DK to nRF cloud

I am following the Cellular IoT Fundamentals course and trying to get my nRF9151-DK set up as a device in the nRF cloud. (https://academy.nordicsemi.com/courses/cellular-iot-fundamentals/lessons/lesson-1-cellular-fundamentals/topic/lesson-1-exercise-1/

I am in the United States and coverage technically should not be an issue. I am using the Conexa sim card that was provided with the nRF9151-DK.


Every time I try to add the device to the cloud I am getting "There was an error adding your device: No device found for this id. The device has not yet been just-in-time provisioned."

This is what the serial terminal is printing out while I am trying to connect the device to the cloud:

[00:00:00.254,364] <inf> spi_nor: gd25wb256e3ir@1: 32 MiBy flash
*** Booting Asset Tracker Template v1.2.1-6f28a0a6d8b0 ***
*** Using nRF Connect SDK v3.1.99-234f4874371b ***
*** Using Zephyr OS v4.1.99-1d73d0e3cb5f ***
[00:00:00.262,359] <dbg> main: main: Main has started
[00:00:00.262,420] <dbg> main: running_entry: running_entry
[00:00:00.262,451] <dbg> main: passthrough_mode_entry: passthrough_mode_entry
[00:00:00.262,481] <dbg> main: passthrough_disconnected_entry: passthrough_disconnected_entry
[00:00:00.263,275] <dbg> cloud: cloud_module_thread: Cloud module task started
[00:00:00.263,336] <dbg> cloud: state_running_entry: state_running_entry
[00:00:00.263,397] <inf> nrf_provisioning_coap: Init CoAP client
[00:00:00.264,068] <dbg> cloud: state_disconnected_entry: state_disconnected_entry
[00:00:00.264,404] <dbg> main: passthrough_disconnected_entry: passthrough_disconnected_entry
[00:00:00.264,770] <dbg> fota: fota_module_thread: FOTA module task started
[00:00:00.264,862] <dbg> fota: state_running_entry: state_running_entry
[00:00:00.265,655] <dbg> fota: state_waiting_for_poll_request_entry: state_waiting_for_poll_request_entry
[00:00:00.265,808] <dbg> location_module: location_module_thread: Location module task started
[00:00:00.265,869] <dbg> location_module: state_running_entry: state_running_entry
[00:00:00.266,510] <dbg> location_module: state_running_entry: Location library initialized
[00:00:00.266,632] <dbg> network: state_running_entry: state_running_entry
[00:00:00.266,662] <inf> network: Bringing network interface up and connecting to the network
[00:00:00.524,108] <inf> nrf_modem_lib_trace: Trace thread ready
[00:00:00.532,043] <inf> nrf_modem_lib_trace: Trace level override: 2
[00:00:00.641,906] <dbg> nrf_provisioning: cert_provision: Certificate already provisioned
[00:00:00.642,120] <dbg> network: state_running_entry: Network module started
[00:00:00.642,150] <dbg> network: state_disconnected_entry: state_disconnected_entry
[00:00:00.642,150] <dbg> network: state_disconnected_searching_entry: state_disconnected_searching_entry
[00:00:07.607,879] <dbg> network: lte_lc_evt_handler: PSM parameters received, TAU: 7200, Active time: 6
[00:00:07.608,398] <dbg> nrf_provisioning: l4_event_handler: Connected to network
[00:00:07.608,398] <inf> network: Network connectivity established
[00:00:07.608,978] <dbg> cloud: state_connecting_entry: state_connecting_entry
[00:00:07.609,008] <dbg> cloud: state_connecting_attempt_entry: state_connecting_attempt_entry
[00:00:07.609,039] <dbg> cloud: state_connecting_provisioned_entry: state_connecting_provisioned_entry
[00:00:07.609,558] <dbg> network: state_connected_entry: state_connected_entry
[00:00:07.732,788] <inf> cloud: Connecting to nRF Cloud CoAP with client ID: 50343956-3037-426f-80b4-1f1e4580ecb3
[00:00:08.826,232] <err> nrf_cloud_coap_transport: Could not connect to nRF Cloud CoAP server coap.nrfcloud.com, port: 13334. err: -111
[00:00:08.826,263] <wrn> cloud: nrf_cloud_coap_connect, error: -111
[00:00:08.826,263] <wrn> cloud: nRF Cloud CoAP connection failed, unauthorized or invalid credentials
[00:00:08.826,538] <dbg> cloud: state_connecting_provisioning_entry: state_connecting_provisioning_entry
[00:00:08.827,056] <dbg> nrf_provisioning: nrf_provisioning_trigger_manually: Externally initiated provisioning
[00:00:08.827,301] <dbg> location_module: handle_location_chan: Location search cancel received, cancelling location request
[00:00:08.827,331] <dbg> location_module: handle_location_chan: Location request cancelled successfully
[00:00:08.827,789] <dbg> nrf_provisioning: nrf_provisioning_work: nrf_provisioning_work() called
[00:00:08.827,819] <dbg> nrf_provisioning: wait_for_valid_datetime: Valid date time obtained
[00:00:08.827,880] <dbg> nrf_provisioning_coap: socket_connect: CoAP host: coap.nrfcloud.com
[00:00:08.829,101] <dbg> nrf_provisioning_coap: socket_connect: getaddrinfo status: 0
[00:00:08.829,162] <dbg> nrf_provisioning_coap: socket_connect: fd: -1
[00:00:08.829,223] <dbg> nrf_provisioning_coap: socket_connect: getaddrinfo() 23.22.110.24
[00:00:08.829,589] <inf> nrf_provisioning_coap: DTLS setup
[00:00:10.493,530] <inf> nrf_provisioning_coap: Connected
[00:00:10.494,415] <dbg> nrf_provisioning_jwt: nrf_provisioning_jwt_generate: Generating JWT
[00:00:10.613,403] <dbg> nrf_provisioning_coap: authenticate: Authenticate
[00:00:10.614,562] <dbg> nrf_provisioning_coap: authenticate: Path: p/auth-jwt?mver=nrf91x1_2.0.2&cver=3.1.99
[00:00:10.978,637] <dbg> nrf_provisioning_coap: coap_callback: Callback code 129
[00:00:10.978,637] <dbg> nrf_provisioning_coap: coap_callback: Last packet received
[00:00:10.978,759] <dbg> nrf_provisioning_coap: authenticate: Response code 129
[00:00:10.978,759] <err> nrf_provisioning_coap: Device didn't send auth credentials
[00:00:10.980,407] <wrn> nrf_provisioning: Unauthorized access: device is not yet claimed.
[00:00:11.062,957] <wrn> cloud: Provisioning failed, device not claimed
[00:00:11.062,988] <wrn> cloud: Claim the device using the device's attestation token on nrfcloud.com
[00:00:11.063,079] <wrn> cloud: 

2dn3hQFQUDQ5VjA3Qm-AtB8eRYDsswZQMgF21Z9ARfySOyZh7BjVR1A01_PcJa-WnF049nB_4rxD.0oRDoQEmoQRBIfZYQNUgzlIJAfrAPo0Lq77xPaGR2BaXqQBMBzzg2lrBMh785vqMot6HfigEBk59bZXe7JYyxczHRzikTC23hbeGLLo

[00:00:11.063,934] <dbg> cloud: state_connecting_backoff_entry: state_connecting_backoff_entry
[00:00:11.063,964] <dbg> cloud: calculate_backoff_time: Backoff time: 60 seconds
[00:00:11.063,964] <wrn> cloud: Connection attempt failed, backoff time: 60 seconds
[00:01:11.064,331] <dbg> cloud: state_connecting_backoff_exit: state_connecting_backoff_exit
[00:01:11.064,392] <dbg> cloud: state_connecting_attempt_entry: state_connecting_attempt_entry
[00:01:11.064,453] <dbg> cloud: state_connecting_provisioning_entry: state_connecting_provisioning_entry
[00:01:11.064,941] <dbg> nrf_provisioning: nrf_provisioning_trigger_manually: Externally initiated provisioning
[00:01:11.065,155] <dbg> location_module: handle_location_chan: Location search cancel received, cancelling location request
[00:01:11.065,185] <dbg> location_module: handle_location_chan: Location request cancelled successfully
[00:01:11.065,551] <dbg> nrf_provisioning: nrf_provisioning_work: nrf_provisioning_work() called
[00:01:11.065,612] <dbg> nrf_provisioning: wait_for_valid_datetime: Valid date time obtained
[00:01:11.065,643] <dbg> nrf_provisioning_coap: socket_connect: CoAP host: coap.nrfcloud.com
[00:01:11.748,199] <dbg> nrf_provisioning_coap: socket_connect: getaddrinfo status: 0
[00:01:11.748,229] <dbg> nrf_provisioning_coap: socket_connect: fd: -1
[00:01:11.748,291] <dbg> nrf_provisioning_coap: socket_connect: getaddrinfo() 34.200.153.177
[00:01:11.749,176] <inf> nrf_provisioning_coap: DTLS setup
[00:01:13.519,470] <inf> nrf_provisioning_coap: Connected
[00:01:13.520,599] <dbg> nrf_provisioning_jwt: nrf_provisioning_jwt_generate: Generating JWT
[00:01:13.643,524] <dbg> nrf_provisioning_coap: authenticate: Authenticate
[00:01:13.644,317] <dbg> nrf_provisioning_coap: authenticate: Path: p/auth-jwt?mver=nrf91x1_2.0.2&cver=3.1.99
[00:01:14.007,843] <dbg> nrf_provisioning_coap: coap_callback: Callback code 129
[00:01:14.007,843] <dbg> nrf_provisioning_coap: coap_callback: Last packet received
[00:01:14.007,965] <dbg> nrf_provisioning_coap: authenticate: Response code 129
[00:01:14.007,995] <err> nrf_provisioning_coap: Device didn't send auth credentials
[00:01:14.009,796] <wrn> nrf_provisioning: Unauthorized access: device is not yet claimed.
[00:01:14.094,390] <wrn> cloud: Provisioning failed, device not claimed
[00:01:14.094,421] <wrn> cloud: Claim the device using the device's attestation token on nrfcloud.com
[00:01:14.094,512] <wrn> cloud: 

2dn3hQFQUDQ5VjA3Qm-AtB8eRYDsswZQMgF21Z9ARfySOyZh7BjVR1Bo8raqgHUCH48sWedUjw-S.0oRDoQEmoQRBIfZYQBd-flFPyt_pZ8SkPwHcNLevGXBCC4lOsYPm-3n1fOhwjs1yRxOmKUP_Xgq6H7XaSoGS8GsJ6M2eoyVDWyeWRfA

[00:01:14.095,397] <dbg> cloud: state_connecting_backoff_entry: state_connecting_backoff_entry
[00:01:14.095,428] <dbg> cloud: calculate_backoff_time: Backoff time: 120 seconds
[00:01:14.095,428] <wrn> cloud: Connection attempt failed, backoff time: 120 seconds
[00:03:14.095,764] <dbg> cloud: state_connecting_backoff_exit: state_connecting_backoff_exit
[00:03:14.095,794] <dbg> cloud: state_connecting_attempt_entry: state_connecting_attempt_entry
[00:03:14.095,886] <dbg> cloud: state_connecting_provisioning_entry: state_connecting_provisioning_entry
[00:03:14.096,343] <dbg> nrf_provisioning: nrf_provisioning_trigger_manually: Externally initiated provisioning
[00:03:14.096,557] <dbg> location_module: handle_location_chan: Location search cancel received, cancelling location request
[00:03:14.096,618] <dbg> location_module: handle_location_chan: Location request cancelled successfully
[00:03:14.096,954] <dbg> nrf_provisioning: nrf_provisioning_work: nrf_provisioning_work() called
[00:03:14.097,015] <dbg> nrf_provisioning: wait_for_valid_datetime: Valid date time obtained
[00:03:14.097,076] <dbg> nrf_provisioning_coap: socket_connect: CoAP host: coap.nrfcloud.com
[00:03:14.948,242] <dbg> nrf_provisioning_coap: socket_connect: getaddrinfo status: 0
[00:03:14.948,272] <dbg> nrf_provisioning_coap: socket_connect: fd: -1
[00:03:14.948,333] <dbg> nrf_provisioning_coap: socket_connect: getaddrinfo() 34.200.153.177
[00:03:14.949,523] <inf> nrf_provisioning_coap: DTLS setup
[00:03:16.981,781] <inf> nrf_provisioning_coap: Connected
[00:03:16.982,604] <dbg> nrf_provisioning_jwt: nrf_provisioning_jwt_generate: Generating JWT
[00:03:17.101,623] <dbg> nrf_provisioning_coap: authenticate: Authenticate
[00:03:17.102,661] <dbg> nrf_provisioning_coap: authenticate: Path: p/auth-jwt?mver=nrf91x1_2.0.2&cver=3.1.99
[00:03:17.488,830] <dbg> nrf_provisioning_coap: coap_callback: Callback code 129
[00:03:17.488,861] <dbg> nrf_provisioning_coap: coap_callback: Last packet received
[00:03:17.488,952] <dbg> nrf_provisioning_coap: authenticate: Response code 129
[00:03:17.488,983] <err> nrf_provisioning_coap: Device didn't send auth credentials
[00:03:17.490,722] <wrn> nrf_provisioning: Unauthorized access: device is not yet claimed.
[00:03:17.573,608] <wrn> cloud: Provisioning failed, device not claimed
[00:03:17.573,608] <wrn> cloud: Claim the device using the device's attestation token on nrfcloud.com
[00:03:17.573,730] <wrn> cloud: 

2dn3hQFQUDQ5VjA3Qm-AtB8eRYDsswZQMgF21Z9ARfySOyZh7BjVR1Dc2bbBd7e3vkkUmwJdWXVJ.0oRDoQEmoQRBIfZYQKuFor7cz9iikGoAIhc15vRhX3q-0VoSK3GW-SQSNus2DdFiXIFAQm-oPn0JMplkHH25M1daPg4jDqiHsJp-Rs0

[00:03:17.574,554] <dbg> cloud: state_connecting_backoff_entry: state_connecting_backoff_entry
[00:03:17.574,584] <dbg> cloud: calculate_backoff_time: Backoff time: 180 seconds
[00:03:17.574,584] <wrn> cloud: Connection attempt failed, backoff time: 180 seconds

How can I get this device to connect to the cloud?

  • Hi Artiom,
    You’re seeing this because the device isn’t connected to the internet and therefore has not done provisioning. Could you try using Asset Tracker V2 instead of the Asset Tracker template and then share the logs?

    Best regards,
    Benjamin

  • Hi Benjamin!

    This is what I am seeing in the logs after a few minutes with the Asset Tracker V2. (I am still getting the error trying to add the device to the cloud.)

    *** Booting nRF Connect SDK v2.8.0-a2386bfc8401 ***
    *** Using Zephyr OS v3.7.99-0bc3393fb112 ***
    Attempting to boot slot 0.
    Attempting to boot from address 0x8200.
    I: Verifying signature against key 0.
    I: Hash: 0x87...96
    I: Firmware signature verified.
    Firmware version 1
    *** Booting My Application v2.1.0-dev-4594a8693738 ***
    *** Using nRF Connect SDK v2.8.0-a2386bfc8401 ***
    *** Using Zephyr OS v3.7.99-0bc3393fb112 ***
    I: Starting bootloader
    I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Boot source: none
    I: Image index: 0, Swap type: none
    I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Boot source: none
    I: Image index: 1, Swap type: none
    I: Bootloader chainload address offset: 0x38000
    [00:00:00.253,601] <inf> spi_nor: gd25wb256e3ir@1: 32 MiBy flash
    *** Booting nRF Connect SDK v2.8.0-a2386bfc8401 ***
    *** Using Zephyr OS v3.7.99-0bc3393fb112 ***
    [00:00:00.256,958] <inf> app_event_manager: APP_EVT_START
    [00:00:00.517,669] <inf> nrf_modem_lib_trace: Trace thread ready
    [00:00:00.525,604] <inf> nrf_modem_lib_trace: Trace level override: 2
    [00:00:00.525,848] <inf> app_event_manager: MODEM_EVT_INITIALIZED
    [00:00:00.538,208] <inf> nrf_cloud_info: Device ID: nrf-359404230138597
    [00:00:00.591,827] <inf> nrf_cloud_info: IMEI:      359404230138597
    [00:00:00.600,311] <inf> nrf_cloud_info: Modem FW:  mfw_nrf91x1_2.0.2
    [00:00:00.600,372] <inf> nrf_cloud_info: Protocol:          MQTT
    [00:00:00.600,402] <inf> nrf_cloud_info: Download protocol: HTTPS
    [00:00:00.600,433] <inf> nrf_cloud_info: Sec tag:           16842753
    [00:00:00.600,463] <inf> nrf_cloud_info: Host name:         mqtt.nrfcloud.com
    [00:00:00.732,421] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTING
    [00:00:01.258,422] <inf> app_event_manager: DATA_EVT_CONFIG_INIT
    +CGEV: EXCE STATUS 0
    %CESQ: 50,2,15,2
    +CEREG: 2,"291F","02C3D405",7
    [00:00:03.531,372] <inf> app_event_manager: MODEM_EVT_LTE_CELL_UPDATE
    %MDMEV: PRACH CE-LEVEL 0
    +CSCON: 1
    %CESQ: 51,2,20,2
    +CGEV: ME PDN ACT 0,0
    [00:00:06.816,040] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTED
    [00:00:06.817,687] <inf> app_event_manager: CLOUD_EVT_CONNECTING
    +CNEC_ESM: 50,0
    %MDMEV: SEARCH STATUS 2
    +CEREG: 5,"291F","02C3D405",7,,,"00001010","11000001"
    %XTIME: "4A","5290420214944A","01"
    [00:00:06.917,419] <inf> app_event_manager: MODEM_EVT_LTE_PSM_UPDATE
    [00:00:06.918,060] <inf> app_event_manager: DATA_EVT_DATE_TIME_OBTAINED
    [00:00:10.152,252] <inf> app_event_manager: CLOUD_EVT_CONFIG_RECEIVED
    [00:00:10.155,639] <inf> app_event_manager: DATA_EVT_CONFIG_SEND
    [00:00:10.157,257] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    [00:00:10.158,538] <wrn> nrf_cloud_integration: NRF_CLOUD_EVT_USER_ASSOCIATION_REQUEST
    [00:00:10.158,569] <wrn> nrf_cloud_integration: Add the device to nRF Cloud to complete user association
    [00:00:10.158,660] <inf> app_event_manager: CLOUD_EVT_USER_ASSOCIATION_REQUEST
    +CEREG: 5,"291F","02C3D405",7,,,"11100000","11100000"
    [00:00:10.457,977] <inf> app_event_manager: MODEM_EVT_LTE_PSM_UPDATE
    %CESQ: 51,2,15,2
    +CSCON: 0
    [00:00:26.157,592] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    %MDMEV: PRACH CE-LEVEL 0
    +CSCON: 1
    %CESQ: 51,2,22,3
    %CESQ: 51,2,17,2
    +CSCON: 0
    %CESQ: 50,2,11,1
    %CESQ: 50,2,16,2
    [00:00:42.157,714] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    %MDMEV: PRACH CE-LEVEL 0
    +CSCON: 1
    +CSCON: 0
    %CESQ: 50,2,11,1
    %CESQ: 51,2,17,2
    %CESQ: 51,2,12,1
    %MDMEV: PRACH CE-LEVEL 0
    +CSCON: 1
    %CESQ: 51,2,18,2
    %CESQ: 51,2,13,1
    %CESQ: 51,2,20,2
    +CSCON: 0
    %CESQ: 51,2,11,1
    %CESQ: 51,2,16,2
    %MDMEV: PRACH CE-LEVEL 0
    +CSCON: 1
    +CSCON: 0
    %CESQ: 51,2,11,1
    %CESQ: 50,2,17,2
    %MDMEV: PRACH CE-LEVEL 0
    +CSCON: 1
    %CESQ: 50,2,23,3
    %CESQ: 50,2,18,2
    +CSCON: 0
    %CESQ: 50,2,13,1
    %MDMEV: PRACH CE-LEVEL 0
    +CSCON: 1
    %CESQ: 49,2,18,2
    %CESQ: 50,2,24,3
    %CESQ: 50,2,19,2
    %CESQ: 50,2,25,3
    +CSCON: 0
    %CESQ: 49,2,20,2


  • After trying to connect it to the cloud on the next day it finally worked with the V2, thanks!

Related