MQTT is an ISO standard publish-subscribe based messaging protocol. It works on Application layer, Message broker used distributes topics to clients. Topics are UTF-8 string-based with hierarchical structure. There is no direct connection between clients also QoS(Quality of Service) levels are used in messaging services
Step 1: Install mqtt packages
mqtt-sn-contiki package download and extract at location: home/user/contiki in Vmware workstation
Step 2: Open cooja simulator
In terminal: cd contiki/tools/cooja >> ant run
Create new simulation(ctrl+n).
Step 3: Create motes for simulation
Choose location and create motes
2. home/user/contiki/mqtt-sn-contiki/ main_core.c //for publisher
3. home/user/contiki/mqtt-sn-contiki/ main_core.c //for subscriber.
Step 4: Connect the border router and broker/server.
Open terminals and change directories to following location:
1.cd contiki/examples/ipv6/rpl-border-router >> make connect-router-cooja
sudo ./broker_mqtts config.mqtt //to connect mosquitto broker to clients.
Step 5: Open cooja simulator