Hi,
After successful provisioning using "nRF Cloud Multi-service", I can view device on my nRF Cloud account. It shows successful MQTT and CoAP connections and GPS tracking. However, when attempting subsequent MQTT or CoAP connections, I get the errors below.
Connection to the LTE-M network is fine but attempts to connect to nRF Cloud throws "MQTT input error: 128" for MQTT and "Device not authenticated" error for CoAP.
I'm running nRF Connect SDK v2.9.0 and using the latest version of "nRF Cloud Multi-service".
Here are the MQTT and CoAP logs (IMEI masked out):
MQTT with no overlay option:
*** 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=bad, swap_type=0x1, copy_done=0x2, image_ok=0x2 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: 0x10000 [00:00:00.253,417] <inf> spi_nor: gd25wb256e3ir@0: 32 MiBy flash *** Booting nRF Connect SDK v2.9.0-7787b2649840 *** *** Using Zephyr OS v3.7.99-1f8f3dc29142 *** [00:00:00.261,138] <inf> main: nRF Cloud multi-service sample has started, version: 1.0.0, protocol: MQTT [00:00:00.261,169] <inf> application: Reset reason: 0x10001 [00:00:00.261,322] <inf> cloud_connection: Enabling connectivity... [00:00:00.593,627] <inf> cloud_connection: Setting up nRF Cloud library... [00:00:00.599,090] <inf> nrf_cloud_info: Device ID: nrf-xxxxxxxxxxxxxxxx [00:00:00.599,548] <inf> nrf_cloud_info: IMEI: xxxxxxxxxxxxxxxx [00:00:00.599,945] <inf> nrf_cloud_info: Modem FW: mfw_nrf91x1_2.0.2 [00:00:00.600,006] <inf> nrf_cloud_info: Protocol: MQTT [00:00:00.600,036] <inf> nrf_cloud_info: Download protocol: HTTPS [00:00:00.600,067] <inf> nrf_cloud_info: Sec tag: 16842753 [00:00:00.600,097] <inf> nrf_cloud_info: Host name: mqtt.nrfcloud.com [00:00:01.023,223] <inf> nrf_cloud_credentials: Sec Tag: 16842753; CA: Yes, Client Cert: Yes, Private Key: Yes [00:00:01.023,284] <inf> nrf_cloud_credentials: CA Size: 1792, AWS: Likely, CoAP: Likely [00:00:01.023,315] <inf> cloud_connection: Waiting for network ready... +CGEV: EXCE STATUS 0 +CEREG: 2,"D6E4","0867ED0D",7 %MDMEV: PRACH CE-LEVEL 0 +CSCON: 1 %XTIME: ,"5220027014010A", +CGEV: ME PDN ACT 0,0 +CNEC_ESM: 50,0 %MDMEV: SEARCH STATUS 2 +CEREG: 1,"D6E4","0867ED0D",7,,,"00001010","10111110" %XTIME: ,"5220027014110A","00" [00:00:04.648,010] <inf> cloud_connection: Network connectivity gained! [00:00:05.648,223] <inf> cloud_connection: Network is ready [00:00:05.648,254] <inf> cloud_connection: Connecting to nRF Cloud [00:00:10.263,031] <err> nrf_cloud_transport: MQTT input error: -128 [00:00:10.263,092] <err> nrf_cloud_transport: Error disconnecting from cloud: -128 [00:00:10.263,122] <inf> cloud_connection: Disconnecting from nRF Cloud [00:00:10.263,183] <err> cloud_connection: Could not connect to nRF Cloud [00:00:10.263,183] <inf> cloud_connection: Retrying in 30 seconds... +CSCON: 0
CoAP with "overlay_coap.conf":
uart:~$ *** 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=bad, swap_type=0x1, copy_done=0x2, image_ok=0x2 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: 0x10000 [00:00:00.253,448] <inf> spi_nor: gd25wb256e3ir@0: 32 MiBy flash *** Booting nRF Connect SDK v2.9.0-7787b2649840 *** *** Using Zephyr OS v3.7.99-1f8f3dc29142 *** [00:00:00.261,596] <inf> main: nRF Cloud multi-service sample has started, version: 1.0.0, protocol: CoAP [00:00:00.261,627] <inf> application: Reset reason: 0x10001 [00:00:00.261,810] <inf> cloud_connection: Enabling connectivity... [00:00:00.594,421] <inf> cloud_connection: Setting up nRF Cloud library... [00:00:00.597,808] <inf> nrf_cloud_info: Device ID: nrf-xxxxxxxxxxxxxxxx [00:00:00.598,266] <inf> nrf_cloud_info: IMEI: xxxxxxxxxxxxxxxx [00:00:00.683,685] <inf> nrf_cloud_info: UUID: 50333248-3037-4c3b-804e-0a104cb84456 [00:00:00.694,183] <inf> nrf_cloud_info: Modem FW: mfw_nrf91x1_2.0.2 [00:00:00.694,213] <inf> nrf_cloud_info: Protocol: CoAP [00:00:00.694,274] <inf> nrf_cloud_info: Download protocol: HTTPS [00:00:00.694,274] <inf> nrf_cloud_info: Sec tag: 16842753 [00:00:00.694,305] <inf> nrf_cloud_info: CoAP JWT Sec tag: 16842753 [00:00:00.694,335] <inf> nrf_cloud_info: Host name: coap.nrfcloud.com [00:00:01.093,231] <inf> nrf_cloud_credentials: Sec Tag: 16842753; CA: Yes, Client Cert: Yes, Private Key: Yes [00:00:01.093,292] <inf> nrf_cloud_credentials: CA Size: 1792, AWS: Likely, CoAP: Likely [00:00:01.093,322] <inf> cloud_connection: Waiting for network ready... +CGEV: EXCE STATUS 0 +CEREG: 2,"D6E4","0867ED0D",7 %MDMEV: PRACH CE-LEVEL 0 +CSCON: 1 %XTIME: ,"5220027003740A", +CGEV: ME PDN ACT 0,0 +CNEC_ESM: 50,0 %MDMEV: SEARCH STATUS 2 +CEREG: 1,"D6E4","0867ED0D",7,,,"00001010","10111110" %XTIME: ,"5220027003740A","00" [00:00:04.264,099] <inf> cloud_connection: Network connectivity gained! [00:00:05.264,312] <inf> cloud_connection: Network is ready [00:00:05.264,343] <inf> cloud_connection: Connecting to nRF Cloud [00:00:07.442,047] <inf> nrf_cloud_coap_transport: Request authorization with JWT [00:00:07.720,825] <err> nrf_cloud_coap_transport: Device not authenticated; reconnection required. [00:00:07.720,855] <inf> nrf_cloud_coap_transport: Authorization result_code: 4.01 [00:00:08.222,351] <err> cloud_connection: Could not connect to nRF Cloud, error: -13 [00:00:08.222,351] <inf> cloud_connection: Retrying in 30 seconds... [00:00:08.222,412] <err> net_coap: No client found for socket 3 +CSCON: 0 [00:00:38.222,473] <inf> cloud_connection: Waiting for network ready... [00:00:38.222,503] <inf> cloud_connection: Network is ready [00:00:38.222,503] <inf> cloud_connection: Connecting to nRF Cloud %MDMEV: SEARCH STATUS 2 %MDMEV: PRACH CE-LEVEL 0 +CSCON: 1 [00:00:40.627,899] <inf> nrf_cloud_coap_transport: Request authorization with JWT [00:00:40.887,756] <err> nrf_cloud_coap_transport: Device not authenticated; reconnection required. [00:00:40.887,786] <inf> nrf_cloud_coap_transport: Authorization result_code: 4.01 [00:00:41.389,617] <err> cloud_connection: Could not connect to nRF Cloud, error: -13 [00:00:41.389,617] <inf> cloud_connection: Retrying in 30 seconds... [00:00:41.389,709] <err> net_coap: No client found for socket 3 +CSCON: 0 [Disconnected]
I've tried using different sims and also NCS v2.8.0. So far, I've been unable to get successful nRF Cloud connections with MQTT or CoAP except when using the provisioning overlays.
It appears, there others who have run into the same or similar issues.
Regards,
Ravi