Wednesday, January 4, 2017

Update from Cloud-Team: Setting up IBM IoT to execute OpenWhisk actions

IBM Watson IoT Platform 

One main component in our project is the communication between the hardware components (sensors and gateways) and the back-end in the cloud. For this purpose, we have different options such as Eclipse Kapua, but due to the lack of integration between Kapua and OpenWhisk (Our serverless engine), another option such as Watson IoT Platform fits well in such situation. Watson IoT Platform is used to manage devices and transfer the events through MQTT protocol. IBM Watson IOT platform provides a toolkit to build scalable IoT applications, the toolkit includes gateway devices and devices management, and also it allows users to process events in real-time.

Setting up Watson IoT Platform service instance

Watson IoT Platform is available within Bluemix catalog.





After having the instance initialized, the dashboard then will be available.




To access the dashboard, click on the button Lunch Dashboard, and then:



 
Adding Device Types and Devices

Devices in the platform are organized as groups of devices under their types, each device is associated to a device type. To add devices, at least a device type must be created. Device type in the platform is nothing but some basic information such as name and description. It is used only to keep the stuff organized.

To add a device type, from the service dashboard, select devices tab and then follow the photos:













After that go back to Browse tab, and select:



The next steps are similar to the steps followed in creating the device type. When you reach the step of specifying the authentication token, make sure you either provide your own token or save the auto generated token in a safe place since you can not retrieve it once the device is added.



Rules and Actions

Watson IoT Platform provides a powerful tools to filter and interact with events, it provides what is called rules and actions. The rules are some condition based on events attributes that are triggered whenever such conditions are met to execute what is called actions such as sending emails or doing an HTTP request.

Executing Actions in OpenWhisk as Response to Events in the platform

As it is already mentioned in the project architecture, the back-end is serverless based. In other words, it is serverless microservices. A set of microservices that run in response to incoming events from Watson IoT Platform. To fire an OpenWhisk Trigger, an action in the platform is configured to call an HTTP request that fires the OpenWhisk trigger using the event payload as input parameters for the OpenWhisk trigger.


No comments:

Post a Comment