An MQTT client can publish messages as soon as it connects to a broker. MQTT utilizes topic-based filtering of the messages on the broker. Each message must contain a topic that the broker can use to forward the message to interested clients. Typically, each message has a payload that contains the data to transmit in byte format.
Open a source file in the following location >> contiki-ng/examples/mqtt-client/mqtt-client.c Code : mqtt-client.c
Run the simulation
After connecting border router to server use three terminal window for mosquitto publisher,subscriber and MQTT broker for receiving control messages.
Mote Output