Need help to connect mqtt hivemq with nrf7002dk or nrf9160_dk

Hi Everyone,

I tried this sample `samples/net/mqtt` It connects to the test.mosquito.org but I want it to connect to hivemq with username and password. Do we have a sample which connects with other mqtt broker such as hivemq or google iot or other except for azure and amazon. Initially at this point I want it to be connected to the hivemq and I am unable to find any good resource to do so.

Any help would be greatful!

Parents
  • Hello, 

    First of, what version of the SDK are you working on? I know some customers have connected to HiveMQ using our nRF9160 e.g. this LinkedIn post, using Serial LTE Modem. How are you adding the broker and relevant information to your project?

    Kind regards,
    Øyvind

  • Hi Øyvind,

    I am using nrf Connect SDK 2.8.0. I am planning to add the relevant details over here. I will replace the password and user_name with appropriate details

    init_mqtt_client_id();
    	mqtt_client_init(client);
    	client->broker = &broker;
    	client->evt_cb = mqtt_event_handler;
    	client->client_id.utf8 = client_id;
    	client->client_id.size = strlen(client->client_id.utf8);
    	client->password = NULL;
    	client->user_name = NULL;
    	client->protocol_version = MQTT_VERSION_3_1_1;

    I tried mqtt secure sample actuator sensor example provided by nordic. I am unable to build it I am getting the following error

    Could you please help me with the same. Also, I am using nrf7002-dk right now

Reply
  • Hi Øyvind,

    I am using nrf Connect SDK 2.8.0. I am planning to add the relevant details over here. I will replace the password and user_name with appropriate details

    init_mqtt_client_id();
    	mqtt_client_init(client);
    	client->broker = &broker;
    	client->evt_cb = mqtt_event_handler;
    	client->client_id.utf8 = client_id;
    	client->client_id.size = strlen(client->client_id.utf8);
    	client->password = NULL;
    	client->user_name = NULL;
    	client->protocol_version = MQTT_VERSION_3_1_1;

    I tried mqtt secure sample actuator sensor example provided by nordic. I am unable to build it I am getting the following error

    Could you please help me with the same. Also, I am using nrf7002-dk right now

Children
Related