Skip to Content
Author's profile photo Murali Shanmugham

Capture event streams from IoT devices and perform predictive analytics using HCP – Part 4

This blog is part of a series which is related to setting up Smart Data Streaming, IoT Services & Predictive Services.

HANA Cloud Platform – Using IoT services, SDS & Predictive services

In the previous blog post, I showed how one could setup Smart Data Streaming (SDS) on HCP and capture streaming data from IoT devices which are in the edge. In this blog, I am going show how you can integrate HANA Cloud Platform IoT services with Smart Data Streaming. You can now manage the entire device life cycle using HCP IoT services and use SDS to analyze and process the incoming streams.  HCP IoT services will forward all the incoming messages to SDS to process. Hence, data is not persisted in the usual HCP IoT tables for this scenario.

Setting up the SDS Project

I am just building up the scenario from the previous blogs. Some of the tables created in the earlier blog, may not be relevant anymore. Hence, I have created another table in HANA called “SENSOR01”  to store the processed messages. This table will ultimately store the data passed via the HCP IoT service and SDS.

I have created a new SDS project called “devicetest” and have repeated the same steps performed in the earlier blog. The only difference is the Input Stream has different field as it has to match the schema of the message type I would declare in HCP IoT services. The other difference is that  I am now using SENSOR01 table in HANA Output adapter.

Here is how the CCL file would look like for this project

Once you compile and run the project, the Server view will open up as shown below.

Make a note of the above 3 items. You will need them later. Let the project be in running state.

1) Workspace name – default

2) Project name – devicetest

3) Input Stream name – devicestream

Configure Device/Message Types in IoT services

Navigate to the HCP IoT Cockpit and use the Device Management tiles to create each of them.

Add a message type for the device

Add a device type and attach it to the message

Finally, create a new Device as shown below

Create Service Mappings in MMS

Navigate to the MMS cockpit. Ensure that you have deployed the latest version of MMS otherwise the below functionality may not work. Click on “Configure Processing Service Mappings”

Create the first mapping by clicking on the “Add Mapping” button.

From the popup, select SDS as we need to use this setting to enable IoT MMS service to forward the message to SDS.

In the Processing service screen, provide the values of the SDS host, port, user, Project and Input Stream details as shown below

Click on “Back to Mappings” and then click on “Create” button to save your changes. Now you should be able to see a new Service Mapping of type SDS as shown below

You could also use a REST client to create a service mapping. I prefer this way as it is easy. The below step is not required as its another way of creating the Service Mappings. I am using Advanced REST Client

Below is the contents of the PUT Request

You should get a message “Processing service mapping with device type [XXXXXXX] and message type [XXXXXXX] has been registered”.

Test the IoT Device

For sake of simplicity, I am going to use the Test console provided by HCP IoT services available in the MMS cockpit. Click on the tile which can be used to test HTTP API.

Provide the details in the below format to send a test message to the registered device

Now when I switch to the HANA Studio and look at the Input Stream of the SDS project which was created earlier, I should see this message flowing into SDS

Since the test data would pass all the filter conditions in the SDS project, this should be updated in the HANA table

Just to confirm that there are no tables being created by the HCP IoT Services, I can navigate to the MMS Cockpit and click on “Display Stored Data” tile

There shouldn’t be any I_IOT_<MessageType> tables created by the IoT Services.

This concludes the IoT/SDS part of this blog series. In the next part, I will focus on how to use HCP Predictive Services to analyze the data stored in the HANA Table.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hello Murali - Thanks for sharing the detailed blog. It helps a lot.

      Have you tried using the HTTP option for message processing instead of SDS. If so please let me know what all I need to configure. I provided the user/password/url but it seems to be not working.

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Hi Sandeep, Thanks. I have not yet tried HTTP option. Its still in my to do list. Can you please raise a discussion with screenshots and you might find someone to help you out. Cheers.

      Author's profile photo Former Member
      Former Member

      Thanks Murali - Will do.

      Author's profile photo Erik Iacobellis
      Erik Iacobellis

      hi Murali ,

      we want connect iotmms to our SDS project on  premise it's possibile?




      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Hi Erik, I am not sure. I havent tried this.I believe it should be possible as long as the endpoints from SDS are accessible to iotmms service via a Cloud Connector.


      Author's profile photo Vivek Gupta
      Vivek Gupta

      Hello Murali 

      Thanks for sharing the detailed blog …using IoT 2.0 service with SDS !!!

      how can integrate SDS with IoT 4.0 service ( SAP Leonardo IoT platform ) , to achieve the same scenario ..? As IoT application enablement have set of API’s available which read the time series data ( thing/sensor – data) .?






      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Thank Vivek, I have not tested the same with IoT 4.0 service. Please post a question in the appropriate forum. Thanks

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Thanks Vivek, As mentioned in the earlier post, please post a question in the forum. I have not tested this myself.