IoT & Connectivity Tips | ThingWorx & Kepware PTC
Recently active
Use Case: You’ve published a model from Analytics Builder to Analytics Manager, and then used service CreateOrUpdateThingTemplateForModel on resource TW.AnalysisServices.ModelManagementServicesAPI. A thing created from the resulting template will have an infotable called “data” which needs to be populated in order to trigger an Analysis Event & Job.For example you might have been following the online documentation for Analytics Manager > Working with Thing Predictor > Demo: Using Thing Predictor, link here.This script makes it easy to create a line of test data into field "data" on your thing to trigger the analysis event & job. Also fields causalTechnique, goalName and importantFieldCount are set programmatically, these are needed for the analysis event & job.Also this script might be useful as a general example of how to write to an infotable property on a thing.The JavaScript code is shown here and also attached as a text file to this post:me.causalTechnique = 'FUL
Pushbullet is a lightweight notifications platform and can be a way to explore Alerts and SubscriptionsBasically create an an Alert on a property and Subscribe to that AlertAdding Alert to Property HumidityAdding SubscriptionThe PTC-PushBulletHelper is just a generic Thing with a service called PushNotificationvar json = { "body": Message, "title":"Temperature fault", "type":"note"};var accessHeader = { "Access-Token": "o.Hnm2DeiABcmbwuc7FSDmfWjfadiLXx2M"};var params = { proxyScheme: undefined /* STRING */, headers: accessHeader /* JSON */, ignoreSSLErrors: undefined /* BOOLEAN */, useNTLM: undefined /* BOOLEAN */, workstation: undefined /* STRING */, useProxy: undefined /* BOOLEAN */, withCookies: undefined /* BOOLEAN */, proxyHost
I have implemented an Edge Nano Server that offers the following advantages:Easy to setupNot limited to HTML protocol. For example, an edge device can be implemented that connects to devices via BluetoothCode can be found here:GitHub - cschellberg/EdgeGatewayCode contains EdgeNanoServer, docker installation scripts(for installing Thingworx Platform), and a test client done in python.Don SchellbergConsultant
I have put together a small sample of how to get property values from a Windows Powershell command into Thingworx through an agent using the Java SDK.In order to use this you need to import entities from ExampleExport.xml and then run SteamSensorClient.java passing in the parameters shown in run-configuration.txt (URL, port and AppKey must be adapted for your system). ExampleExport.xml is a sample file distributed with the Java SDK which I’ve also included in the zipfile attached to this post. You need to go in Thingworx Composer to Import/Export … Import from File … Entities … Single File … Choose File … Import.Further instructions / details are given in this short video: Video Link : 2181
The Metadata for the 8.1 release has been updated from that of the previous releases as part of the architecture update that is new in 8.1. The goal of this blog post is to inform you of these changes to the metadata, and where you can find more information on both the new metadata format, as well as all the other changes that are new for the 8.1 release.New StructureThe image below provides an excerpt of what the metadata file itself will look like in practice. The table below provides a definition for what each field in the metadata is and how it should be populated in your metadata file.ParameterDescriptionRequired/OptionalfieldNameThe exact name of the field as it appears in the data file.RequiredvaluesA list of the acceptable values for the field.Note:For Ordinal opTypes, the values must be presented in the correct order.Required if the opType is OrdinalOptional for Categorical opTypeDo not use for Boolean and ContinuousrangeFor a Continuous field, defines the minimum and ma
1. Create a network and added all Entities that implement from a specific ThingShape in the network 2. Create a ThingShape mashup as below Note: Bind the Entity parameter to DynamicThingShapes_TracotrShape's service GetProperties input EntityName. Laso bind mashup RefreshRequested event to that service 3. Create a mashup named ContentShape, add Tree widget and ContainedMashp in it 4. Bind Service GetNetworkConnection's Selected Row(s) result and Selected RowsChanged event to ContainedMashup widget Note: Master can total replace ThingShape mashup. Suggest to use Master after ThingWorx 6.0
Sometimes you need to do something on a schedule. Axeda Platform is primarily focused on processing events as they happen. But in the case where some action needs to take place periodically, there are Rule Timers. A Rule Timer has a schedule to run, and a list of rules its associated with.Rule Timer SchedulesA schedule is defined by a string using the cron syntax. This syntax is extremely flexible and powerful, but can be hard to understand. The fields are as follows:Seconds (0-59)Minutes (0-59)Hours (0-23)Day-of-Month (1-31)Month (1-12) OR jan,feb,mar, apr ...Day-of-Week (0-7) (Sunday is 0 or 7) OR sun, mon, tue, wed, thu, fri, satYear (optional field)Some examples"0 0 12 ? * WED" - which means "every Wednesday at 12:00 pm""0 0/5 * * * ?" - means Fire every 5 minutes"0 0 2 * * ?" - means Fire at 2am every dayNote: Rule Timer schedules are in GMT/UTC.Associated Expression RulesThe Rule timer has no other purpose but to run Expression Rules. These rules can be System or Asset. SystemTim
In this post we will take a look at using an existing JavaScript Library. The library will we will use is agGrid which provides a very extensive Grid UI component.The objectives areTo see how to add the libraryUse an external source to populate the gridProvide a click action when a user selects a row (Part 2)(see attachments - import AAGridExtensionExample as an extension and import as File PTC-ExternalSources-Entities )Previous Posts for referenceWidget Extensions IntroductionWidget Extensions Click EventWidget Extensions Date PickerWidget Extensions Google BounceWe will not worry about CSS - I'm working on a post for that using Thingworx 8.2 CustomClass (CSS) feature.Also I will assume you have worked through the Widget Extensions IntroductionThe image below image below shows the resulting UI after grid population and a user clicked a rowThe following provides the high level areas of interestSteps1. Create a Working Folder for example AGGrid as in previous posts setup you
Sometimes the following error is seen filling up the application log: "HTTP header: referrer".It does not cause noticeable issues, but does fill up the log. This article has been updated to reflect the workaround: https://www.ptc.com/en/support/article?n=CS223714To clear the error, locate the validation.properties inside the ThingworxStorage\esapi directory.Then change the values of both Validator.HTTPHeaderValue_cookie and Validator.HTTPHeaderValue_referer to:Validator.HTTPHeaderValue_cookie= ^.*$Validator.HTTPHeaderValue_referer= ^.*$
I had just finished writing an integration test that needed to update a Thing on a ThingWorx server using only classes in the Java JDK with as few dependencies as possible and before I moved on, I though I would blog about this example since it makes a great starting point for posting data to ThingWorx. ThingWorx has a Java SDK which uses the HTTP Websockets protocol and you can download it from our online at the ThingWorx IoT Marketplace that offers great performance and far more capabilities than this example. If you are looking, however for the simplest, minimum dependency example of delivering data to ThingWorx, this is it.This examples uses the REST interface to your ThingWorx server. It requires only classes already found in your JDK (JDK 7) and optionally includes the JSON Simple jar. References to this jar can be removed if you want to create your property update JSON object yourself. Below is the Java Class.package com.thingworx.rest;import org.json.simple.JSONObject;import j
This expert session focuses on overviewing the patch and upgrade process of the Thingworx platform. It provides information on how to perform a patch upgrade for the platform as well as extensions upgrade, and when an in-place upgrade is applicable. It can be viewed as a quick reference note for upgrading your system. For full-sized viewing, click on the YouTube link in the player controls. Visit the Online Success Guide to access our Expert Session videos at any time as well as additional information about ThingWorx training and services.
This expert session goes over some basic backup and recovery principles, and provides details on how these principles can be applied to backing up a ThingWorx Server. Backup methods for the ThingWorx PostgreSQL, Neo4J and H2 releases are discussed. For full-sized viewing, click on the YouTube link in the player controls. Visit the Online Success Guide to access our Expert Session videos at any time as well as additional information about ThingWorx training and services.
This is a basic troubleshooting guide for ThingWorx. It goes over the importance, types and levels of logs, getting started on troubleshooting the Composer, Mashup and Remote Connectivity. For full-sized viewing, click on the YouTube link in the player controls. Visit the Online Success Guide to access our Expert Session videos at any time as well as additional information about ThingWorx training and services.
Previous PostsWidget Extensions IntroductionWidget Extensions Click EventWidget Extensions Date PickerI was asked was it possible to make the Google Maps indicator bounce if a property was set to true. The answer is yes.Open up the google maps extension and locate the googlemap.ide.jsMake the above changes.Open up the googlemap.runtime.js and search forif (showMarkers) {after the if add the following belowMake sure you have a property needsAttension on a returned Thing. If the value is true it will bounce!After viewing Mashup there are 4 locations but one needs attention.
This document attached to this blog entry actually came out of my first exposure to using the C SDK on a Raspberry PI. I took notes on what I had to do to get my own simple edge application working and I think it is a good introduction to using the C SDK to report real, sampled data. It also demonstrates how you can use the C SDK without having to use HTTPS. It demonstrates how to turn off HTTPS support.I would appreciate any feedback on this document and what additions might be useful to anyone else who tries to do this on their own.
Previous blogs Widget Extensions IntroductionWidget Extensions Click EventThis blog we will take a quick look at making a new Date Picker WidgetI'm not going to worry about styles just the basics of getting the widget defined and able to place in the Composer canvas.As in previous blogs we have to decide on a name, we will use DatePickerBecause we don't want to write all of the logic that has been written many times will use a jquery datepicker https://jqueryui.com/datepicker/ which has a lot options.The simple syntax is $(#myDate).datepicker() which will do most of the work.The $ is the jquery reference an the #myDate is the id where the datapicker will render and the datepicker is the function worker.Before we get into the renderHtml I realize I need to quickly talk about the widgetProperties function in the ide.js. This where we set what properties can be defined and whether they are dynamic. For example the thought it useful to have a Title , Date and some simple css style c
This video is the 3rd part of a series of 3 videos walking you through how to setup ThingWatcher for Anomaly Detection. In this video we will use Anomaly Mashup to visualize data received from my remote device. Updated Link for access to this video: Anomaly Detection 8.0: Viewing Data via Anomaly Mashup: Part 3 of 3
Presentation for MFG Apps Tips & Tricks Session #3 - PTC IoT Starter Kit, Presented by Serge Romano 1DEC2017
As many already know, ThingWorx versions 8.0+ now support both Apache Tomcat versions 8.0.44+ and versions of 8.5.13+. For this reason, many will want to consider using the latest Apache version for their ThingWorx instance, even despite the fact that the installation documentation does not seem to provide examples for the 8.5.x versions. This is because much of the configuration between the two versions remains the same.One may question these similarities when looking at the updated documentation from Apache on configuring SSL Connector ports. It would seem like some of the more traditional elements are now unusable, since they are marked for deprecation (including keystoreFile, keystorePass, and clientAuth). However, for now, these elements are still usable because Tomcat will convert whatever is provided in the Connector tag to the brand new SSLHostConfig tag (used primarily by Tomcat going forward). Apache has noted that these configuration options will continue to be usable throug
Preface In this blog post, we will discuss how to Start and Stop ThingWorx Analytics, as well as some other useful triaging/troubleshooting commands. This applies to all flavors of the native Linux installation of the Application. In order to perform these steps, you will have to have sudo or ROOT access on the host machine; as you will have to execute a shell script and be able to view the outputs. The example screenshots below were taken on a virtual CentOS 7 Server with a GUI as ROOT user. Checking ThingWorx Analytics Server Application Status 1. Change directory to the installation destination of the ThingWorx Analytics (TWA) Application. In the screenshot below, the application is installed to the /opt/ThingWorxAnalyticsServer directory 2. In the install directory, there are a series of folders and files. You can use the ls command to see a list of files and folders in the installation directory. a. You wil
The following is valid for ThingWorx Analytics (TWA) 52.0.2 till 8.0 For release 8.3.0 and above see How to score new data in ThingWorx Analytics 8.3.x ? Overview The main steps are as follow: Create a dataset Configure the dataset Upload data to the dataset Optimize the dataset Create filters for training and scoring data Train the model Execute scoring on existing data Upload new data to dataset Execute scoring on new data TWA models are dataset centric, which means a model created with one dataset cannot be reused with a different dataset. In order to be able to score new data, a specific feature, record purpose in the below example, is included in the dataset. This feature needs to be included from the beginning when the data is first uploaded to TWA. A filter on that feature can then be created to allow to isolate desired data. When new data comes in, they are added to the original dataset but with a specific value for the filtered feature (record purpose)
Mapping previous versions of ThingWorx Analytics API to ThingWorx Analytics 8.1 Services Since ThingWorx Analytics 8.1, the classic server monolith has been replaced by a series of independent microservices. This new structure groups services around specific elements of functionality (data, training, results). Thus the use of the previous API commands to access ThingWorx Analytics functions has been replaced by the use of ThingWorx Services. Those Services exist within specific Microservice Things accessible in the ThingWorx Platform 8.1.The table below shows a mapping of the most common previous API commands from version 8.0 and previous versions to the version 8.1 related services. The table below does not contain an exhaustive listing either of API commands nor of Services.The API commands used below are samples which might require further information like headers and Body once used. These are used in the table below for reference purposes.Previous API Command PurposeSample SyntaxT
Key Functional Highlights Patching & Upgrades Supports upgrading from 8.0.1 using the Manufacturing Apps Installer Streamlined patch support for customer issues Updated the installer technology to align with ThingWorx platform App Improvements Fixed bugs with acknowledging alerts Added support for collecting feature data from National Instruments InsightCM product Controls Advisor Added ability to retrieve KEPServerEX connection information in case the connection is lost or deleted Minor UI improvements Asset Advisor Updated the UI for anomaly status Production Advisor Improved the status history widget to align with Asset Advisor Added synchronized zooming to the chart widgets Compatibility ThingWorx 8.1.0 KEPServerEX 6.2, 6.3 KEPServerEX V6.1 and older as well as different OPC Servers (with Kepware OPC aggregator) Support upgrade from 8.0.1 Documentation ThingWorx Manuf
This Blog presents a simple Java utility to validate the deployment of ThingWatcher. It is important to note that the utility used is not a real life situation, the intent was to keep it as simple as possible in order to achieve its aim: validation of the deployment. An understanding of Java IDE (such as Eclipse) is necessary in order to run the utility with relevant dependency and classpath setup. Those are beyond the scope of this posting.We will cover the following points:Pre-RequisitesUsing the sample utilityCode walk throughValidate training job creationValidate model job creationUpdate for ThingWorx Analytics 8.0Pre-requisitesA strict adherence to the ThingWatcher deployment guide is recommended in order to first deploy training and model microservices as well as to familiarize yourself with ThingWatcher APIs. Prior to testing ThingWatcher, both the training and model microservices should be up and runningThe media for ThingWatcher (including model and training micro-service) sho
Dive back into the mashup builder and learn about advanced widgets and layout options. For full-sized viewing, click on the YouTube link in the player controls. Visit the Online Success Guide to access our Expert Session videos at any time as well as additional information about ThingWorx training and services.
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.