nRF Cloud Multi-service Quick Start is Working, But compiling with nRF7002 Shield can't connect to nRF Cloud

Hi,

I am using a nRF9161-dk with the nRF7002-ek shield WiFi tracking.

Using the nRF Connect Quick-Start, I downloaded the nRF Cloud Multi-service application and went through provisioning, and I can see my device on my nRF Cloud account, using the cellular and GPS tracking.

Because I need to review the nRF7002 WiFi Tracking with the Shield device, I downloaded the source code and added the extra configs and selected the shield.

-DSHIELD=nrf7002ek_nrf7000 -DSB_CONF_FILE=sysbuild_nrf700x-wifi-scan.conf -DEXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf

This compiles OK and I can program/flash it on to my dev kit.

The application runs OK and connects to the LTE-M network, but with my own compiled version I am now getting this error:

[00:12:04.663,665] <err> nrf_cloud_transport: MQTT input error: -128
[00:12:04.663,726] <err> nrf_cloud_transport: Error disconnecting from cloud: -128
[00:12:04.663,787] <inf> cloud_connection: Disconnecting from nRF Cloud
[00:12:04.663,818] <err> cloud_connection: Could not connect to nRF Cloud
[00:12:04.663,818] <inf> cloud_connection: Retrying in 30 seconds...

I have verified the token is still valid and provisioned by using this command: AT&ATTESTTOKEN

nRF Cloud says it is valid and already claimed.

What do I need to do to the source code to allow it to connect back to my nRF Cloud account?

Thanks,

Phil.

Parents Reply Children
  • How do I enable a full application log?

    Thanks,

    Phil.

  • Hi Phil,

    The application runs OK and connects to the LTE-M network, but with my own compiled version I am now getting this error:

    I was referring to the partial log which you sent in your initial post. I am interested in seeing also the lines before "<err> nrf_cloud_transport: MQTT input error: -128".

    Best regards,
    Dejan

  • *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    [00:00:00.963,104] <inf> main: nRF Cloud multi-service sample has started, version: 1.0.0, protocol: MQTT
    [00:00:00.963,165] <inf> application: Reset reason: 0x1
    [00:00:00.963,409] <inf> cloud_connection: Enabling connectivity...
    [00:00:01.330,963] <inf> cloud_connection: Setting up nRF Cloud library...
    [00:00:01.332,855] <inf> nrf_cloud_info: Device ID: nrf-358299840048314
    [00:00:01.333,312] <inf> nrf_cloud_info: IMEI:      358299840048314
    [00:00:01.397,521] <inf> nrf_cloud_info: Modem FW:  mfw_nrf91x1_2.0.2
    [00:00:01.397,552] <inf> nrf_cloud_info: Protocol:          MQTT
    [00:00:01.397,583] <inf> nrf_cloud_info: Download protocol: HTTPS
    [00:00:01.397,583] <inf> nrf_cloud_info: Sec tag:           16842753
    [00:00:01.397,644] <inf> nrf_cloud_info: Host name:         mqtt.nrfcloud.com
    [00:00:01.797,790] <inf> nrf_cloud_credentials: Sec Tag: 16842753; CA: Yes, Client Cert: Yes, Private Key: Yes
    [00:00:01.797,851] <inf> nrf_cloud_credentials: CA Size: 1792, AWS: Likely, CoAP: Likely
    [00:00:01.797,882] <inf> cloud_connection: Waiting for network ready...
    +CGEV: EXCE STATUS 0
    %MDMEV: SEARCH STATUS 1
    %MDMEV: SEARCH STATUS 2
    +CEREG: 2
    +CEREG: 2,"01B0","07CEB478",7
    %MDMEV: PRACH CE-LEVEL 0
    +CSCON: 1
    +CGEV: ME PDN ACT 0,0
    +CNEC_ESM: 50,0
    +CEREG: 1,"01B0","07CEB478",7,,,"00001010","00011100"
    [00:02:43.875,427] <inf> cloud_connection: Network connectivity gained!
    [00:02:44.875,640] <inf> cloud_connection: Network is ready
    [00:02:44.875,671] <inf> cloud_connection: Waiting to obtain date/time
    [00:02:45.191,711] <inf> cloud_connection: Connecting to nRF Cloud
    [00:02:51.932,952] <err> nrf_cloud_transport: MQTT input error: -128
    [00:02:51.933,044] <err> nrf_cloud_transport: Error disconnecting from cloud: -128
    [00:02:51.933,074] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:02:51.933,105] <err> cloud_connection: Could not connect to nRF Cloud
    [00:02:51.933,135] <inf> cloud_connection: Retrying in 30 seconds...
    +CSCON: 0

  • Hi,

    Can you show complete build command which you used?

    There are some useful debug options in documentation. Can you try to enable debug logging for the sample using CONFIG_MULTI_SERVICE_LOG_LEVEL_DBG=y and provide new log?

    Best regards,
    Dejan

  • I'm not sure why I am now seeing a different error code (-111), but from this log it is clear that the LTE-M connection is not very good at all and is probably causing the flaky connection issues.

    I will try in a better location and hopefully that will work better Slight smile

    *** Booting My Application v2.1.0-dev-12e5ee106034 ***
    *** Using nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    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: Bootloader chainload address offset: 0x18000
    [00:00:00.751,220] <err> pcal64xxa: unable to write to register 0x02, error -5
    [00:00:00.751,251] <err> pcal64xxa: failed to reset register 02: -5
    [00:00:00.751,281] <err> pcal64xxa: pcal6408a@21: failed to apply reset state
    [00:00:00.752,685] <inf> spi_nor: gd25wb256e3ir@1: 32 MiBy flash
    [00:00:00.759,002] <inf> wifi_nrf_bus: SPIM spi@b000: freq = 8 MHz
    [00:00:00.759,033] <inf> wifi_nrf_bus: SPIM spi@b000: latency = 0
    [00:00:00.834,289] <inf> wifi_nrf: Management buffer offload enabled

    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    [00:00:00.963,043] <inf> main: nRF Cloud multi-service sample has started, version: 1.0.0, protocol: MQTT
    [00:00:00.963,104] <inf> application: Reset reason: 0x1
    [00:00:00.963,348] <inf> cloud_connection: Enabling connectivity...
    [00:00:00.963,775] <dbg> message_queue: consume_device_message: Consuming an enqueued device message
    [00:00:01.328,521] <inf> cloud_connection: Setting up nRF Cloud library...
    [00:00:01.330,322] <inf> nrf_cloud_info: Device ID: nrf-358299840048314
    [00:00:01.330,780] <inf> nrf_cloud_info: IMEI:      358299840048314
    [00:00:01.395,080] <inf> nrf_cloud_info: Modem FW:  mfw_nrf91x1_2.0.2
    [00:00:01.395,111] <inf> nrf_cloud_info: Protocol:          MQTT
    [00:00:01.395,172] <inf> nrf_cloud_info: Download protocol: HTTPS
    [00:00:01.395,172] <inf> nrf_cloud_info: Sec tag:           16842753
    [00:00:01.395,202] <inf> nrf_cloud_info: Host name:         mqtt.nrfcloud.com
    [00:00:01.795,440] <inf> nrf_cloud_credentials: Sec Tag: 16842753; CA: Yes, Client Cert: Yes, Private Key: Yes
    [00:00:01.795,471] <inf> nrf_cloud_credentials: CA Size: 1792, AWS: Likely, CoAP: Likely
    [00:00:01.795,501] <inf> cloud_connection: Waiting for network ready...
    +CGEV: EXCE STATUS 0
    +CEREG: 2,"01B0","07CEB478",7
    %MDMEV: PRACH CE-LEVEL 0
    +CSCON: 1
    +CGEV: ME PDN ACT 0,0
    +CNEC_ESM: 50,0
    %MDMEV: SEARCH STATUS 2
    +CEREG: 1,"01B0","07CEB478",7,,,"00001010","00011101"
    [00:00:05.419,799] <inf> cloud_connection: Network connectivity gained!
    [00:00:06.420,013] <inf> cloud_connection: Network is ready
    [00:00:06.420,043] <inf> cloud_connection: Waiting to obtain date/time
    [00:00:07.250,061] <inf> cloud_connection: Connecting to nRF Cloud
    [00:00:07.250,122] <dbg> cloud_connection: cloud_event_handler: NRF_CLOUD_EVT_TRANSPORT_CONNECTING
    %MDMEV: PRACH CE-LEVEL 0
    +CSCON: 0
    %MDMEV: PRACH CE-LEVEL 0
    %MDMEV: PRACH CE-LEVEL 0
    %MDMEV: PRACH CE-LEVEL 0
    %MDMEV: PRACH CE-LEVEL 1
    +CEREG: 1,"0430","0928F778",7,,,"00001010","00011101"
    %MDMEV: PRACH CE-LEVEL 0
    +CEREG: 1,"01B0","07CEB478",7,,,"00001010","00011101"
    %MDMEV: PRACH CE-LEVEL 0
    [00:01:07.257,263] <err> nrf_cloud_transport: Could not connect to nRF Cloud MQTT Broker mqtt.nrfcloud.com, port: 45858. err: -111
    [00:01:07.257,324] <dbg> cloud_connection: cloud_event_handler: NRF_CLOUD_EVT_TRANSPORT_CONNECT_ERROR: -9
    [00:01:07.257,324] <dbg> cloud_connection: clear_readiness_timeout: Stopping cloud connection readiness timeout
    [00:01:07.257,354] <dbg> cloud_connection: disconnect_cloud: Cleared CLOUD_READY and CLOUD_CONNECTED
    [00:01:07.257,385] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:01:07.257,385] <dbg> cloud_connection: disconnect_cloud: Already disconnected from nRF Cloud
    [00:01:07.257,446] <err> cloud_connection: Could not connect to nRF Cloud
    [00:01:07.257,446] <inf> cloud_connection: Retrying in 30 seconds...
    %MDMEV: PRACH CE-LEVEL 0
    %MDMEV: PRACH CE-LEVEL 0
    %MDMEV: PRACH CE-LEVEL 0
    [00:01:37.257,568] <inf> cloud_connection: Waiting for network ready...
    [00:01:37.257,598] <inf> cloud_connection: Network is ready
    [00:01:37.257,598] <inf> cloud_connection: Waiting to obtain date/time
    [00:01:37.257,629] <inf> cloud_connection: Connecting to nRF Cloud
    [00:01:37.257,690] <dbg> cloud_connection: cloud_event_handler: NRF_CLOUD_EVT_TRANSPORT_CONNECTING
    [00:02:37.267,944] <err> nrf_cloud_transport: Could not connect to nRF Cloud MQTT Broker mqtt.nrfcloud.com, port: 45858. err: -111
    [00:02:37.268,005] <dbg> cloud_connection: cloud_event_handler: NRF_CLOUD_EVT_TRANSPORT_CONNECT_ERROR: -9
    [00:02:37.268,035] <dbg> cloud_connection: clear_readiness_timeout: Stopping cloud connection readiness timeout
    [00:02:37.268,066] <dbg> cloud_connection: disconnect_cloud: Cleared CLOUD_READY and CLOUD_CONNECTED
    [00:02:37.268,066] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:02:37.268,096] <dbg> cloud_connection: disconnect_cloud: Already disconnected from nRF Cloud
    [00:02:37.268,127] <err> cloud_connection: Could not connect to nRF Cloud
    [00:02:37.268,127] <inf> cloud_connection: Retrying in 30 seconds...
    +CEREG: 4
    [00:02:51.402,465] <inf> cloud_connection: Network connectivity lost!
    [00:02:51.402,496] <dbg> cloud_connection: clear_readiness_timeout: Stopping cloud connection readiness timeout
    [00:02:51.402,526] <dbg> cloud_connection: disconnect_cloud: Cleared CLOUD_READY and CLOUD_CONNECTED
    [00:02:51.402,557] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:02:51.402,557] <dbg> cloud_connection: disconnect_cloud: Already disconnected from nRF Cloud
    +CEREG: 1,"01B0","07CEB478",7,,,"00001010","00011101"
    [00:02:51.503,479] <inf> cloud_connection: Network connectivity gained!
    [00:03:07.268,249] <inf> cloud_connection: Waiting for network ready...
    [00:03:07.268,280] <inf> cloud_connection: Network is ready
    [00:03:07.268,280] <inf> cloud_connection: Waiting to obtain date/time
    [00:03:07.268,310] <inf> cloud_connection: Connecting to nRF Cloud
    [00:03:07.268,371] <dbg> cloud_connection: cloud_event_handler: NRF_CLOUD_EVT_TRANSPORT_CONNECTING
    +CEREG: 4
    [00:03:32.505,981] <inf> cloud_connection: Network connectivity lost!
    [00:03:32.506,011] <dbg> cloud_connection: clear_readiness_timeout: Stopping cloud connection readiness timeout
    [00:03:32.506,042] <dbg> cloud_connection: disconnect_cloud: Cleared CLOUD_READY and CLOUD_CONNECTED
    [00:03:32.506,042] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:03:32.506,072] <dbg> cloud_connection: disconnect_cloud: Already disconnected from nRF Cloud
    [00:03:32.506,164] <err> cloud_connection: Could not connect to nRF Cloud
    [00:03:32.506,195] <inf> cloud_connection: Retrying in 30 seconds...
    +CEREG: 1,"01B0","07CEB478",7,,,"00001010","00011101"
    [00:03:32.765,411] <inf> cloud_connection: Network connectivity gained!
    [00:04:02.506,317] <inf> cloud_connection: Waiting for network ready...
    [00:04:02.506,347] <inf> cloud_connection: Network is ready
    [00:04:02.506,347] <inf> cloud_connection: Waiting to obtain date/time
    [00:04:02.506,378] <inf> cloud_connection: Connecting to nRF Cloud
    [00:04:02.506,378] <wrn> cloud_connection: Already connected to nRF Cloud
    [00:04:02.506,408] <dbg> cloud_connection: cloud_connection_thread_fn: Monitoring nRF Cloud connection
    [00:04:07.288,238] <err> nrf_cloud_transport: Could not connect to nRF Cloud MQTT Broker mqtt.nrfcloud.com, port: 45858. err: -111
    [00:04:07.288,299] <dbg> cloud_connection: cloud_event_handler: NRF_CLOUD_EVT_TRANSPORT_CONNECT_ERROR: -9
    [00:04:07.288,330] <dbg> cloud_connection: clear_readiness_timeout: Stopping cloud connection readiness timeout
    [00:04:07.288,360] <dbg> cloud_connection: disconnect_cloud: Cleared CLOUD_READY and CLOUD_CONNECTED
    [00:04:07.288,360] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:04:07.288,391] <dbg> cloud_connection: disconnect_cloud: Already disconnected from nRF Cloud
    [00:04:07.288,421] <inf> cloud_connection: Disconnected from nRF Cloud
    [00:04:07.288,421] <inf> cloud_connection: Retrying in 30 seconds...
    +CEREG: 4
    [00:04:13.317,443] <inf> cloud_connection: Network connectivity lost!
    [00:04:13.317,474] <dbg> cloud_connection: clear_readiness_timeout: Stopping cloud connection readiness timeout
    [00:04:13.317,504] <dbg> cloud_connection: disconnect_cloud: Cleared CLOUD_READY and CLOUD_CONNECTED
    [00:04:13.317,504] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:04:13.317,535] <dbg> cloud_connection: disconnect_cloud: Already disconnected from nRF Cloud
    +CEREG: 1,"01B0","07CEB478",7,,,"00001010","00011101"
    [00:04:13.787,109] <inf> cloud_connection: Network connectivity gained!
    [00:04:37.288,543] <inf> cloud_connection: Waiting for network ready...
    [00:04:37.288,574] <inf> cloud_connection: Network is ready
    [00:04:37.288,574] <inf> cloud_connection: Waiting to obtain date/time
    [00:04:37.288,604] <inf> cloud_connection: Connecting to nRF Cloud
    [00:04:37.288,665] <dbg> cloud_connection: cloud_event_handler: NRF_CLOUD_EVT_TRANSPORT_CONNECTING
    +CEREG: 4
    [00:04:56.989,440] <inf> cloud_connection: Network connectivity lost!
    [00:04:56.989,471] <dbg> cloud_connection: clear_readiness_timeout: Stopping cloud connection readiness timeout
    [00:04:56.989,501] <dbg> cloud_connection: disconnect_cloud: Cleared CLOUD_READY and CLOUD_CONNECTED
    [00:04:56.989,501] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:04:56.989,532] <dbg> cloud_connection: disconnect_cloud: Already disconnected from nRF Cloud
    [00:04:56.989,654] <err> cloud_connection: Could not connect to nRF Cloud
    [00:04:56.989,654] <inf> cloud_connection: Retrying in 30 seconds...
    +CEREG: 1,"01B0","07CEB478",7,,,"00001010","00011101"
    [00:04:57.308,898] <inf> cloud_connection: Network connectivity gained!
    +CEREG: 4
    [00:05:14.761,352] <inf> cloud_connection: Network connectivity lost!
    [00:05:14.761,383] <dbg> cloud_connection: clear_readiness_timeout: Stopping cloud connection readiness timeout
    [00:05:14.761,413] <dbg> cloud_connection: disconnect_cloud: Cleared CLOUD_READY and CLOUD_CONNECTED
    [00:05:14.761,413] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:05:14.761,444] <dbg> cloud_connection: disconnect_cloud: Already disconnected from nRF Cloud
    +CEREG: 1,"0430","0928F778",7,,,"00001010","00011101"
    [00:05:15.280,761] <inf> cloud_connection: Network connectivity gained!
    %MDMEV: PRACH CE-LEVEL 0
    [00:05:26.989,776] <inf> cloud_connection: Waiting for network ready...
    [00:05:26.989,807] <inf> cloud_connection: Network is ready
    [00:05:26.989,807] <inf> cloud_connection: Waiting to obtain date/time
    [00:05:26.989,837] <inf> cloud_connection: Connecting to nRF Cloud
    [00:05:26.989,837] <wrn> cloud_connection: Already connected to nRF Cloud
    [00:05:26.989,868] <dbg> cloud_connection: cloud_connection_thread_fn: Monitoring nRF Cloud connection
    %MDMEV: PRACH CE-LEVEL 0
    [00:05:37.309,570] <err> nrf_cloud_transport: Could not connect to nRF Cloud MQTT Broker mqtt.nrfcloud.com, port: 45858. err: -111
    [00:05:37.309,631] <dbg> cloud_connection: cloud_event_handler: NRF_CLOUD_EVT_TRANSPORT_CONNECT_ERROR: -9
    [00:05:37.309,631] <dbg> cloud_connection: clear_readiness_timeout: Stopping cloud connection readiness timeout
    [00:05:37.309,661] <dbg> cloud_connection: disconnect_cloud: Cleared CLOUD_READY and CLOUD_CONNECTED
    [00:05:37.309,692] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:05:37.309,692] <dbg> cloud_connection: disconnect_cloud: Already disconnected from nRF Cloud
    [00:05:37.309,753] <inf> cloud_connection: Disconnected from nRF Cloud
    [00:05:37.309,753] <inf> cloud_connection: Retrying in 30 seconds...
    %MDMEV: PRACH CE-LEVEL 0
    %MDMEV: PRACH CE-LEVEL 0
    %MDMEV: PRACH CE-LEVEL 0
    +CEREG: 4
    [00:06:05.297,790] <inf> cloud_connection: Network connectivity lost!
    [00:06:05.297,821] <dbg> cloud_connection: clear_readiness_timeout: Stopping cloud connection readiness timeout
    [00:06:05.297,851] <dbg> cloud_connection: disconnect_cloud: Cleared CLOUD_READY and CLOUD_CONNECTED
    [00:06:05.297,851] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:06:05.297,882] <dbg> cloud_connection: disconnect_cloud: Already disconnected from nRF Cloud
    [00:06:07.309,875] <inf> cloud_connection: Waiting for network ready...

Related