This article provides you the step-by-step procedure on how to build and design your own customized Internet of Things pipeline in Reekoh.
By the end of this tutorial, you will have an understanding of the following tasks:
- Register and configure your device to enable the platform to accept and pass data.
- Browse and pin plugins from the Marketplace to work with your connected device.
- Design and configure data flow using the Pipeline Studio and your pinned plugins.
- Send and verify data to your specified Gateway.
Register a Device
- Login to your Reekoh account to access the Platform Console.
- From the navigation menu, select Devices > Devices. The Devices page displays.
- Click the New Device button then provide the following details:
- ID - Enter a unique ID for the device. If you want the system to automatically generate the device ID, leave this field blank.
- Name - Enter a name for the device.
- Device Group - Select a device group you want to associate to the device. Note that you can select multiple groups to associate to the device.
- Metadata - Enter the JSON key or value pairs you want to include to the device for additional information.
- Location - Enter the latitude and longitude coordinates of the device.
Note: All fields are optional except for the Name field.
- After providing the details, click Create Device. Your device will be added in the Devices page.
Now that you have registered your device, you must then pin the plugins you will be using in building your pipeline.
Pin Plugins
- From the navigation menu, select Marketplace. The Marketplace page displays.
- Select the category of the plugin you want to pin. For this tutorial, we will be using the Webhooks Connector and MQTT Gateway plugins as an example.
- Click the Connector tab then locate the Webhooks Connector plugin.
- Hover the mouse over the plugin then click Pin from the pop-up dialog.
- Do the same procedure for the MQTT Gateway plugin.
After you have pinned the plugins you need, you are now ready to build your own pipeline.
Build a Pipeline
- From the navigation menu, select Pipeline Studio then click Create a new Pipeline from the pop-up dialog that displays. The Pipeline Studio page displays with your pinned plugins displayed on the left pane.
- From the Gateway category, drag and drop the MQTT Gateway plugin onto the design canvas.
- Double-click the plugin to configure it then click Save. For MQTT Gateway, you are only required to enter a name for the plugin as the other required fields are prepopulated and the other fields are optional.
- After configuring the MQTT Gateway, select the Webhooks Connector plugin from the left pane then drag and drop the plugin onto the design canvas.
- Double-click the plugin to configure it then click Save. For Webhooks Connector, you are required to provide a name and URL for the plugin. To get the Webhook URL for the plugin, go to the Webhook site which generates the Webhooks URL automatically.
- After you have configured both plugins, connect them by dragging the output terminal of MQTT Gateway to the input terminal of Webhooks Connector.
- Click the drop-down menu beside the Save as Draft button then select the Save & Deploy option.
- From the Save Pipeline dialog, enter a name and description for the pipeline then click Save.
Note: To quickly view the generated IP address and port for the MQTT Gateway, hover the mouse over the plugin. Note that generation of these details may take a while so refresh the page until it displays.
Connect and Send Device Data to MQTT Gateway
In order to connect your device and send device data to the MQTT Gateway, you must first install a MQTT client simulator. For this tutorial, we will use the MQTTBox client simulator.
- Go to the MQTTBox website then download and install the application.
- After installation, open the MQTTBox then click Create MQTT Client.
- Provide the following MQTT Client Settings:
- MQTT Client Name - Enter a name for the device connection.
- MQTT Client ID - Enter the device ID.
- Protocol - Select the protocol as mqtt/tcp.
- Host - Enter the IP address and port generated for the Gateway.
- Click Save to complete your connection.
- Once connection is established, you can start sending data to the device by providing the following details:
- Topic to publish - Enter the Data Topic displayed from the MQTT Gateway plugin. Default value is reekoh/data.
- Payload Type - Ensure that Strings/JSON/XML/Characters option is selected.
- Payload - Enter the device data to be sent to the MQTT Gateway plugin. Note that the data must be in JSON format.
- Click Publish to complete sending the device data to the MQTT Gateway.
Verify Output
To verify if the data was successfully sent to the MQTT Gateway and was received by the Webhooks Connector, go to the Webhook site then enter the Webhook URL you provided for the Webhooks Connector plugin in the address bar.
The data sent from the MQTTBox will be displayed below the page.
Back to Top | Next > |
Comments
0 comments
Please sign in to leave a comment.