by wangha · v0.0.1
Communicate with MQTT Broker
This community listing does not yet include every recommended support, privacy, pricing, and permission disclosure. Review the available package permissions before installing.
Available inside your emploidai workspace after installation.
Available inside your emploidai workspace after installation.
Author: wangha
Version: 0.0.1
Type: tool
The MQTT-Tools provides SUB and PUB commands which help you to communicate with a MQTT Broker.
SUBcommand: Create a MQTT client and subscribe to a topic. This MQTT-Tools node will end when receive a message from MQTT Broker.
PUBcommand: Create a MQTT client and publish a message to a topic. This MQTT-Tools node will end when publishing is done.
Input following parameters.
type: sub or pub
broker: The address of your broker. for example: broker.emqx.io
port: The port of your broker. for example: 1883
topic: The topic you wanna to publish or subscribe to.
payload: This parameter will be ignored when type is sub.
When all parameters are set.
If the type is sub. This node will wait for a message from topic from the brokerbroker:port. This node will end when the message arrived.
If the type is pub. This node will publish a message to topic of brokerbroker:port. This node will end when the message was sent.
If the brokerbroker:port is unavailable. This node will end when timeout and return a error.
Here is a DSL example to use MQTT-Tools.
https://gist.github.com/wanghaEMQ/e97b009db6363d4689b2d5a6dcf3d9f5
You could also try to run this example online. click here