Skip to main content

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 upfront.

Collecting Expected Information

First time generating all informations

Follow these steps in order to generate all the informations you need.

Go to the IBM Watson IoT Dashboard

  1. Click the Devices link in the left menu, then click on the Device Types section, and then click on the Add Device Type button.

img

  1. First, create the Gateway type: fill the Name value, click Next.

img

  1. Click Done to create the gateway Type.

img

  1. Repeat the same action to create the Device type.

Mettre un tip note warning be sure to copy these infos or else you will have to regenerate them

Organization ID

Go to the IBM Watson Iot Platform's dashboard page. You should see the Organization ID in the top right corner.

img

API Key

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 click on the Device Types section, and then click on the Add Device Type button.

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

  1. 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

  1. On the Device information tab click Next.

img

  1. On the Permissions tab select Privileged Gateway and click Next (read this 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

  1. 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

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

  1. Select the region to deploy the application

img

  1. Select the pricing plan. For a demo, the Lite/free plan should be ok. For production select a paid plan that fits your needs.

img

  1. Fill in the service name, select the region to deploy and create the organization/space if needed. After filling the form, click Create.

img

  1. Finally, 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. Do not forget to copy the organization ID.

img

Creating a Connection With API

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:

PropertyExpected results
connectorIdSet to actility-watson-iot
configuration/orgIdOrganization id of the Watson IoT account.
configuration/gatewayIdId of the Watson IoT gateway used by the connector.
configuration/gatewayTypeWatson IoT gateway type of the Watson IoT gateway used by the connector.
configuration/gatewayTokenAuthentication token of the Watson IoT gateway used by the connector.
configuration/deviceTypeWatson IoT Device type to be associated with the Devices processed by the connector.
configuration/apiKeyAPI Key of the Watson IoT application to be associated with the connector.
configuration/apiTokenAuthentication Token of the Watson IoT application to be associated with the connector.
Important note

All properties are not present in this example. You can check the rest of these properties in the common parameters section.

Creating a Connection From UI

  1. Click Connections -> Create -> ThingPark X IoT Flow.

img

Then, a new page will open. Select the connection type : IBM Watson IoT.

img

  1. Fill in the form as in the example below and click on Create.

img

Limitations

Look on Watson IoT Platform Quotas 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.

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

Troubleshooting

As for now, there are no detected bugs.