Skip to Content

As a Product Manager for HCP, focusing on IoT, I have been asked to do a lot of CodeJams.  Most of the CodeJams have been on Getting Started on SAP HCP, but with the new release of the SAP IoT Services, we can do IoT CodeJams. For the CodeJams and other events, we need a step by step process on how to get started.  Using Michael Ameling’s great how to” post as a starting point, and trying to re-use as much of his team’s code as possible, I created a number of tutorials.  And since I also wanted to help people get started before they had hardware, I added in how to test your IoT Services using Postman (a REST Client).  If you, never used one of these, it will help get you started with APIs.

I shared them with colleagues to get them proofed and tested.  They gave me great feedback and then passed them around internally here at SAP. So I figured that I could just post them here and share with the wider SAP Community.

Here they are:

  1. Getting Started with the IoT Services–  Just like is says, this gets you going.
  2. Connecting a Java HTML UI5 GUI–  Creating a simple graph and how to upload it.
  3. Connecting a UI5 GUI using WebIDE– This uses the SAP WebIDE to build everything. –added details on how have both the WebIDE and Java working
  4. Nodejs and Python– Writing the python or node.js code that you will need.
  5. Building up the hardware– Using a Tessel-
  6. Completing the Round Trip-  Using the messaging to send messages to your devices.– coming soon

Links:

Rui’s Fish Import/Export – how to build a full project using SAP HCP

The SAP HCP Podcast

SAP Insurance’s IoT House Video

Where SAP HCP is traveling

Gamification Service– How get started with SAP Gamification

To report this post you need to login first.

34 Comments

You must be Logged on to comment or reply to a post.

  1. David Lincourt

    Great tutorial. I used it along with the “Starter Kit for the SAP HANA Cloud Platform Internet of Things (IoT) Services” (https://github.com/SAP/iot-starterkit).

    I purchased a GrovePi+ Starter Kit For The Raspberry Pi from Dexter Industries (Raspberry Pi Internet of Things Kit). Their team was very responsive to get my GrovePi+ up and running. Then I adapted the example provided in the Starter Kit – I have a rotary angle sensor rather than a slider… no code change here) and I used a LCD RGB display instead of the OLED one. Only very minor change required.

    Here is a photo of my computer. You can see the UI5 app that displays the data on the HANA Cloud Platform, my Raspberry Pi console, and my webcam showing the output on the LCD.

    IoT_Trial.png

    I plan to use the button from the kit to trigger the start/stop of data collection instead of having to crank up the sensor to the max to start and then to 0 to stop. I would also like to do some statistical analysis of the values… things like average, max, min, rate of change, etc.

    More to follow.

    In closing, thanks to the community for sharing so much knowledge that getting up and running was very easy!

    David

    (0) 
  2. Marcus Behrens

    Aaron – you did it again end-to-end tying all of the innovations together from iot device management to ui5 user experience.

    To me the gem in this series is the transition from the hana table exclusively used by the mms service to an xs service exposing odata such that analytics tools from Microsoft (like PowerPivot) or SAP (Smart Business) can make use of it.

    (0) 
    1. Aaron Williams Post author

      Thanks.  As much as I would like to take full credit for that, I got about 95% of the code from one of our great Architects, @Anton Levin

      (0) 
    1. Aaron Williams Post author

      No you have to use wss.  For good or bad, everything that the IoT services does has to use the “secured” part of the protocol (so https- yes, http- no, wss- yes, ws- no)

      Hope that helps…

      (0) 
  3. Ji Jing

    Hi Aaron, these are very convenient procedures. Thanks a lot!

    But I encounter an issue in part 1 when using sample client to send data with the message type which I created. It shows code 202 and 409, and when I check the stored message, there is no such table matching to the message type that I created. Is this a bug currently or did I miss some steps? Thanks

    websocket result.jpg

    (0) 
  4. Ji Jing

    Hi Aaron, I still have an issue regarding to field with date type in message type.

    What data format should be for the type of date? Now I send the message with data “2015-12-14 09:00:14”, I will get the reply said that “400  {“msg”: “Parse error. Expected [timenow] of type [Date]”}”.

    Thanks and Best Regards,

    Ji JING

    (0) 
    1. Marcus Behrens

      Use UTC or local time with timezone in ISO8601 format. I tried IoT Services with a timestamp with datatype Date and this sample is from now and it works: 2015-12-15T09:34:59Z

      (0) 
  5. Srivatsan Sundaravaradan

    Hi, Any one tried to link any user created table to be used to store IOT data?

    By default the tables are created by MMS according to message types, but what is the way that we link user created HANA tables to be used instead of auto generated table?

    Regards

    Srivatsan

    (0) 
    1. Anton Levin

      Hi Srivatsan,

      it is possible with the MMS Processing API. See intro documentation here SAP HANA Cloud Platform Internet of Things (IoT) Services

      And more detailed information with some snapshot is directly available in your MMS instance. Open in browser https://iotmms<your-user>trial.hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/processing/api

      Regards,

      Anton

      Update

      Also this link will be helpful SAP HANA Cloud Platform Internet of Things (IoT) Services

      (0) 
      1. Srivatsan Sundaravaradan

        Hi Anton,

        Thanks for the Links but I find that these are not to use any custom defined table as is (Replace the MMS table with our table directly) but they allow us to change the column names and table names..

        Regards

        Srivatsan

        (0) 
        1. Anton Levin

          But isn’t it exactly what you want? For example, you have your custom defined table CT with columns C1, C2, C3 and your IoT Message Type MT with fields F1, F2, F3

          With the following mapping:

          {

            “deviceType”:”DT”,

            “messageType”:”MT”,

            “processingService”:”sql”,

            “properties”:{

            “mms.processing.sql.mappings”:{

            “table_name”:”CT”,

            “column_names”:{

            “F1″:”C1”,

            “F2″:”C2”,

            “F3″:”C3”

            },

            “add_default_columns”:false

            }

            }

          }

          MMS will store all incoming messages to a table that you have created. Maybe, I understood you usecase wrong?

          Regards,

          Anton

          (0) 
    1. Aaron Williams Post author

      sorry I don’t.  Is this in the trial version?  If so, it would seem that the service was down for some reason when you tried to enable it. 

      Did it magically start working again?

      (0) 
  6. Athanasios Athanasiadis

    Hello,

    I am trying to run a demo but I came across a weird problem.

    Problem occurs in HCP, with my trial account. There seems to be a problem when trying to access the service of IoT, within the Services available in HCP. Every time I try to access the service cockpit (“Go to service” link) I get 6 errors, such as “Could not load hierarchies”, “Could not load data types” etc. Due to the above errors and as far as I understand, I am not able to add new message types or device types etc…

    Any ideas about a solution?

    (0) 
      1. Athanasios Athanasiadis

        Hello Anton and thank you for the reply,

        The Principal Propagation is enabled already but I still get the same errors…
        I disabled it, signed out of HCP, signed in and enabled it again, but no luck…
        Any other suggestions?

        (0) 
        1. Anton Levin

          I could suggest to re-check your Trust settings -> Trusted Identity Provider (are you using custom one?) and also your role assignments for IoT RDMS under Subscriptions -> iotrdms -> Roles

          (0) 

Leave a Reply