This article is a continuation of the Basic Starter Guide, which will provide additional understanding on how to build and design your own customized Internet of Things pipeline in Reekoh.
In addition to the things you learned in the Basic Starter Guide, you will also have an understanding of the following tasks by the end of this tutorial:
- Process and enrich data from external services.
- Transmits enriched data to the specified database.
Register a Device
For this tutorial, we will use the same registered device used in the Basic Starter Guide.
Note: If you want to register another device, refer to the Basic Starter Guide article for instructions on how to register a device.
Aside from the MQTT Gateway and Webhooks Connector plugins pinned in the Basic Starter Guide, pin additional plugins to demonstrate how data is processed from your registered device.
For the purpose of this tutorial, we will be using the Dark Sky and Google Geocode Service plugins from the Service category and the MongoDB plugin from the Storage category.
- From the Marketplace page, click the Service tab.
- Locate and pin the Dark Sky and Google Geocode Service plugins. Note that these plugins are used to retrieve the current weather condition and outputs the readable address based on the latitude and longitude.
- Click the Storage tab.
- Locate and pin the MongoDB plugin. Note that this plugin enables you to store enriched device data.
After you have pinned the additional plugins, create a new pipeline to configure these plugins.
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 the additional pinned plugins displayed on the left pane.
- Using what you have learned from the Basic Starter Guide, drag and drop the pinned plugins onto the design canvas then configure each plugin.
Note: Configuration details vary from plugin to plugin depending on the details needed to run the functions of the plugin. Refer to the plugin's online help for information on how to configure the plugin.
- After you have configured the plugins, connect them by dragging the output terminal of one plugin to the input terminal of another plugin as shown from the example below:
- 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.
Connect and Send Device Data to MQTT Gateway
After you have configured the plugins, you can now proceed on connecting and sending device data to the MQTT Gateway. For this tutorial, we will also use the MQTTBox client simulator.
- 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.
To verify if the data was successfully sent to the MQTT Gateway and was received by Webhooks Connector and MongoDB plugins, perform the following:
- 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.
From Studio 3T for MongoDB, go to your database then select the database collection you specified for the plugin. The data sent from MQTTBox will be displayed in the Result tab.