How to incorporate username and password for the MQTT broker authentcation in mqtt sample

I am using samples/net/mqtt for MQTT connection. I have a custom MQTT broker with SSL/TLS encryption which also requires username and password for authentication. I am confused as to where to add this.

I am using actnius icarus ns

sdk 2.3.0

Parents Reply
  • User_PP said:
    Do I need to make changes anywhere else?

    Yes, you will need to add password handling to the mqtt_helper library.

    mqtt_helper.h can be found here: nrf\include\net\mqtt_helper.h

    mqtt_helper.c can be found here: nrf\subsys\net\lib\mqtt_helper\mqtt_helper.c

    The library already handles the username, and both the username and password are handled the same way by the underlying MQTT client library, so you should be able to just copy what the mqtt_helper library does with the username.

Children
Related