With the new IoT Services on the SAP HANA Cloud Platform (HCP) it has become much easier to work with IoT scenarios on HCP.
I’ll take the opportunity and will show you how to use the IoT Services with the scenario around my blog post series Rui’s Fish Import/Export.
Table of Contents
What needs to be changed
We’ll change what we have done in part 2 of this blog post series and in part 3
To demonstrate that on a high level let’s first look into the initial picture I’ve drawn at the beginning of this series.
The picture is not really very accurate. If we look into the details of what we have built so far, the picture should rather look like this:
Meaning we have developed and deployed a Java application on our HCP account which does two things. On the one side it’s a servlet that we use as an endpoint for the application on the Raspberry Pi. That servlet also stores the incoming data in a HANA schema.
On the other side that servlet reads-out the data from the HANA schema and provides it as a JSON stream for our HTML5 app.
With the IoT Services we’ll get rid of the Java servlet that retrieves and stores the data. We’ll keep the part that provides the JSON stream. With those changes our picture will look like this:
We’ll reduce our code footprint and also will get for free the possibility to add authorization capabilities to our scenario along with the IoT Services on HCP. Isn’t that cool?!
Let’s upgrade our app with the IoT Services
First thing we need to do is to enable the IoT Services in our SAP HANA Cloud Platform cockpit.
1. Enable the IoT Services
1. Open your cockpit for your trial account on SAP HANA Cloud Platform via the link https://account.hanatrial.ondemand.com/cockpit and switch to the Services navigation tab.
Click on the Enable button at the right for the Internet of Things Services (BETA) and wait a few seconds until you can click on the link Go to Service
|2. Click on the link Go to Service|
|3. Now you should see the Internet of Things Services Cockpit|
2. Install the Message Management Service
The Message Management Service will become our new endpoint for receiving the sensor data of our Raspberry Pi devices. Installing it is a straight-forward thing.
3. Create our new endpoint on the IoT Services
Now that the Message Management Service is up and running we can take the next step and configure our new endpoint without having to write one line of code. I’ll try to stick to the meta model we have setup in blog 2 of this blog post series so that you should be able to follow the steps easily.
What is missing?
Well. We’ve just clicked together our new IoT endpoint without having to create ONE single line of code. What we have now is an API interface that our Raspberry Pi can use.
We’ll have still to:
- update our Java app on the Raspberry Pi to use the new endpoint
- change our former Java app so that it connects to the HANA schema from the new endpoint
- change our former Java app to that it just creates the JSON stream
I’ll post these last steps as new blog post within the next couple of days.
Hope you’ll have fun with the new IoT Services on the SAP HANA Cloud Platform!!