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?

Parents
  • 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:

    Fullscreen
    1
    2
    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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    *** 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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    Fullscreen
    1
    2
    3
    4
    5
    6
    > at AT%ATTESTTOKEN
    at AT%ATTESTTOKEN
    %ATTESTTOKEN: "xxxxxxxxxxxxxFQUDQ5WTczTBaAUhcOBG0QjQZQMgF21Z9ARfySOyZh7BjVR1AkYRmsCy6Om4N1GqZvz-np.0oRDoQEmoQRBIfZYQCWJp0XfVpuq6cHlYN6-qnHaYPJ4TB6jJ7v4bpjAS9-f1EP6_7kiDtQVW6DwSopi1NCBlvGOriKuFRTGLTW3CJQ"
    OK
    uart:~$
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Let me know if you need more help.

    Best regards,

    Charlie

Reply
  • 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:

    Fullscreen
    1
    2
    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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    *** 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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    Fullscreen
    1
    2
    3
    4
    5
    6
    > at AT%ATTESTTOKEN
    at AT%ATTESTTOKEN
    %ATTESTTOKEN: "xxxxxxxxxxxxxFQUDQ5WTczTBaAUhcOBG0QjQZQMgF21Z9ARfySOyZh7BjVR1AkYRmsCy6Om4N1GqZvz-np.0oRDoQEmoQRBIfZYQCWJp0XfVpuq6cHlYN6-qnHaYPJ4TB6jJ7v4bpjAS9-f1EP6_7kiDtQVW6DwSopi1NCBlvGOriKuFRTGLTW3CJQ"
    OK
    uart:~$
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Let me know if you need more help.

    Best regards,

    Charlie

Children
No Data