This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF9160: Azure IoT Hub on Thingy91 MQTT Connect Error

I am trying to run nRF9160: Azure IoT Hub — nRF Connect SDK 1.6.99 documentation (nordicsemi.com) on thingy91. I have followed  Azure IoT Hub — nRF Connect SDK 1.6.99 documentation (nordicsemi.com) and generated certicated and updated it to the modem.Also the rootCA in IoT Hub.It finds the ip address of the IoT hub and mqtt connection is not established..I have also updated the device id and IoT hub details in prj.conf..I have also went through the Sample nRF9160: Azure IoT Hub - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com). Error -111 means connection refused. What Could be the possible solution for this problem  ?

There is also a folder "certs" in the example.Do I need to provide certificates here also ?  While updating  the certificate to modem, do I need to copy  "-----BEGIN CERTIFICATE-----" and  "-----END CERTIFICATE-----"  or just the certificate in between those two ?

Parents
  • Hi!

    While updating the certificate to modem, do I need to copy "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----" or just the certificate in between those two ?
    Yes, you need to include the bottom and top lines when writing the certificates to the modem.

    If your certificates were the problem, I believe you would be seeing a different error. Error -111 usually indicates that the port you're trying to connect to isn't open for some reason. So either you are connecting to the wrong IP address, or to the wrong port, or the server is listening on the wrong port, or is not actually running.

    Are you able to take a modem trace when the device is connecting? Remember to set CONFIG_NRF_MODEM_LIB_TRACE_ENABLED in your project before taking a trace.

    Best regards,

    Heidi

  • Hi Heidi,

    Thanks for the reply :) I was able to connect to IoT Hub after updating the certficates  with "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----.  Could you tell me the purpose of "cert" folder inside the project sample ?

  • That's good to hear.

    The cert folder defines ca_certificate, private_key and device_certificate. It is added to the project in CMakeLists.txt here and is used in the Azure IoT Hub subsys in certificates_provision().

Reply Children
Related