# CREATING AN IBM WATSON CONNECTION

This setup is intended to be a minimal setup example to get the Watson IoT connector working. The Watson IoT connector requires the creation of an IBM Cloud account (opens new window) upfront.

# Creating an IBM Watson IoT Platform

  1. To create an IBM Watson IoT Platform go to IBM Cloud Dashboard and select Create resource.

img

  1. Select “Internet Of Things” Platform:

img

Fill in the service name, select the region to deploy and create the organization/space if needed. Then scroll down and select pricing plan.

For a demo, the Lite/free plan should be ok. For production select a paid plan that fits your needs. After plan selection, click Create.

img   3. On the next screen, click Launch to start the IoT Platform:

img

You will be redirected to the newly created IBM Watson IoT Platform dashboard.

img

# Creating a Connection

MQTT over TLS is the protocol used by Watson. You need to create the connection prior to creating the flow. The creation of a connection establishes a link from ThingPark Wireless to the cloud provider that you want to associate a Device with. The link can be used to transport any Uplink regardless the DevEUI parameter. To do this, you need to use the following endpoints:

  • POST/connections for creation
  • PUT/connections for modification
  • DELETE/connections for deletion

Note

When you update a configuration property on a connection, you must provide the whole configuration properties again.

Example of the creation of a connection.

    POST /connections
    
    {
      "connectorId": "actility-watson-iot",
      "name": "Watson Demo Connection",
      "configuration": {
        "description": "Watson Datacenter",
        "orgId": "936ou1",
        "deviceType": "actilitydevicetype",
        "gatewayType": "actilitygatewaytype",
        "gatewayId": "actilitygateway",
        "gatewayToken": "GXvfTVxJXoI@Z(ufxU",
        "apiKey": "a-936ou1-4ocurmbrva",
        "apiToken": "SgbW?FYqeK6&sIhDoe"
      }
    }

The following table lists the expected results of the properties when applied:

Property Expected results
connectorId Set to actility-watson-iot
configuration/orgId Organization id of the Watson IoT account.
configuration/gatewayId Id of the Watson IoT gateway used by the connector.
configuration/gatewayType Watson IoT gateway type of the Watson IoT gateway used by the connector.
configuration/gatewayToken Authentication token of the Watson IoT gateway used by the connector.
configuration/deviceType Watson IoT Device type to be associated with the Devices processed by the connector.
configuration/apiKey API Key of the Watson IoT application to be associated with the connector.
configuration/apiToken Authentication Token of the Watson IoT application to be associated with the connector.

# Collecting Expected Information on Watson

On the Watson dashboard right corner or in the url you can find the orgId value: https://936ou1.internetofthings.ibmcloud.com/dashboard/devices/browse

img

  1. Click the “Devices” link in the left menu, then “Device Types”, and then Add Device Type.

img

  1. Create first the Gateway type: fill the Name value, click Next and on the next page click Done.

img

img

  1. Repeat the same action for creating the Device type.

img   4. On the “Device Types” list you should see the newly created Device types:

img

  1. Create now a Gateway. Go to “Device” and click Add Device:

img

  1. On “Identity” tab select the gateway type previously created, fill the gateway id and click Next.

img

7. On the “Device information” tab click Next.

img

  1. On the “Permissions” tab select “Privileged Gateway” and click Next (read this (opens new window) to understand the difference between Standard and Privileged Gateway):

img

  1. On the “Security” tab leave Authentication Token empty to let Watson auto-generate one for you and click Next.

img

  1. On “Summary” tab click Done.

img

  1. On the final page you have the Organization ID and all gateway info required for the connection configuration:
  • Organization ID is the “orgId”
  • Device ID is the “gatewayId”
  • Device Type is the “gatewayType”
  • Authentication Token is the “gatewayToken”. Copy and save this token because generated Authentication tokens are non-recoverable.

img

  1. After this we need to create an API Key/token to be used for listing/registering devices under the gateway Device that we created.
  2. Select “Apps” from the left menu and click Generate API Key.

img

  1. On the “Information” tab select a desired API Key Expiration date and click “Next”:

img

15. On the “Permissions” tab, select “Standard Application” Role and click “Generate Key”:

img

  1. On the final page you get the generated API Key/Token need it for connection configuration:
  • API Key is the “apiKey”
  • Authentication Token is the “apiToken”. Copy and save this token because generated Authentication tokens are non-recoverable.

img

# Limitations

Look on Watson IoT Platform Quotas (opens new window) for choosing a Watson plan that suits your needs. We recommend that you use the Standard plan for production and the lite plan for testing purposes. 14.5 Displaying Information to Know if it Worked

  1. Go to the Watson dashboard and select “Device” from the left menu.
  2. Select the Device that you want to monitor and go to “Recent Events” tab and wait for uplinks to be displayed.   You should see something like this:

img

Last Updated: 1/12/2021, 6:02:10 PM