Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this tutorial, we will be demonstrating connectivity to IBM's Watson IoT platform (internetofthings.ibmcloud.com). We will use a RediGate 120e with internet connectivity to demonstrate this connectivity, but this tutorial can be applied to any RediGate device with internet connectivity.

...

  1. Using ACE, Open the default configuration you used in the "Getting Started Guide".
  2. Download and open Elecsys-IBM-Demo.xml from the http://partner.elecsyscorp.com site within the same ACE window.
  3. In your default configuration, enable the DNS Client object by setting its Enabled checkbox.


  4. Disable Virtual Unit 3 by clearing its Enabled checkbox.


  5. Copy and paste the following objects from the Elecsys-IBM-Demo.xml config into your default configuration. 
    1. TLS Tunnels  (paste under Networks).


    2. FieldUnitInternalMast2 (paste under NullCircuit)


    3. VirtualRW Unit 4 (paste under NullCircuit)


    4. Data Simulator (paste under Internal Channel 15)



    5. MQTT_Client (paste under Clients)



    Include Page
    Renaming Nodes
    Renaming Nodes


  6. Copy Table data from the Elecsys-IBM-Demo.xml Internal Channel 15 → Scan Table into your RediGate Configuration (in Internal Channel, open Scan Table, right-click and select Paste, over-write data). 
     

     



    Info
    titleScan Table Info

    The "Scan Period" object tells the RediGate which RTU (Unit 2, labeled as FieldUnitInternalMast2) to run at an interval (Scan Period) which is set to every 30 seconds. This is how frequently the data will be published to Watson IoT.

    Warning: Data charges may result from excessive usage of Watson IoT service and/or cellular data plan.



  7. Update your MQClient3_1 → Client ID to match the parameters in your IBM account, as described below.


    1. Client ID: g:orgid:gatewaytype:gatewayid

      In this example, the orgid is 5bl949, gatewaytype is RG1.
      The gatewayid can be hard-coded, or use  ${SERIAL}  as a variable that substitutes for the RediGate serial number (40170-0118, in this example), or use  ${GATEWAY}  to substitute for the Unit Name in the System object.

      In the Watson IoT platform, you have to add a device with a gatewayid for the Device ID (serial number, unit name, etc.) that matches what will be published from the RediGate.


    2. Password: For the MQTT password, use the "Authentication Token" credentials created for your "Device" in Watson IoT.


  8. Under the "TLS Tunnels" object, update the STUNNEL Parameters to point to your IBM IoT app.

    The Connect To address should be:   orgid.messaging.internetofthings.ibmcloud.com:8883



  9.  Edit the JSON_RBE → Topic Rules object so that the table entries comply with the rules that IBM expects for your gateway type, device type, etc. See IBM Watson IoT Use Case Notes for more information about acceptable topic architectures.
    The following is given as an example in this configuration (change  gatewaytype  to match the Device type created in your IoT Platform):

    GATEWAY PUBLISH topic:      iot-2/type/gatewaytype/id/${SERIAL}/evt/STAT/fmt/json
    GATEWAY SUBSCRIPTION topic: iot-2/type/gatewaytype/id/${SERIAL}/cmd/SYS/fmt/json
    DEVICE PUBLISH topic:       iot-2/type/DEV/id/${SERIAL}_${DEV}/evt/RBE/fmt/json

    DEVICE SUBSCRIPTION topic:  iot-2/type/DEV/id/${SERIAL}_${DEV}/cmd/CMD/fmt/json



    NOTE: use one or the other graphic, not both.


  10. Upload configuration to the RediGate

  11. In the Devices section of Watson IoT, you should a gateway with a "Device ID" that matches the serial number of your RediGate, and two devices connected to the gateway named "(your serial number)_SimData" and "(your serial number)_VirtualRW":



  12. Click on the Gateway name to see the connection status.

  13. Data should be being sent from the SimData RTU every 30 seconds:


    Info
    titleConnection Not Establishing

    It may take up to 5 minutes after uploading the configuration to the Redigate for the connection to IBM to be established, especially over a cellular connection.

...

  1. Completion of "Example 1" above.
  2. Completion of the "Field Device Quick Start" corresponding to the field device you are trying to connect to. In this particular example, we will be connecting to an Open Modbus TCP device, but you should be able to connect to any of the field devices on our protocol list.

...

  1. Confirm that you can ping the Modbus device using its built-in ping utility (See Ping Utility for more info)
  2. Open the configuration you used in the "Field Device Quick Start" in the same ACE window as your Watson IoT configuration that is producing the simulated data.
  3. Copy and paste the "Master Channel" object from the ModbusTCP configuration into your Watson IoT configuration
    Image Removed
    Note the "Instance" of the MasterChannel0 object – in this example it is '0', which is will what we reference when we add a record to our Watson IoT "Poll Table".
    Image Removed(paste under "Master Channels").
    Image Added

  4. Save and upload configuration to the RediGate.
  5. If you followed the "Device Publish" topic structure in the "Publishing Simulated Data to Watson IoT" example above, you should see a new device named (your serial number)_(your unit name), which will be publishing data as it changes based on your channel scan rate:
    Image RemovedImage Added