Research breakthrough possible @S-Logix pro@slogix.in

Office Address

Social List

How to Simulate the MQTT Protocol in Contiki-NG Simulator?

Simulate the MQTT Protocol in Contiki-NG

Simulate the MQTT Protocol in Contiki-NG

  • Description:
    MQTT is a lightweight, publish-subscribe, machine-to-machine network protocol. It uses Publisher/Subscriber pattern and translates the messages between devices, servers, and applications. The MQTT protocol was initially created to link sensors like pipelines that communicate with satellites, emphasizing minimal battery loss and bandwidth consumption.
Step 1
  • Open cooja simulator
  • In terminal cd contiki-ng/tools/cooja >> ant run
  • Create new simulation
Step 2
  • Create motes for simulation
  • Choose the following location and create motes 1.contiki-ng/examples/rpl-border-router/border-router.c //For border router 2.contiki-ng/examples/mqtt-client/mqtt-client.c //For Publisher 3.contiki-ng/examples/mqtt-client/mqtt-client.c //For Subscriber
Step 3
  • connect border-router and broker/server
  • Open a new terminal to connect a border_router. 1.cd contiki-ng/examples/rpl-border-router >>make TARGET=(platform) connect-router-cooja
  • Open another terminal to connect a broker. 2.mosquitto -p port address
Step 4
  • Open cooja simulator
  • Run Simulation
  • Open cooja simulator and Run Simulation
Output
  • Run Simulation and get the output