Documentation

c-treeEDGE IoT Database

Previous Topic

Next Topic

ThingWorx MQTT Extension

This tutorial demonstrates the basics of using the c-treeEDGE ThingWorx Extension. This extension uses MQTT to connect to the ThingWorx platform.

c-treeEDGE also provides a ThingWorx connector using the AlwaysOn protocol, as described in Installing and Configuring the c-treeEDGE AlwaysOn ThingWorx Connector. The AlwaysOn connector provides enhanced integration with ThingWorx.

This section explains how to install c-treeEDGE on the ThingWorx platform. ThingWorx allows enterprise-scale applications to be modeled by dragging and dropping "things." For more about this powerful platform, see ThingWorx later in this document.

c-treeEDGE requires creation and configuration of a c-treeEDGE "thing" in ThingWorx. Please refer to the ThingWorx website and the c-treeEDGE Thing download in the ThingWorx Marketplace for more information.

You will need to install and start the c-treeEDGE MicroServer, as described in Download and Installation.

To install the c-treeEDGE MQTT extension to ThingWorx, follow these steps:

  1. From a web browser, launch ThingWorx.
  2. Log into ThingWorx as an administrator.
  3. Go to Import/Export > Import.
  4. Click Choose File and select ctreeEdgeThingworxExtension.zip. (located in c-treeEDGE.<platform>\sdk\Thingworx)
  5. Click Import.

    Note: If an "Import Successful" message does not display, contact your ThingWorx System Administrator.

  6. Click Yes to refresh Composer after importing the final extension.
  7. Confirm that the Extension has been imported properly. Check the Application Log for potential problems.

Configuration

Create a new "thing" and select CtreeEdgeMQTTThingTemplate as a Thing Template.

Once the c-treeEDGE Database "thing" is created, it must be configured to connect to a c-treeEDGE Database instance.

  • Within the ThingWorx Composer, open up the c-treeEDGE Database "thing"
  • Navigate to the Configuration section
  • Under the connection settings, enter valid information for each of the connection parameters

Click the Add button to set the first property to be persisted on the Edge and enter the following information:

  • "Thing" to have property persisted on the Edge.
  • Property name to be persisted on the Edge.
  • MQTT Topic mapped to the property.
  • JSON tag used to send/get the property value.
  • Number of threads used on the c-treeEDGE for the persistence. This number should be increased only in case the volume of data is expected to be high.
  • Database where the persistent table will be created/maintained. Enter:
    ctreeSQL
  • Table name for the persistence data.
  • If c-treeEDGE should automatically add a timestamp to the persisted information.

Configure the MQTT System Topic. It must match the one subscribed to by the c-treeEDGE. Enter the following information:

  • ServerName for the MQTT broker.
  • ServerPort for the MQTT Port number.
  • UserName for authentication.
  • UserPassword for authentication.
  • UseSLL in case the MQTT connection should be SSL.
  • SystemTopic the c-treeEDGE is subscribing to.

Save the "thing."

TOCIndex