How to set password and port at MQTT sample program?

Hi,

I am using the MQTT example program from SDKv2.4.2 as base. How do I set password and port number? There is no option. There is only an option to set the username. I am trying to connect to CloudMQTT broker.

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/net/mqtt/README.html

Regards,

Markel

Parents Reply
  • Thanks. I tried to generate certificate for CloudMQTT using openssl, but It did not generate any certificate. I do not think CloudMQTT needs a certificate to connect.

    I have managed to add password by adding password field to mqtt_helper_conn_params. But, I am not able to connect to CloudMQTT.

    I don't understand why the mqtt helper is incomplete library. Maybe not intended for connection to MQTT broker that requires username and password.

    Regards,

    Markel

Children
  • Hi!

    mtrobregado said:
    But, I am not able to connect to CloudMQTT.

    What error codes are you getting? Any logs to share?

    mtrobregado said:
    I don't understand why the mqtt helper is incomplete library. Maybe not intended for connection to MQTT broker that requires username and password.

    Yes, the password support is missing. We are checking with the developers of this library if there are plans to adding password support to the mqtt_helper library.

  • Hi Sigurd,

    I gave up connecting to CloudMQTT that requires username and password. I just connect to Beebotte MQTT that requires only username. 

    I have read several posts in this forum that they added username and password and it worked but that is for older nRF7002 DK SDKs or using nRF9160.

    I think you have an issue with MQTT library for nRF7002 DK that requires username and password. You can try it at your side. 

    I have connected to CloudMQTT using MQTTBox at Windows so it works. I entered the username and password at MQTTBox.

    Anyway, I have moved on with this issue.

    Regards,

    Markel

Related