nRF Cloud MQTT broker

Hello,

I was exploring nrf Cloud and noticed that you offer an MQTT broker for accessing device information. I attempted to connect using the following credentials:

Hostname: mqtt.nrfcloud.com Topic: prod/teamID/ (I substituted teamID with the actual ID I found in nrfCloud) Port: 8883

However, I'm encountering issues with connecting I get the error "Client network socket disconnected before secure TLS connection was established". Could you please offer some insight into what might be causing the problem? I have attached an image showing the error message I received along with the connection interface.

Thank you

Parents Reply Children
  • Hi Ahmed, 

    Here is the response from our nRF Cloud team

    The client id they are using is what is autogenerated by the app and is not in AWS.
    it looks like they are wanting to just view device info, ("MQTT broker for accessing device information") so they should probably use an "account device" type.
    The CreateAccountDevice REST endpoint should be called to create the account device and obtain the credentials.
    example:
    curl --location --request POST 'https://api.nrfcloud.com/v1/devices/account' \
    --header 'Authorization: Bearer <API_KEY>'
    the response is JSON containing the account device ID and cert data.
    {
        "clientId": "account-851bd211-a22d-4276-9226-bb621228b4f3",
        "caCert": "-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----\n",
        "clientCert": "-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----\n",
        "privateKey": "-----BEGIN RSA PRIVATE KEY----- ... -----END RSA PRIVATE KEY-----\n"
    }
    from there, create a PEM file for each credential... the newlines (\n) will need to be removed.
    use the client id from the JSON and select the "self-signed" certificate option and select the three PEM files
     .
Related