Community Tip - You can change your system assigned username to something more personal in your community settings. X
Guidelines for selecting the optimal method for connecting to ThingWorx
In the world of IoT application development, connectivity refers to the infrastructure and protocols which connect devices to the cloud or network. Edge devices handle the interface between the physical world and the cloud.
ThingWorx provides you with several different tools for connecting to the Thingworx platform.
This guide is designed as an introduction to these tools, and will help you determine which to choose based on your specific requirements.
NOTE: This guide's content aligns with ThingWorx 9.3. The estimated time to complete this guide is 30 minutes
There are many factors that will influence your decision about the ideal mechanism to connect to ThingWorx. On this page we compare and contrast different methods and give examples for where each one is a natural fit.
Connectivity Method | Developer Benefit |
REST API | Integrate seamlessly using dynamically-generated API calls |
Azure IoT Hub Connector | Connect devices that use Azure IoT Hub |
Edge SDKs | Build full-featured integrations for any platform |
ThingWorx Kepware Server | Connect out-of-the-box with over 150 protocol drivers for industrial equipment |
Edge MicroServer | Establish bi-directional connectivity with this complete, ready-to-run agent |
Pros | Cons | Typical use case | Skills Required | Connection Type |
Web developer can easily create integration | ThingWorx cannot trigger action on the edge | Push data from small devices to ThingWorx | REST API development | Request/Response |
Using the ThingWorx REST API is an easy way for low-capability devices to connect with a ThingWorx platform. Any edge device that can make an HTTP POST can read and update properties or execute services on a ThingWorx platform. The disadvantage of this method is that it is one way from edge to platform. There is no way for the platform to initiate a service on the remote device and properties are only updated when the edge device initiates a connection with ThingWorx.
Learn more about the ThingWorx REST API:
Pros | Cons | Typical use Case | Skills Required | Connection Type |
Easily connect devices that use Azure IoT Hub | Adds dependency and cost to application | Add ThingWorx for devices connected with the Azure cloud | Azure edge development | AlwaysOn™ |
The diagram illustrates device-to-cloud integration with the Azure IoT Hub.
The ThingWorx Azure IoT Hub Connector establishes network connections to both ThingWorx Foundation and the Azure IoT Hub. Data flows in from devices, through the Azure IoT Hub hosted in the cloud, to the ThingWorx Azure IoT Hub Connector configured for a specific ThingWorx instance. The ThingWorx Azure IoT Hub Connector translates messages from the Azure IoT Hub format, to the native ThingWorx format and uses an established AlwaysOn connection to forward the information to ThingWorx Foundation.
Pros | Cons | Typical Use case | Skill Required | Connection Type |
|
All functionality must be developed by programmer | Full customization or tight integration required | Application development in Java, C, or .Net | AlwaysOn™ |
These SDKs are developer tools that wrap the protocol used to connect to the ThingWorx Platform. There are SDK's available for Java, C, and .Net languages. The Edge MicroServer uses the C SDK internally. All SDKs use the ThingWorx AlwaysOn binary protocol together with the HTTP WebSocket protocol for transport. WebSocket connections can operate through a firewall allowing two-way, low latency communication between the device and server. The SDKs support the following key concepts that allow a Thing developed with an SDK to be a full-fledged entity in the ThingWorx environment:
You can choose from any of the SDK's to create a custom application that meets their exact requirements.
The C SDK is the most lightweight of all the SDKs and will result in an application that uses the least amount of RAM, frequently requiring less than 200kB. It is the only SDK that is distributed as source code, allowing compilation of C SDK applications on any platform even those without an operating system.
Learn more about the C SDK:
The Java SDK is designed for portability and simplicity to ease connecting any Java-enabled device or system to ThingWorx. The Java SDK is provided as .jar files and sample Java source code. Any system that can run Java 1.7.51 or later should be able to build and run the example applications.
Learn more about the Java SDK:
The .Net SDK is provided as .dll files with sample Visual C# project files and source code. Any system that can run Microsoft NET 3.5 SP1 Framework development environment should be able to build and run the example applications.
Learn more about the .Net SDK:
Pros | Cons | Typical Use case | Skill Required | Connection Type |
Easily connect to hundreds of different types of industrial equipment | Requires computer running Windows physically connected to device | Adding ThingWorx to an industrial setting | Configure settings | AlwaysOn™ |
The ThingWorx Kepware Server Windows client lets users quickly and easily connect real-time, bi-directional industrial controls data to the ThingWorx IoT Platform via the ThingWorx AlwaysOn protocol. ThingWorx services enable users to browse, read, write, and interact with ThingWorx Kepware Server, and includes intuitive tools that simplify the modeling of industrial things.
Learn more about the ThingWorx Kepware Server:
Pros | Cons | Typical Use case | Skill Required | Connection Type |
Easily connect with simple scripting |
|
Connecting gateway router to ThingWorx | Configure settings | AlwaysOn™ |
The ThingWorx Edge MicroServer is a binary executable available for Windows and Linux running on either ARM or x86 processors. The EMS establishes an AlwaysOn, bi-directional connection to a destination ThingWorx platform when it is started. The EMS is configured by editing a json text file to specify the target platform and credentials. The EMS uses the always on connection to provide a local HTTP server that is a reflection of the platform REST API. This local copy of the platform API allows devices that are not capable of making encrypted connections across the open internet to securely interact with the platform. The EMS package also includes the Lua Script Resource application. This application extends the ThingWorx Foundation server by connecting through the EMS HTTP server and provides a Lua interpreter that can be used to connect local resources to the ThingWorx server.
Learn more about the ThingWorx Edge MicroServer:
Congratulations! You've successfully completed the Choose a Connectivity Method guide.
At this point, you can make an educated decision regarding which connection methods are best suited for your application and infrastructure.
The next guide in the Connect and Configure Industrial Devices and Systems learning path is Use REST API to Access ThingWorx
We recommend the following resources to continue your learning experience:
Capability | Guide |
Connect | ThingWorx Application Development Reference |
Build | Get Started with ThingWorx for IoT |
Experience | Create Your Application UI |
If you have questions, issues, or need additional information, refer to:
Resource | Link |
Community | Developer Community Forum |
Support | ThingWorx Connectors Help Center |