Skip to Content

SAP Cloud Platform launched the IoT Service in May this year. For those who are interested in the overall picture I would like to forward you to the SAP Enterprise Architecture Explorer providing more insight how it fits into SAP Leonardo IoT specifically SAP Leonardo IoT Foundation.

IoT Service Cockpit offers number of benefits and services to the Developers to on-board Devices, create Endpoints, Configure Events/Alarms. It lets us consume the real-time sensor data on Cloud (IoT Gateway Cloud) as well as provides IoT Gateway Edge services. IoT Gateway Edge enables us to process the sensor data near the Sensor network without the need to send it to SAP Cloud Platform. Have a look at this introductory blog about IoT 4.0 Leonardo for Next Gen Business to get overall picture.

This tutorial’s going to be a series of posts starting with this First Blog on getting yourself on-boarded with IoT Gateway Cloud. Later, I’ll be also sharing topics related to IoT Gateway Edge, Device Lifecycle Management, User Management and others.

Here’s my attempt to share the learning I got from recently concluded DevCamp in Labs Bangalore. Following were the topics which we were introduced and I’ve come-up with this Video Tutorials which hopefully will help people get on-boarded with the latest Leonardo IoT Service Cockpit.

Topics: – [ IoT Gateway Cloud ]

  • Check the Pre-requisites.
  • IoT Gateway Cloud Services with MQTT Network Devices (Simulator – PAHO Client)
  • IoT Gateway Cloud Services with REST Network Devices (Simulator – POSTMAN Client)

Pre-requisites:

  1. Access to SCP IoT Services 4.0 Instance
  2. Java 1.8 Installed and JAVA_HOME Configured (check below)

STEPS: –

  • Right click on My Computer > Properties > Advanced System Settings > Environment Variables
  • Under System variables, click on New and enter following
  • Variable name: JAVA_HOME
  • Variable value: path of the JDK installation folder (for ex: C:/Program files/java/jdk1.8.0_73)

 

  1. Install the MQTT Network Simulator (PAHO Client)
  2. Install Chrome POSTMAN Extension.

 

Demo

 


IoT Gateway Cloud Services MQTT Protocol:

 

  1. Introduction to “IoT Service Cockpit”
  2. Creating Device Data Model
    • Downloading Centralized Data Model
    • Extending Data Model with Custom Profile
    • Uploading New DataModel back to the Cockpit.
  3. Device Onboarding
    • Creating Physical Node
    • Download Certificates of Physical Node
  4. Send Data from MQTT Device Simulator (PAHO Client)
    • Configure PAHO Client with Device Certificates for Secure Communication
      • ssl://<HOST_NAME>:8883
      • Give password for Trust Store
    • Connecting to MQTT Gateway Cloud (“Make sure to connect to SAP_Internet”)
    • Creating Logical Nodes (E.g. Sensors) Under the Physical Node.
      • Topic: measures/<MAC_ADDRESS>
      • E.g. {“measureIds”:[1,2], “values”:[“75″,”30”], “profileId”:XXX,”logNodeAddr”:2 }
    • Sending MQTT Message Data via MQTT Body
  5. Consume & View the Data
    • Gauge Consumption
    • Chart Consumption
    • Consume Via API (POSTMAN Client) – BASIC Authentication with IoT Service Cockpit credentials.
      • E.g. https://<HOST_NAME>:443/iot/core/api/v1/devices/<Node_ID>/measures

Demo

 

 


IoT Gateway Cloud Services REST Protocol:

  1. Creating Device Data Model – Update with Custom Profile. Upload the Updated DataModel back to Service Cockpit.
  2. Device Onboarding
    • Creating Physical Node (Type: Endpoint)
    • Download Certificate of the Physical Device
    • Generate .p12 Certificates from client.ks. Run this command from certificate folder –
      • keytool -importkeystore -srckeystore client.ks -destkeystore client.p12 -deststoretype pkcs12
    • Refer the password file. Keep the Password same for all three times. .p12 file generated successfully.
  3. Enable SSL Certificate on Windows(Chrome Browser). Chrome -> Settings -> Manager Certificates. Import new .p12 file.
  4. Sending Data from POSTMAN using Secure Certificate.
    • Need to Close all chrome.exe instances. Use this command –
      • TASKKILL /IM chrome.exe /F
    • This will close all the chrome browser instances including POSTMAN(if open). You can optionally re-install the POSTMAN client following the Prerequisite video.
  5. Open POSTMAN and execute the POST call using this syntax –
    • https://<host>/iot/gateway/rest/measures/<mac_address>
    • Payload JSON: {“measureIds”:[1,2], “values”:[“75″,”25″],”profileId”:991, “logNodeAddr”:3}
    • Execute with NoAuth setting.
  6. Consume & View the Data
    • Gauge Consumption
    • Chart Consumption
    • Consume Via API (POSTMAN Client) – BASIC Authentication with IoT Service Cockpit credentials.
      • E.g. https://<HOST_NAME>:443/iot/core/api/v1/devices/<Node_ID>/measures

Demo

 

NOTE:

  • The availability of IoT Service Cockpit instance is currently limited to Customers.
  • This blog serves as a reference for quickly starting-off your IoT Journey with SAP Cloud Platform Internet of Things.

Get your hands dirty with the IoT Service and then further exploring SAP Leonardo IoT. Feel free to ask questions and provide feedback to improve the blog contents.

 

 

Last Modified 23rd Jul, 2017
Document Version 1.0

 

To report this post you need to login first.

8 Comments

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

  1. Avijit Dhar

    Hi Prakash,

    Thanks for the tutorial. Recently we have purchased our IoT 4.0 Tenant but I don’t see any Active Networks inside my IoT Cockpit. Can you please tell me how I can add the Active Networks like MQTT, REST which you have used in your example. My Netoworks inside IoT 4.0 cockpit look like the following –

    Please help.

    Thanks

    Avijit

     

    (0) 
  2. Prerana CV

    Hi Prakash,

    Thank you for the really nice videos. they are really helpful!

    We also have a IoT 4.0 tenant. I tried with and MQTT – Paho Client and i get the expected result, but when I tried REST – Postman I get the following error – 415 Unsupported media type.

    I tried running the URL directly in chrome and in the console i see 2 errors

    Could you please help ?

    Thanks,

    Prerana

    (0) 
    1. Prakash Upadhyay Post author

      Hi Prerana,

      You shouldn’t use Chrome for POST request. For above issue, you should check the content-type to be application/json in POSTMAN Headers and try giving valid MAC address in the URL.

      (0) 

Leave a Reply