IoT & Connectivity Tips | ThingWorx & Kepware PTC
Recently active
Step 9: File TransferStep 10: TroubleshootingStep 11: Tunneling ExampleStep 12: Next Steps Step 9: File Transfer To handle file transfers, create a virtual directory in the FileTransferExample Entity and in the project directory. The source code used for this example is found in com.thingworx.sdk.examples.FileTransferExample.java. Set Up File Transfer Right-click the project. Click New. Scroll and select Folder.Enter transfer/incoming into the text box at the bottom. Click Finish.Repeat steps 1 and 2, but create a folder called transfer/outgoing.Right-click the transfer/outgoing folder. Click New. Scroll and select File.Create a file with the name outgoing.txt. Click Finish.Once the outgoing.txt document is open, add the following text, click Save, and close the file:Hello. This is a file coming from the client application.Navigate to the FileTransferExample.java code and update the lines below
Step 7: Delivery Truck ModelStep 8: Services and Events Step 7: Delivery Truck Model In the Delivery Truck application, there are three Delivery Truck Things. Each Thing has a number of Properties based on its location, speed, and its deliveries carried out. In this design, when a delivery is made or the truck is no longer moving, the property values are updated. The DeliveryTruckThing class extends the VirtualThing class and based on the DeliveryTruck Entities in the Composer. After extending VirtualThing, there are a number of steps necessary to get going. For the DeliveryTruckThing and SimpleThing classes, there are a number of methods for creating Properties, Events, Services, and Data Shapes for ease of use. The constructor for the DeliveryTruckThing takes in the name of the Thing, the description of the Thing, and the ConnectedThingClient instance used to make the connection. It then sends these values to the VirtualThing constructor as sh
Step 6: Power Grid Example Step 6: Power Grid Example In the Power Grid application, there are three Generator Things and three Consumers. Each Thing has a number of Properties based on its location, wattage, and its power lines provided with power. In this design, when a generator goes offline, comes back online, or one of the other power grid aspects are updated/created/deleted, the Property values are updated. The GeneratorThing class extends the VirtualThing class and based on the Generator entities in the Composer. After extending VirtualThing, there are a number of steps necessary to get going. For the GeneratorThing and SimpleThing classes, there are a number of methods for creating Properties, Events, Services, and Data Shapes for ease of use. The constructor for the GeneratorThing takes in the type of electricity generator, name of the Thing, the description of the Thing, and the ConnectedThingClient instance used to
Step 3: Test ConnectivityStep 4: Run Sample ApplicationsStep 5: Example Client Connection Step 3: Test Connectivity Before you can begin developing with the ThingWorx Java SDK, you will need to generate an Application Key and add it to the source code provided. Generate Application KeyOn the Home screen of Composer click + New the top left. In the dropdown list, click Application Key. Give your Application Key a name (i.e., MyAppKey) and set the Project (ie, PTCDefaultProject).Assign the application key to a User. Click Save.After saving, a Key ID is generated and appears above the Expiration Date. This is the secret key that you will use to make secure connections. If you have not updated the Expiration Date field, the default will be one day.This is an example of the Application Key ID that you will use for a successfull connection. NOTE: Using the Application Key for the default Adminis
GUIDE CONCEPTStep 1: Completed ExampleStep 2: Environment Setup Use our developer toolkit to connect Java-enabled devices and build an application. GUIDE CONCEPTThis project will introduce complex aspects of the ThingWorx Java SDK and help you to get started with development. Following the steps in this guide, you will develop your own IoT application with the ThingWorx Java SDK. We will teach you how to use the Java programming language to connect and build IoT applications to be used with the ThingWorx Platform. NOTE: This guide's content aligns with ThingWorx 9.3. The estimated time to complete all parts of this guide is 60 minutes. YOU'LL LEARN HOW TO Establish and manage a secure connection with a ThingWorx server, including SSL negotiation and connection maintenanceEnable easy programmatic interaction with the Properties, Services, and Events that are exposed by Entities running on a ThingWorx serverCreate applications that can be di
Step 7: Import ExtensionStep 8: Integrating Custom AuthenticationStep 9: Next Steps Step 7: Import Extension In the ThingWorx Composer. in the bottom left, click Import/Export, then select Import. NOTE: The build produces a zip file in AuthenticatorExample->build->distributions folder. This zip file will be required for importing the extension. 2. For the Import Option field, select Extension. 3. Click Browse and choose the zip file in the distributions folder (located in the Eclipse Project's build directory). 4. Click Import to finalize the import. Navigate to New Authenticator Navigate to and select Security > Authenticators. 2. You will now see your CustomizedAuthenticator Authenticator as a option to view/edit. 3. C
Step 4: Install and ConfigureStep 5: Create Extension ProjectStep 6: Build Extension Step 4: Install and Configure Before you install the plugin, ensure that software requirements are met for proper installation of the plugin. Open The Eclipse IDE and choose a suitable directory as a workspace.Go to the menu bar of the Eclipse window and select Help->Install New Software…After the Install window opens, click Add to add the Eclipse Plugin repository.Click Archive… and browse to the directory where the Eclipse Plugin zip file is stored and click Open.NOTE: Do not extract this zip file.Enter a name (for example, Eclipse Plugin). Click OK.Ensure that the Group items by category checkbox is not selected.Select ThingWorx Extension Builder in the items list of the Install window.Click Next and the items to be installed are listed.Click Next and review the licens
GUIDE CONCEPTStep 1: Completed ExampleStep 2: Understanding AuthenticatorsStep 3: Download Plugin and SDK Build authentications extensions quickly and add to the security of your application. GUIDE CONCEPT Extensions enable you to quickly and easily add new functionality to an IoT solution. Extensions can be service (function/method) libraries, connector templates, functional widgets, and more. These pointers and steps will enable you to maintain focus on development of your own application and still utilize the power of ThingWorx for other purposes at the same time. When to Utilize: You have your own login from outside of ThingWorx but you want to leverage ThingWorx user management You are using an identity provider other than ThingWorx You need to support passing of credentials in headers/query string parameters which ThingWorx doesn’t support out-of-the-box Concept Whether you would like ThingWorx to handle the security f
Guide ConceptStep 1: Install SoftwareStep 2: Set up Arduino IDE, Developer Board, and ThingWorx ServerStep 3: Run Arduino DemoStep 4: Next Steps Connect an ESP8266 WiFi module using the Arduino programming environment and the ThingWorx REST API. This information was created for a previous version of ThingWorx and may not be fully accurate. Report any issues with this article here. Guide Concept This project will introduce the utilities ThingWorx provides for connections to an Adafruit Feather. Following the steps in this guide, you will have a fully configured setup between your Adafruit Feather and the ThingWorx platform to begin your IoT development. We will teach you how to utilize the ThingWorx REST API and the Arduino programming language to connect your Adafruit Feather for IoT application development. You'll learn how to Connect an ESP8266 WiFi module to a ThingWorx server Use the Arduino programming environment with t
GUIDE CONCEPTStep 1: Completed ExampleStep 2: Templates and Using Code Snippets Expedite your application development with new ThingWorx features. GUIDE CONCEPT This project will introduce you to a variety of features designed to expedite the IoT application development workflow. In particular, there are several features that make the creation of custom Services quicker and easier when writing and testing your code. Following the steps in this guide, you will learn how to access features that will help you throughout your software development lifecycle: development, execution, and testing. We will teach you how to became a faster and more efficient IoT application developer. YOU'LL LEARN HOW TO Use Snippets to generate codeExecute and test ServicesSave Service test cases to facilitate QA processUtilize the code auto-completion featureTest code at design time with Lint warnings and errors NOTE: This guide's content aligns with
Step 3: Test Services and Save Test CasesStep 4: Utilize Code Auto-Complete FeatureStep 5: Test Code at Design Time with LintingStep 6: Next Steps Step 3: Test Services and Save Test Cases In the previous step, you created an Entity with a customized Service. You can easily test and update the Service within the same editing window. This allows you to quickly modify a Service and confirm that its new behavior is functioning as expected.Test Execution To execute a Service, you can do it while still developing and after you have created it. During Development Open the LineCheckSystem Thing.Select the Services tab.Click the ListHotLineParts link. If you scroll to the bottom of the page, you will see the Execute window. Enter a value for the TemperatureThreshold and click Execute. After Development Open the LineCheckSystem Thing.Select the Services tab.Click the&nb
GUIDE CONCEPTStep 1: Completed ExamplesStep 2: Bind Data to WidgetStep 3: Next Steps Connect IoT data from devices to Widgets that display in your application UI. GUIDE CONCEPT This project will demonstrate how to bind a data source to a Widget. Following the steps in this guide, you will be able to show state-based changes resulting from data updates. We will teach you how to essentially connect your backend data to the Widgets in your Mashup. ThingWorx facilitates this process with built-in functionality. YOU'LL LEARN HOW TO Bind data to Widgets in ThingWorx Mashup NOTE: This guide's content aligns with ThingWorx 9.3. The estimated time to complete this guide is 30 minutes. Step 1: Completed Examples Download the Complete Data Binding Example using file BindDataEntities.zip attached to this guide. Within this file you, you will find Entities referenced in this lesson, including a finished ap
Step 8: TroubleshootingStep 9: Next Steps Step 8: Troubleshooting Issue Resolution CSS does not seem to be applied to the Mashup.Verify your CSS is included in the runtime TWX CSS. Clear Browser cache if your CSS is not merged to the combined TWX CSS. (under debug mode: Hold refresh button->Clear Cache).TWX fails to import the extension.If the extension is already installed, but you made recent changes, you need to bump the Version number in the metadata.xml.Recent CSS changes are ignored.Clear browser cache if your CSS file has changed recently. Step 9: Next Steps Congratulations! You've successfully completed the Add Style to Your UI with CSS guide, and learned how to: Create custom CSS classes using the integrated CSS editorBind CSS classes to a Mashup and to individual WidgetsUse Media queries to dynami
GUIDE CONCEPTStep 1: Custom CSS BenefitsStep 2: Access Sample FilesStep 3: Create CSS Rule BlockStep 4: Apply Custom Class to MashupStep 5: Apply Custom Class to WidgetStep 6: Bind Custom ClassStep 7: Use Media Queries Modernize your Mashups with CSS to enhance the presentation of your application. GUIDE CONCEPT This project will introduce using CSS to create a customized, consistent look and feel for your IoT application. Following the steps in this guide, you will create a custom CSS class definitions and bind these classes to Mashup features. We will teach you how to present a professional-looking user interface and ensure consistency of style treatments within your application by implementing Cascading Style Sheets (CSS) in Mashups. You'll learn how to Create custom CSS classes using the integrated CSS editorBind CSS classes to a Mashup and to individual WidgetsUse Media queries to dynamically apply styling Step 1: Custom CS
GUIDE CONCEPTStep 1: Configure Google Maps WidgetStep 2: Add Google Maps Widget to MashupStep 3: Download Sample EntitiesStep 4: Add Markers to Google Maps Widgets Add a Google Map to your UI that visually presents geographical data. GUIDE CONCEPTThis project will introduce how to visually present geographical data in your application. Showing data on a map is a valuable feature for IoT application. Following the steps in this guide, you will utilize the Google Maps Widget and explore it’s ability to show multiple Things. We will teach you how to use Geological data to convey pertinent information in your UI. YOU'LL LEARN HOW TO Download and import the Google Maps Widget extensionCreate a Mashup and add a Google Maps WidgetConfigure the Google Maps Widget to display the locations of multiple Things NOTE: This guide's content aligns with ThingWorx 9.3. The estimated time to complete ALL 2 parts of this guide is 30 minutes. St
Step 5: Widget PropertiesStep 6: Next Steps Step 5: Widget Properties You can configure Properties to change the style of the map as well as specify a custom image to use for map markers. Other Properties allow two linear paths and polynomial regions to also be displayed on the map Widget with optional tooltip data. Bindable Name Type Default Direction DescriptionDataInfotableNoneInputSource for the data that is displayed as discrete markersLocationFieldMenuNameNoneInputField that contains Location type data to plot markersMarkerFieldMenuNameNoneInputField that contains data of type Image used to plot markersShowMarkerTooltipBooleanTrueInputHovering over map markers will display a tooltip when set to trueToolTipField1 thru 4MenuNameNoneInputOptional field displayed in tooltip when the user hovers over a map markerToolTipLabel1 thru 4StringNoneInputOptional label for tooltip dataRouteDataInfotableNoneInputSource for the data that is displayed as a
Step 11: UsersStep 12: TroubleshootingStep 13: Authentication TagsStep 14: Next Steps Step 11: Users Access to functions and information on the ThingWorx Foundation server is controlled by Users. The REST API can be used to create, list, and delete Users. Get Usernames of all Users The REST API exposes the ability to retrieve collections of Entities so that a UI can be dynamically updated with current data. Required Parameters AppKey created by your Foundation serverRequest Construct the URL. Include the hostname and authentication credentials for your specific ThingWorx server as described below. The Usernames of all Users can be returned by making a GET request to this endpoint: 〈Server IP:port〉/Thingworx/UsersAuthenticate Request. All API requests to the ThingWorx server must be authenticated either with a username and password or with an appKey. For this example we will authenticate by passing the appKey as a URL query string parameter. The parame
Step 8: Call Custom ServiceStep 9: Import and Export EntitiesStep 10: Authentication Tags Step 8: Call Custom Service In order to execute a Service of a specific Thing with the REST API, you can use the POST verb. Required Parameters: AppKey created by your ThingWorx server Name of the Thing that implements a custom Service Name of the custom Service Names of inputs, if any, required by the Service Request Construct the URL. To call a custom Service of an existing Thing, make an HTTP POST to this endpoint: <server_ip:port>/Thingworx/Things/<name of Thing>/Services/<name of Service> Substitute <name of Thing> with the actual name of a Thing that exists on the ThingWorx server, and <name of Service> with an existing Service. Send request parameters The names of the inputs along with their values are sent in the body of the POST as a JSON object. For example, the JSON ob
Step 5: Add Property to ThingStep 6: Set Property ValueStep 7: Get Latest Property Value Step 5: Add Property to Thing Property values are associated with a specific Thing, and are used to store data that changes over time. Required Parameters AppKey created by your ThingWorx server Name of the Thing to which the Property will be added Name for the new Property and data type of the Property's value Request Construct the URL. A new Property can be added to an existing Thing by making an HTTP POST to this endpoint. Substitute <name of Thing> with the actual name of a Thing that exists on the ThingWorx server that will have the Property added. <server_ip:port>/Thingworx/Things/<name of Thing>/Services/AddPropertyDefinition 2. Send request parameters. The name of the new Property to be added and type of the Property are sent in the body of the POST as a JSON object. For example, the JSON
GUIDE CONCEPTStep 1: REST API DesignStep 2: REST ClientStep 3: Create Application KeyStep 4: Create New Thing Leverage the REST API to create Things, modify Properties, execute Services and more. GUIDE CONCEPT This project will introduce you to the REST API utilized by the ThingWorx platform. Following the steps in this guide, you will be able to connect to the ThingWorx platform and make REST calls to call Services, update Properties, and perform a number of actions for your IoT applications. We will teach you how to use the ThingWorx REST API to create a more robust application. With the REST API you can leverage the full power of the ThingWorx Foundation server with simple HTTP requests. The REST API can easily be explored using a command line tool such as curl, a browser plugin like Postman, or any preferred programming language. YOU'LL LEARN HOW TO Create new Things on a ThingWorx Foundation Server Add Properties to Things Acc
Step 9: File Transfer ExampleStep 10: Support Other PlatformsStep 11: Next Steps Step 9: File Transfer Example To handle file transfers, a virtual directory is created in the SteamSensor1 entity and in the [C SDK HOME DIR]/examples/FileTransferExample application directory. The source code used for this example is found in [C SDK HOME DIR]/examples/FileTransferExample/src/main.c. Inside of the [C SDK HOME DIR]/examples/FileTransferExample folder, create the folder structure shown below: /transfer//transfer/incoming//transfer/outgoing/ Inside of the /transfer/outgoing/ directory, create and open a file with the name outgoing.txt.Once the outgoing.txt document is open, add the following text, save, and close the file:Hello. This is a file coming from the client application.Navigate to the [C SDK HOME DIR]/examples/FileTransferExample/src/main.c code and update the lines below with the appropriate informa
Step 6: Data ShapesStep 7: Events and ServicesStep 8: Tasks Step 6: Data Shapes Data Shapes are an important part of creating/firing Events and also invoking Services Define With Macros In order to define a Data Shape using a macro, use TW_MAKE_DATASHAPE. NOTE: The macros are all defined in the twMacros.h header file. TW_MAKE_DATASHAPE("SteamSensorReadingShape", TW_DS_ENTRY("ActivationTime", TW_NO_DESCRIPTION ,TW_DATETIME), TW_DS_ENTRY("SensorName", TW_NO_DESCRIPTION ,TW_NUMBER), TW_DS_ENTRY("Temperature", TW_NO_DESCRIPTION ,TW_NUMBER), TW_DS_ENTRY("Pressure", TW_NO_DESCRIPTION ,TW_NUMBER), TW_DS_ENTRY("FaultStatus", TW_NO_DESCRIPTION ,TW_BOOLEAN), TW_DS_ENTRY("InletValve", TW_NO_DESCRIPTION ,TW_BOOLEAN), TW_DS_ENTRY("TemperatureLimit", TW_NO_DESCRIPTION ,TW_NUMBER), TW_DS_ENTRY("TotalFlow", TW_NO_DESCRIPTION ,TW_INTEGER) ); Define Without Macros In order to define a Data Shape without using a macro, use the twDataShape_Cr
Step 5: Properties Step 5: Properties In the Delivery Truck application, there are three Delivery Truck Things. Each Thing has a number of Properties based on its location, speed, and its deliveries carried out. In this design, when a delivery is made or the truck is no longer moving, the Property values are updated. The deliveryTruck.c helper C file is based on the DeliveryTruck Entities in the Composer. After calling the construct function, there are a number of steps necessary to get going. For the SimpleThing application, there are a number of methods for creating Properties, Events, Services, and Data Shapes for ease of use. Properties can be created in the client or just registered and utilized. In the SimpleThingClient application, Properties are created. In the DeliveryTruckClient application, Properties are bound to their ThingWorx Platform counterpart. Two types of structures are used by th
GUIDE CONCEPTStep 1: Completed ExamplesStep 2: Environment SetupStep 3: Run Sample CodeStep 4: ExampleClient Connection Use the C SDK to build an app that connects to ThingWorx with persistent bi-directional communication. GUIDE CONCEPT This project will introduce more complex aspects of the ThingWorx C SDK and help you to get started with development. Following the steps in this this guide, you will be ready to develop your own IoT application with the ThingWorx C SDK. We will teach you how to use the C programming language to connect and build IoT applications to be used with the ThingWorx Platform. YOU'LL LEARN HOW TO Establish and manage a secure connection with a ThingWorx server, including SSL negotiation and connection maintenanceEnable easy programmatic interaction with the Properties, Services, and Events that are exposed by Entities running on a ThingWorx serverCreate applications that can be directly used with your device running the
Build a Predictive Analytics Model - Video GuideThingWorx Analytics Server Installation with SSLThingWorx Platform Analytics Installation with SSLToolbar Widget | ThingWorx 9ThingWorx SSO: Login demonstration from Azure AD to ThingWorxMenu Bar Widget ThingWorx 9ThingWorx AD FS SSO SetupCreate Your Application UIGet Started with ThingWorx for IoTThingworx Mashup 101 - Do's and Don'tsWhat's New in ThingWorx 9.1Standardize Connectivity to Devices, Applications, & Systems for Centralized IIot DataBar Chart Widget | ThingWorx 9Button Widget | ThingWorx 9Line Chart Widget | ThingWorx 9ReImagine Your Application UI With Collection and Custom CSSTesting Your Edge ApplicationPredictive Maintenance with Thingworx 101ThingWorx Mashup Pitfalls: What to Avoid and What Not to DoIoT Security: Keeping Devices Safe in a High Risk WorldEdge Connectivity in Unreliable Networks Build a Predictive Analytics Model - Video Guide This project will introduce ThingWorx Analytics Builder via a conv
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.