The last option you can use to send a command is by using Trigger. To do this, navigate to Pipeline Studio and then select Create a New Pipeline from the pop-out window.
Locate the Other category, and then drag & drop the Trigger plugin to your work space. Double-click the plugin to configure. Complete the wizard that follows, and then click Save.
Make sure to configure the Gateway & Command Relay plugins to your Pipeline. You will need these plugins to create a device connection to your Gateway and broadcast the command to the target device. Once all plugins are configured, connect them by dragging the output terminal of one plugin to the input terminal of another. You may refer to the image below for sample. Click Save & Deploy, and then complete the wizard that follows to run your pipeline.
You should be able to see a message saying your pipeline has been created.
After you've deployed your pipeline, create a connection for your devices using a client simulator. For this example, we'll be using MQTTBox. Open the application, and then complete the following connection details:
- MQTT Client Name - Supply any name for your connection.
- Host - IP address and port generated upon deployment of your Reekoh pipeline.
- MQTT Client ID - Device ID supplied or generated upon registration of your device.
- Protocol - Select mqtt / tcp as your protocol.
- Append timestamp MQTT client id? - Set value to No.
Once connection has been established for both devices, you need to subscribe the devices in order to view the incoming messages. Let's start with Device 1.
Locate your connection for Device 1. On the Topic field, key-in your Device ID and then click Subscribe. You'll be able to see the incoming messages in the Subscriptions section.
Do the same procedure for Device 2.
After you've subscribed both devices, you need to send a JSON Data to the MQTT Gateway. Under the Publish section of your Device 2 connection, key-in or paste the JSON data on the Payload field, and then supply a value for Topic. Click Publish to send data to the MQTT Gateway. You should be able to see the "Data Received" message along with the JSON data in the Subscription section.
To verify if the command / message has been received, go to your Device 1 connection. You should be able to see the transmitted message.