Overview

Skill Level: Beginner

IBM IoT Connection Service integrates a bundled set of preselected services to form a public, multitenant SaaS solution on the IBM Cloud framework.

Ingredients

IBM IoT Connection Service SaaS Instance

Step-by-step

  1. Accessing the IBM IoT Connection Service Dashboard

    • Using a web browser such as Chrome or Firefox, navigate to the URL for your IoTCS instance provided to you.

    https://dashboard-us.connectedproducts.internetofthings.ibmcloud.com/preauth?tenantid=CSNAXX

    For example:

    https://dashboard-us.connectedproducts.internetofthings.ibmcloud.com/preauth?tenantid=CSNA8

    • Click the “Log in as <instance name>” and proceed to login using your IBM credentials.

    Once you have logged in, you should see a dashboard similar to the following.

    Screen-Shot-2018-09-03-at-15.54.41

    The following services and their corresponding usage data might be displayed:

    1. IBM Watson™ IoT Platform
    2. IBM IoT Registration Service
    3. Cloudant NoSQL DB
    4. IBM Db2® Warehouse on Cloud
    5. IBM Cloud Object Storage
    6. IBM Cloud App ID
    7. IBM Message Hub for IBM Cloud
    8. IBM Secure Gateway for IBM Cloud
    9. IBM IoT Blockchain Service

     

    Note: Depending on your plan, not all services might be available.

     

    In this recipe we will primarly learn how to register and connect a device and then create a device twin.

    In part 2 of this recipe we will learn about other services as well.

  2. Service metrics

    Clicking on any of the service names allows you to view subscribed capacity and consumption

    Screen-Shot-2018-09-04-at-10.19.24

     

  3. Security and Authentication

    IBM IoT Connection Service provides secure end-to-end solution for your data and access. Each service component manages the security of its part of the solution.

    Examples:

    •  Device connection and security is managed by Watson IoT Platform
    •  Data security and integrity is managed by each of the storage solutions.
    •  User authentication is managed by each component, usually by using the IBMid as the common mechanism.
    •  Inter-service data flow takes place over secure communication with encrypted data per IBM’s Standard Security policies.
  4. View details of a service

    • Click the “View Details” of a service to see more information such as API keys and URL endpoints to access the service API.

    • Some of the services also have a “Launch” button to allow you to navigate to the web UI for that service.

     

    Screen-Shot-2018-09-04-at-10.24.35

  5. IoT Platform Service

    Navigating to IoTP

     

    • Make note of the “Org Id” found in the “View Details” dialog for the IoT Platform service.

    • Click the “Launch” button to open the IoTP in a separate tab.

    • Click the “Sign In” button to log into the service.

    • Lastly, choose the Org ID found in the details of service.

    Screen-Shot-2018-09-04-at-10.26.30

  6. Register and Connect Device

    On the left hand, in the menu icon Click on Devices icon.

    Go to the Device Types tab and click on Add Device Type Button on top right.

     

    Screen-Shot-2018-09-04-at-10.27.11

     

    On the click on “Add Device Type Button”. Enter the name of Device Type.

     

    Picture2

    Provide the name of the Device Type. And Click on Next.

    Then Add the Device Information. It is Optional. Click on Next.

    Picture3

    Once all this is done you have registered the Device Type successfully.

     

     

    Picture1-1

     

    Now add the Device, by clicking on the “Register Devices” button. Enter any Device ID.

     

    Picture2-1

     

    Click on Next.

    Picture3-1

     

    Add the Metadata. It is Optional. Click on Next. 

    Picture1-2

    Now enter your own Authentication Token. In case left blank then platform generates a Authentication Token on its own.

    Click on Next.

     

    Picture2-2

     

    Click on Done.

    Picture3-2

    You will find all the details Device Type, Device ID and the Securit Token. Please note down all this information for the future reference and making connection to the device.

    Conculsion of this step – Device Type and Device Id created successfully.

     

    Next Step – Enable Simulation

     

  7. Enable Simulation

    This Simulation feature let you send the device event to the created device.

    To enable simulation, on the left menu click on Settings. Scroll down to the page to Device Simulator. Activate the Device Simulator.

    At the bottom left you will find a tab “0 simulations running”. Click on the New Simulation.

    Picture4

    Click on new Event Type. Set the JSON message. You can use the sample message also or create your own JSON message as well. Click on Save.

     

    Picture5

     

  8. Create Device Twin

    A device twin includes a physical interface and one or more logical interfaces, each corresponding to an event type sent by a device.

    • IoT Connection Service requires one logical interface per event type for each device type.
    • The physical and a logical interfaces of the device twin are required to send your IoT data to the Db2 Warehouse on Cloud component according to the IoTdate life cycle flow.

    Creating Interface-

    Click on Device Types. Click on the particular deviceType on which you need to create Interface.

    Click on Interface.Click on Create Interface.

    Provide a name  to the interface and click on next.

    Creating_Interface

    Adding Properties to Interface-

    Click on Create EventType. As you have already enabled the simulation you can Click on “Use Last Event Cache” and select the Device Id from the drop down.

    Adding_Properties_to_Interface

     

    Now select the properties you need to map to the Logical Interface. Click on Add and then Click on Done.

    Adding_Properties_to_Interface_2

    Creating Physical and Logical Interface-

    Once you will click on Done you will find the Physical and Logical Interface are created. Then Click on Activate button.

    Then click on Done and then Deploy.

    Creating_Physical_and_Logical_Interface

     

    Once Deployed the Device Twin is created.

  9. View Device Details in IoTP

    While the simulation is running, you can navigate back to the IoTP tab and view live MQTT messages coming from the simulated device.

    • Click on the “Device” tab to view the device.
    • Click on the created device and then the “Recent Events” tab to view live sensor data.

    View_Device_Details

     

    IOTP Service

    Once you are in the IoTP service, you can begin to create device types and devices in order to start connecting physical devices and collecting sensor data.

    IOTP_Service

     

    In this recipe we learned about the Watson IoT platform register and connect device, enable simulation and how to create device twin.

     

    In the part 2 of this recipe we will learn about other services on the IBM IoT Connection Services Instance.

  10. References

    https://www.ibm.com/support/knowledgecenter/en/SSQP8H/iot-connected-products/kc_welcome.html

    The second part of this recipe is available at : https://developer.ibm.com/recipes/tutorials/ibm-iot-connection-service-watson-iot-platform-part-2/

     

  11. Co-Author of this recipe

    Surbhi Agarwal (surbhi_agarwal@in.ibm.com) is IoT Solution Architect and co-author of this recipe.

1 comment on"IBM IoT Connection Service - Watson IoT Platform - Part 1"

  1. Where is this service listed in the IBM Cloud catalog? How do I provision the Connection Service?

Join The Discussion