simpleflowgui.github.io

MQTT Guide

For communication using MQTT, follow the steps below:

  1. Install Mosquitto from the link https://mosquitto.org/download/.

  2. Start the server by typing Mosquitto in the terminal/cmd.

  3. For publishing messages to a topic, expand the libraries list and click on the Communication library.

  1. Drag and drop an MQTT Publish node.

  1. From the Basic library, drag and drop a Start node and an End node.

  1. On the MQTT Publish node, set the broker to localhost, port to 1883, topic to simpleflow/mqtttest, and message to “hello world”.

  1. Subscribe to the same topic to check if the message is sent. Node-RED was used here to subscribe to the topic.

  2. Execute the flow.

  1. For subscribing to a topic and receiving messages, expand the libraries list and click on the Communication library.

  2. Drag and drop an MQTT Subscribe node.

  1. On the MQTT Subscribe node, set the broker to localhost, port to 1883, and topic to simpleflow/mqtttest.

  1. Publish to the same topic to check if the message is sent. Node-RED was used here to publish to the topic.

  1. Execute the flow.