Connect a device to the SAP Cloud Platform Internet of Things Cloud Foundry Environment part 1
In the next blog(s) i will guide you to the following topics:
|
|
|
|
As already mentioned the new SAP Cloud Platform Internet of Things Service (Cloud Foundry based) is part of the Leonardo Foundation.
Please check also this good overview in the EA explorer for deeper insights.
Futhermore you can find the IoT service documentation here
As part of the beta program i had the big chance to get my hands dirty as an “early IoT bird”.
In this blog i want to show how we can connect an TI Sensor Tag to the new IoT service.
In the screen abhöbe u can see this is called as “Technical Services” in the context of the SAP Leonardo Foundation.
Futhermore in one of the next blogs i want to guide you how we can enhance our scenario to build up an holistice E2E process.
But today we start simple, in short you can see what we do in the next few lines (and the next blog) here:
From the Architecture point of view we connect our “Device” (the TI Sensor Tag) to the “IoT Gateway Cloud” that is part of the IoT service:
Based on the fact that my good old “TI Sensor Tag” ;o) just send the sensor measurements over bluetooth i will use here an “Raspberry PI 2B” as my “bridge” to collect and send my data finally to IoT service.
Create the device in the Internet of Things cockpit
After you´ve successfully logged in u can see in the panel different options, for details pls refer the documentation.
To add a device (our TI SensorTag) we need first enter the “Networks” section, were we can see two networks:
- MQTT
- REST
Based on our scenario, i want to start using the MQTT(S) network for my TI Sensor Tag.
If u expand the specific network we have different technical options, we click here on the “Add Device”:
Now it´s time to enter some details:
In the next screen it´s now possible (for me a really nice feature) to set the position of our device via “Google Maps”:
In the next step we can now click on the “Add Sensor” button to create the “Sensor”.
The interesting point here ist the “Profile ID”:
As u can see Iam using here “200” as ID, the reason for this is the fact that IoT service is based on an “Centralized Data Model” in this model u can define your own data model by enhancing it.
In my case i using an own (enhanced) data model for my different “TI Sensor Tag” sensors. The data model is backed as JSON file.
Snippet 1 (Standard Profile).
{
"profiles": [
{
"profileId": 0,
"protocolName": "*",
"profileName": "default",
"tenantId": 0,
"capabilities": [
{
"configAddr": "1",
"dataType": "Temperature",
"label": "Temperature",
"parserClass": null,
"command": null,
"measures": [
{
"scale": -2,
"inputType": "INT32",
"uom": "��C",
"measureName": null,
"shift": 0.0,
"valueType": "Single_prec",
"toSwap": true
}
],
"properties": null,
"compressionType": "AverageCompression"
},
Snippet 2 (My own Profile):
"profileId": 200,
"protocolName": "*",
"profileName": "default",
"tenantId": 0,
"capabilities": [
{
"configAddr": "2",
"dataType": "Temperature",
"label": "Temperature",
"parserClass": null,
"command": null,
"measures": [
{
"scale": -2,
"inputType": "INT32",
"uom": "C",
"measureName": null,
"shift": 0.0,
"valueType": "Single_prec",
"toSwap": true
}
],
"properties": null,
"compressionType": null
},
{
"configAddr": "4",
"dataType": "Generic",
"label": "Luminosity",
"parserClass": null,
"command": null,
"measures": [
{
"scale": 0,
"inputType": null,
"uom": "Lux",
"measureName": null,
"shift": 0.0,
"valueType": "Single_prec",
"toSwap": false
}
],
"properties": null,
"compressionType": "AverageCompression"
},
{
"configAddr": "6",
"dataType": "Generic",
"label": "AccelerationX",
"parserClass": null,
"command": null,
"measures": [
{
"scale": 0,
"inputType": null,
"uom": "G",
"measureName": null,
"shift": 0.0,
"valueType": "Single_prec",
"toSwap": false
}
...
Please check this guide how to create a custom profile.
As u can see in the creation phase of my device i refer here to the “Profile ID” from my own profile (200).
Now we add e.g. the Luminosity via the “Configurations” section to our device/sensor
The Adress points to the “configAddr” in the modified data model.
Futhermore i adding a additional configuration (Air Temperature) to my device.
Now its time to finishing my work by saving the settings.
Note: Additional to the manual “way” we´ve also the “api way” in place. i think we will cover this in one of the next blogs, in the meanwhile check the documentation.
By switching now to “Devices” we can now see our “new” one.
By clicking on the “Device Configuration” you can see here all details:
Please check also this guide for more detailed description, including how to send test data to the device.
cheers,
fabian
Hello Fabian,
Thank you for the very interesting article!
What do I need to do to get the SAP Cloud Platform Internet of Things Service based on Cloud Foundry to run? I did not find any information on that.
Thank you
Tim
Hi Fabian,
Thanks a lot for such a wonderful series of blogs.
Thanks
Avijit Dhar
Amazing Blog Fabian!
Wanna buy my raspbery pi soon!
Regards,
Yoppie
Can We have a latest documentation based on SAP Cloud Foundry Environment? Also the components for setup has been changed. This post is obsolete for the new tenants.
Hello Fabian,
is the SAP Cloud Platform Internet of Things Service still available in the current SAP CP Trial? I do not seem able to find it in the Service Marketplace.
Many thanks in advance