Thingy91x connecting to nRF Cloud MQTT input error -128

Hi,

I'm attempting to restore my Thingy91x to communicate with my instance of nRF Cloud (I had removed the certificates previously to test out the connection to another cloud provider). I've run the Python script(s) suggested by docs.nordicsemi.com/.../Credentials.html to generate the device certificate and private key and have loaded them onto the device using the Cellular Certificate Manager.

However, when running the nrf_cloud_multi_service, I see the following errors:

```

[00:03:39.172,058] <err> nrf_cloud_transport: MQTT input error: -128
[00:03:39.172,149] <err> nrf_cloud_transport: Error disconnecting from cloud: -128
[00:03:39.172,180] <inf> cloud_connection: Disconnecting from nRF Cloud
[00:03:39.172,210] <err> cloud_connection: Could not connect to nRF Cloud
[00:03:39.172,241] <inf> cloud_connection: Retrying in 30 seconds...

```

Can you help me understand what I'm doing wrong?

  • Hi Mohanmed,

    With nRF91x1 device you can use auto-boarding which is much simpler. I did a try with an Thingy91x without certificates. Here are the steps for your reference:

    Download and program ready-to-use multi service firmware from Thingy91x product page Downlaod:

    PS C:\Users\chs1\Downloads\thingy91x_mfw-2.0.2_sdk-2.9.0-preview\img_fota_dfu_zip> nrfutil device program --firmware .\thingy91x_nrfcloud_multi_service_2024-12-04_b38d03e9.zip --serial-number THINGY91X_046BA285FB7  --traits mcuboot --x-family nrf91 --core Application
    [00:00:34] ###### 100% [4/4 THINGY91X_046BA285FB7] Programmed

    Connect Serial Terminal and press BUTTON 2 to trigger a reset. 

    *** Booting nRF Connect SDK v2.7.99-cfb2a11d0139 ***
    *** Using Zephyr OS v3.6.99-2fb756ef5c41 ***
    Attempting to boot slot 0.
    Attempting to boot from address 0x8200.
    I: Verifying signature against key 0.
    I: Hash: 0x3e...f9
    I: Firmware signature verified.
    Firmware version 2
    Booting (0x8200).
    [00:00:00.255,737] <inf> spi_nor: GD25LE255E@0: 32 MiBy flash
    [00:00:00.308,380] <inf> wifi_nrf_bus: SPIM spi@b000: freq = 8 MHz
    [00:00:00.308,441] <inf> wifi_nrf_bus: SPIM spi@b000: latency = 0
    [00:00:00.378,631] <inf> wifi_nrf: Management buffer offload enabled
    
    *** Booting nRF Connect SDK v2.8.99-b38d03e9b452 ***
    *** Using Zephyr OS v3.7.99-bc80cbda202a ***
    [00:00:00.509,216] <inf> main: nRF Cloud multi-service sample has started, version: 1.0.0, protocol: MQTT
    [00:00:00.509,277] <inf> application: Reset reason: 0x10001
    [00:00:00.509,429] <inf> cloud_connection: Enabling connectivity...
    [00:00:00.944,091] <inf> cloud_connection: Setting up nRF Cloud library...
    [00:00:01.033,111] <inf> nrf_cloud_info: Device ID: 50343959-3733-4c16-8052-170e046d108d
    [00:00:01.043,731] <inf> nrf_cloud_info: IMEI:      359404230243454
    [00:00:01.132,507] <inf> nrf_cloud_info: UUID:      50343959-3733-4c16-8052-170e046d108d
    [00:00:01.132,965] <inf> nrf_cloud_info: Modem FW:  mfw_nrf91x1_2.0.2
    [00:00:01.132,995] <inf> nrf_cloud_info: Protocol:          MQTT
    [00:00:01.133,026] <inf> nrf_cloud_info: Download protocol: HTTPS
    [00:00:01.133,026] <inf> nrf_cloud_info: Sec tag:           16842753
    [00:00:01.133,087] <inf> nrf_cloud_info: Host name:         mqtt.nrfcloud.com
    [00:00:01.373,016] <inf> nrf_cloud_credentials: Sec Tag: 16842753; CA: No, Client Cert: No, Private Key: No
    [00:00:01.373,046] <inf> nrf_cloud_credentials: CA Size: 0, AWS: Unlikely, CoAP: Unlikely
    [00:00:01.373,077] <err> nrf_cloud_credentials: CA Certificate not found in sec tag 16842753
    [00:00:01.373,107] <err> nrf_cloud_credentials: Private Key not found in sec tag 16842753
    [00:00:01.373,107] <err> nrf_cloud_credentials: Client Certificate not found in sec tag 16842753
    [00:00:01.373,107] <wrn> cloud_connection: nRF Cloud credentials are not installed. Claim and onboard device on nrfcloud.com to continue.
    [00:00:03.866,394] <inf> cloud_connection: Network connectivity gained!
    [00:00:04.866,607] <inf> cloud_provisioning: Initializing the nRF Provisioning library...
    [00:00:04.906,097] <inf> nrf_provisioning: Checking for provisioning commands in 4s seconds
    [00:00:08.906,219] <inf> cloud_provisioning: Provisioning is active.
    [00:00:09.008,026] <inf> nrf_provisioning_http: Requesting commands
    [00:00:11.536,254] <inf> nrf_provisioning_http: Connected
    [00:00:11.536,285] <err> nrf_provisioning_http: Device provided wrong auth credentials
    [00:00:11.536,285] <wrn> nrf_provisioning: Unauthorized access: device is not yet claimed.
    [00:00:11.536,315] <err> nrf_provisioning: Provisioning failed, error: -13
    [00:00:11.536,499] <inf> nrf_provisioning: Checking for provisioning commands in 63s seconds
    [00:00:16.536,376] <inf> cloud_provisioning: Provisioning is idle.
    uart:~$

    Follow https://docs.nordicsemi.com/bundle/nrf-cloud/page/SecurityServices/ProvisioningService/ClaimingDevices/ClaimingDeviceOwnershipPortal.html to do auto-onboarding.

    > at AT%ATTESTTOKEN
    at AT%ATTESTTOKEN
    %ATTESTTOKEN: "xxxxxxxxxxxxxFQUDQ5WTczTBaAUhcOBG0QjQZQMgF21Z9ARfySOyZh7BjVR1AkYRmsCy6Om4N1GqZvz-np.0oRDoQEmoQRBIfZYQCWJp0XfVpuq6cHlYN6-qnHaYPJ4TB6jJ7v4bpjAS9-f1EP6_7kiDtQVW6DwSopi1NCBlvGOriKuFRTGLTW3CJQ"
    OK
    
    uart:~$

    Then check the log too see Provisioning completed and reconnect to nR Cloud successfully.

    [00:08:49.684,967] <inf> nrf_provisioning: Checking for provisioning commands in 60s seconds
    [00:08:54.684,844] <inf> cloud_provisioning: Provisioning is idle.
    [00:09:49.685,089] <inf> cloud_provisioning: Provisioning is active.
    [00:09:49.786,712] <inf> nrf_provisioning_http: Requesting commands
    [00:09:52.682,983] <inf> nrf_provisioning_http: Connected
    [00:09:52.686,096] <inf> nrf_provisioning_http: Processing commands
    [00:09:52.687,957] <inf> cloud_provisioning: Provisioning library requests offline mode
    [00:09:52.800,689] <inf> nrf_provisioning: Disconnected from network - provisioning paused
    [00:09:52.801,116] <inf> cloud_connection: Network connectivity lost!
    [00:09:52.801,147] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:09:52.819,549] <inf> cloud_provisioning: Provisioning library requests offline mode
    [00:09:52.830,383] <inf> cloud_provisioning: Provisioning library requests offline mode
    [00:09:53.258,789] <inf> cloud_provisioning: Provisioning library requests offline mode
    [00:09:53.269,836] <inf> cloud_provisioning: Provisioning library requests offline mode
    [00:09:53.360,229] <inf> cloud_provisioning: Provisioning library requests normal mode
    [00:09:54.700,073] <inf> nrf_provisioning: Disconnected from network - provisioning paused
    [00:09:56.042,510] <inf> nrf_provisioning: Connected; home network - provisioning resumed
    [00:09:56.043,212] <inf> cloud_connection: Network connectivity gained!
    [00:09:57.043,853] <inf> nrf_provisioning_http: Sending response to server
    [00:09:58.932,586] <inf> nrf_provisioning_http: Requesting commands
    [00:09:59.878,479] <inf> nrf_provisioning_http: Connected
    [00:09:59.881,561] <inf> nrf_provisioning_http: Processing commands
    [00:09:59.884,490] <inf> cloud_provisioning: Provisioning library requests offline mode
    [00:10:00.215,057] <inf> nrf_provisioning: Disconnected from network - provisioning paused
    [00:10:00.215,484] <inf> cloud_connection: Network connectivity lost!
    [00:10:00.215,515] <inf> cloud_connection: Disconnecting from nRF Cloud
    [00:10:00.234,100] <inf> cloud_provisioning: Provisioning library requests offline mode
    [00:10:00.999,481] <inf> cloud_provisioning: Provisioning library requests normal mode
    [00:10:01.753,387] <inf> nrf_provisioning: Disconnected from network - provisioning paused
    [00:10:03.333,648] <inf> nrf_provisioning: Connected; home network - provisioning resumed
    [00:10:03.334,350] <inf> cloud_connection: Network connectivity gained!
    [00:10:04.334,869] <inf> nrf_provisioning_http: Sending response to server
    [00:10:05.329,040] <inf> cloud_provisioning: Provisioning completed.
    [00:10:05.329,071] <inf> sample_reboot: Rebooting in 10s...
    [00:10:10.329,101] <inf> cloud_provisioning: Provisioning is idle.
    uart:~$ *** Booting nRF Connect SDK v2.7.99-cfb2a11d0139 ***
    *** Using Zephyr OS v3.6.99-2fb756ef5c41 ***
    Attempting to boot slot 0.
    Attempting to boot from address 0x8200.
    I: Verifying signature against key 0.
    I: Hash: 0x3e...f9
    I: Firmware signature verified.
    Firmware version 2
    Booting (0x8200).
    [00:00:00.255,767] <inf> spi_nor: GD25LE255E@0: 32 MiBy flash
    [00:00:00.308,380] <inf> wifi_nrf_bus: SPIM spi@b000: freq = 8 MHz
    [00:00:00.308,410] <inf> wifi_nrf_bus: SPIM spi@b000: latency = 0
    [00:00:00.378,601] <inf> wifi_nrf: Management buffer offload enabled
    
    *** Booting nRF Connect SDK v2.8.99-b38d03e9b452 ***
    *** Using Zephyr OS v3.7.99-bc80cbda202a ***
    [00:00:00.509,185] <inf> main: nRF Cloud multi-service sample has started, version: 1.0.0, protocol: MQTT
    [00:00:00.509,246] <inf> application: Reset reason: 0x10001
    [00:00:00.509,399] <inf> cloud_connection: Enabling connectivity...
    [00:00:00.944,244] <inf> cloud_connection: Setting up nRF Cloud library...
    [00:00:01.033,355] <inf> nrf_cloud_info: Device ID: 50343959-3733-4c16-8052-170e046d108d
    [00:00:01.043,975] <inf> nrf_cloud_info: IMEI:      359404230243454
    [00:00:01.132,690] <inf> nrf_cloud_info: UUID:      50343959-3733-4c16-8052-170e046d108d
    [00:00:01.133,117] <inf> nrf_cloud_info: Modem FW:  mfw_nrf91x1_2.0.2
    [00:00:01.133,178] <inf> nrf_cloud_info: Protocol:          MQTT
    [00:00:01.133,209] <inf> nrf_cloud_info: Download protocol: HTTPS
    [00:00:01.133,209] <inf> nrf_cloud_info: Sec tag:           16842753
    [00:00:01.133,239] <inf> nrf_cloud_info: Host name:         mqtt.nrfcloud.com
    [00:00:01.474,548] <inf> nrf_cloud_credentials: Sec Tag: 16842753; CA: Yes, Client Cert: Yes, Private Key: Yes

    Let me know if you need more help.

    Best regards,

    Charlie

Related