IoT & Connectivity Tips | ThingWorx & Kepware PTC
Recently active
A Feature - a piece of information that is potentially useful for prediction. Any attribute could be a feature, as long as it is useful to the model.Feature engineering – Feature engineering is the process of transforming raw data into features that better represent the underlying problem to the predictive models, resulting in improved model accuracy on unseen data. It’s a vaguely agreed space of tasks related to designing feature sets for Machine Learning applications.Components: First, understanding the properties of the task you’re trying to solve and how they might interact with the strengths and limitations of the model you are going to use. Second, experimental work were you test your expectations and find out what actually works and what doesn’t.Feature engineering as a technique, has three sub categories of techniques: Feature selection, Dimension reduction and Feature generation.Feature Selection:Sometimes called feature ranking or feature importance, this is the process of ra
Hi, I have just been playing around with the Edge MicroServer on a couple of Raspberry Pi's. I obviously want them connected to ThingWorx, however they stop when the SSH session closes which isn't ideal. I thought about doing something really quick and dirty using 'nohup', but this could have lead to many running processes, and wouldn't still not have started automatically when the Pi booted. So, I did it right instead using init.d daemon configurations. There are two files; one for the EMS and one for the Lua Script Resource. You need to put these in /etc/init.d, then make sure they are owned by root. sudo chown root /etc/init.d/thingworx* sudo chgrp root /etc/init.d/thingworx* You'll need to modify the paths in the first lines of these files to match where you have your microserver folder. Then you need to update the init.d daemon configs and enable the services. sudo update-rc.d thingworx-ems defaults sudo update-rc.d
Merging InfoTables can seem to be an overwhelming task in ThingWorx. What even IS an InfoTable?? The short answer is that an InfoTable is a specifically structured JSON object. Merging InfoTables is therefore as easy as incrementing through each, adding the columns of each to another table, and then populating the new table with data.For InfoTables with the same DataShapes, the built in "Union" service can be used. Find this snippet under the InfoTableResources section. There is also a snippet for incrementing through DataShape fields if the DataShape is known. For InfoTables which don't have the same DataShapes or for which the DataShape is not known, things get a bit trickier. Thankfully, some new KCS documentation provides example code to step you through merging any number of tables together.I hope this documentation is helpful!
As per ThingWorx Documentation:Updating Properties Automatically in a MashupA mashup using the GetProperties service can be configured to use websockets and receive updates to properties automatically.When creating or editing a mashup, you can configure the GetProperties service so that the properties are automatically updated by selecting the Automatically update values when able checkbox in the service properties panel.So, the feature to update Properties Automatically in a Mashup is limited to GetProperties service only.Following are the steps to invoke our own custom Service automatically when a property change:1. Find all the Properties in your Thing for which the DataChange should trigger the custom service.2. In mashup; add value display widget (or some other widgets) for each property in Step1.3. Bind the properties from GetProperties service to these widget.4. Set visible property of these widgets to false so that they don't show up at the RunTime.5. Now bind the ServiceInvoke
This simple example creates an infotable of hierarchical data from an existing datashape that can be used in a tree or D3 Tree widget. Attachments are provides that give a PDF document as well as the ThingWorx entities for the example. If you were just interested in the service code, it is listed below: var params = { infoTableName : "InfoTable", dataShapeName : "TreeDataShape" }; // CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(TreeDataShape) var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params); var NewRow = {}; NewRow.Parent = "No Parent"; NewRow.Child = "Enterprise"; NewRow.ChildDescription = "Enterprise"; result.AddRow(NewRow); NewRow.Parent = "Enterprise"; NewRow.Child = "Site1"; NewRow.ChildDescription = "Wilmington Plant"; result.AddRow(NewRow); NewRow.Parent = "Site1"; NewRow.Child = "Site1.Line1"; NewRow.ChildDescription = "Blow Molding"; result.AddRow(NewRow); NewRow.Paren
If the ThingWorx 7.4 installation with MSSQL db doesn't start with a license error on the splash screen, despite taking the necessary steps for specifying the license path, the error might be misleading and the problem is actually lying in the database connection. Going to THingworxStorage/logs and opening ApplicationLog.log might reveal the following (or similar ) errors:2017-04-13 10:26:17.993-0400 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [T: localhost-startStop-1] Sending Post Start Notifications...2017-04-13 10:26:17.999-0400 [L: ERROR] [O: c.t.p.m.MssqlModelExceptionTranslator] [I: ] [U: SuperUser] [S: ] [T: localhost-startStop-1] [message: Could not create a transaction for ThingworxPersistenceProvider]2017-04-13 10:26:18.001-0400 [L: ERROR] [O: E.c.t.p.d.FileTransferDocumentModelProvider] [I: ] [U: SuperUser] [S: ] [T: localhost-startStop-1] [context: Could not create a transaction for ThingworxPersistenceProvider][message: Could not create a transaction f
This Javascript snippet creates a random value between those limits: var dbl_Value = Math.floor(Math.random()*(max-min+1)+min);
Usually we want to search out all User list in ThingWorx with Service GetEntityList But it only shows limited information. In order to see more details like User Extension information etc., and in order to add more search conditions we could encapsulate it in a new created service. Below is an example code:input: emailAddress(String)output: INFOTABLE // Code start here// step 1 Get all user listvar params = { maxItems: undefined /* NUMBER */, nameMask: undefined /* STRING */, type: "User" /* STRING */, tags: undefined /* TAGS */ }; var users = Resources["EntityServices"].GetEntityList(params); // step 2 get all other properties for user listvar params = { infoTableName: "infotable" /* STRING */, &nb
This example is to achieve to update objects in Windchill thru extensions. It is really hard to find a resource for Windchill extension's services to take an advantage of them. So, I wrote a simple example to update objects in Windchill from Thingworx. There are three data shapes needed to do this. One is "PTC.PLM.WindchillPartUfids" which has only "value" field (String) in it and another is "PTC.PLM.WindchillPartCheckedOutDS" which has a "ufid" field (String). Last one is "PTC.PLM.WindchillPartPropertyDS" which has a "ufid" field (String) and fields for "attributes". For an instance of the last data shape, there might be three fields as "ufid", "partPrice" and "quantity" to update parts. In this example, this data shape has two fields which are "ufid" and "almProjectId". In this example, this needs two input parameters. One is ufid (String) and almProjectId (String). If you need to have multiple objects to update at once, you can use InfoTable type as an "ufid" input par
In the following scenario (for redhat in this case), running the dbsetup script results in the error:./thingworxPostgresDBSetup.shpsql:./thingworx-database-setup.sql:1: ERROR: syntax error at or near ":"LINE 1: CREATE TABLESPACE :"tablespace" OWNER :"username" location :... ^psql:./thingworx-database-setup.sql:3: ERROR: syntax error at or near ":"LINE 1: GRANT ALL PRIVILEGES ON TABLESPACE :"tablespace" to :"userna... ^psql:./thingworx-database-setup.sql:5: ERROR: syntax error at or near ":"LINE 1: GRANT CREATE ON TABLESPACE :"tablespace" to public; ^psql:./thingworx-database-setup.sql:14: ERROR: syntax error at or near ":"LINE 1: CREATE DATABASE :"database" WITH ^psql:./thingworx-database-setup.sql:16: ERROR: syntax error at or near ":"LINE 1: GRANT ALL PRIVILEGES ON DATABASE :"database" to :"username";Given that the installed components match the requirements guide (tomcat 8, Postgresql 9.4.5+ for Thingworx 7.x), run the following command:Run this directl
One of topics that are usually of interest when entering the ThingWorx world is integration with third-party systems.Disclaimer: the following guide is intended to be rather comprehensive and guide you in achieving the best integration with your desired system ( !=quick and dirty ).For example, from my experience, customers many times ask:-how can I connect to my hardware device-how can I connect to this device cloud so I can get data from it?-how can I connect to my ERP?With some luck, I hope that at the end of this article I will provide a generic workflow that will help you on achieving the best integration solution for your use-case.We need to write down some requirements (they are not in order; depending on the usecase might not be worth to be answered):0. What is the usecase (detailed description) ?. This is by far one of the most important aspects of any software development project. Please document your usecase with all possible
This video is the 2nd part, of a series of two videos, walking you through the configuration of Analysis Event which is applied for Real-Time Scoring. This part 2 video will walk you through the configuration of Analysis Event for Real-Time Scoring, and validate that a predictions job has been executed based on new input data. Updated Link for access to this video: Analytics Manger 7.4: Configure Analysis Event & Real Time Scoring Part 2 of 2
This video walks you through the use of Analysis Replay to execute analysis events on historic data. This video applies to ThingWorx Analytics 7.4 to 8.1 Updated Link for access to this video: Analytics Manager : Using Analysis Replay
This video is the 1st part of a series of two videos walking you through the configuration of Analysis Event which is applied for Real-Time Scoring. This 1st video demonstrate how to create a Template and Thing which allows the prediction model to score in real-time. Note that this video is just for demo purposes, customers who have ThingWorx, they of course already have their properties set-up. They just need to configure Analysis Event which is demonstrated in the part 2 video. Updated Link for access to this video: Analytics Manger 7.4: Create a Template & Thing for Real-Time Scoring Part 1 of 2
This video will walk you through the first steps of how to set-up Analytics Manager for Real-Time Scoring. More specifically this video demonstrates how to create an Analysis Provider and start ThingPredictor Agent. NOTE: For version 8.1 the startup command for the Agent has changed view the command in PTC Help center. Updated Link for access to this video: ThingWorx Analytics Manager: Create an Analysis Provider & Start the ThingPredictor Agent
When an Expression Rule of type Alarm, AlarmExtendedDataChange, AlarmSeverityChange or AlarmStateChange calls a Groovy script, the script is provided with the implicit object alarm. This example shows how the alarm object can be used.This Expression Rule uses the CountAlarmsSinceHours Groovy script to check the number of alarms in the past number of hours, and escalate the alarm if more than three alarms have occurred:IF ExecuteCustomObject("CountAlarmsSinceHours", 1) < 3THEN SetAlarmState("ACKNOWLEDGED", "Less than three alarms in the past hour")ELSE SetAlarmState("ESCALATED", "THREE OR MORE alarms in the past hour")Here is the definition of the CountAlarmsSinceHours Groovy script. The script uses the parameter 'hours' passed from the expression rule and the implicit object 'alarm'. It returns the number of times the current alarm has occurred within 'hours' hours.import com.axeda.drm.sdk.Contextimport com.axeda.drm.sdk.data.HistoricalAlarm
In this part of the Troubleshooting blog series, we will review the process on how to restart individual services essential to the ThingWorx Analytics Application within the Virtual Machine Appliance. Services have stopped, and I cannot run my Analytics jobs! In some cases, we have had users encounter issues where a system or process has halted and they are unable to proceed with their tasks. This can be due to a myriad of reasons, ranging from OS hanging issues to memory issues with certain components. As we covered earlier in Part II, the ThingWorx Analytics Application is installed in a CentOS (Linux) Operating System. As with most Linux Operating Systems, you have the ability to manually check and restart processes as needed. Steps to Restart Services With how the Application is installed and configured, the services for functionality should auto start when you boot up the VM. You will have to verify that the Appliance is functional by running your desir
AboutThis is the second part of a ThingBerry related blog post series.ThingBerry is ThingWorx installed on a RaspBerry Pi, which can be used for portable demonstrations without the need of utilizing e.g. customer networks. Instead the ThingBerry provides its own custom WIFI hotspot and allows Things to connect and send / receive demo data on a small scale.In this particual blog post we'll discuss on how to setup the ThingBerry as a WIFI hotspot to directly connect with mobile devices or other Raspberry Pis.As the ThingBerry is a highly unsupported environment for ThingWorx, please see this blog post for all related warnings.In case this guide looks familiar, it's probably because it's based on https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/WIFI Hot SpotAs the ThingBerry is currently connected via ethernet we can utilize the Raspberry Pi's WIFI connection to create a private network where all the wireless devices can connect to, e.g. another Raspberry
There are multiples approaches to improve the performanceIncrease the NetWork bandwidth between client PC and ThingWorx ServerReduce the unnecessary handover when client submit requests to ThingWorx server through NetWorkHere are suggestions to reduce the unnecessary handover between client and serverEliminate the use of proxy servers between client and ThingWorxIt is compulsory to download Combined.version.date.xxx.xxx.js file when the first time to load mashup page (TTFB and Content Download time).Loading performance is affected by using of proxy servers between client and ThingWorx Server.This is testing result with proxy server set upThis is the test result after eliminiating proxy server from the same environmentCut off extensions that not used in ThingWorx serverAfter installed extensions, the size of Combined.version.date.xxx.xxx.js increasedAvoid Http/Https request errorsThere is a https request error when calling Google map. It takes more than 20 seconds
ThingWorx 7.4 covers the following areas of the product portfolio: ThingWorx Analytics, ThingWorx Utilities and ThingWorx Foundation which includes Core, Connection Server and Edge capabilities.Key Functional HighlightsHighlights of the release include:SourceIntegration: Improved integration framework making it easy to connect with external systems, including a standard Windchill connector, to retrieve data on demand.Industrial Connectivity: New Industrial Gateway and Discover navigation tool simplifying the mapping of tags to properties, including performance enhancements for data updates.Edge/CSDK: Build process improvements, Subscribed Property Manager (SPM) enhancements, asynchronous service requests and TLS updates to increase developer productivity, improve application performance and strengthen security.AWS IoT Connector: The latest version 1.2 of the Connector allows customers to more fully leverage their investment in AWS IoT. It features improved deployment automation v
One commonly asked question is what are the correct settings for the Configuration Tables tab when creating/setting up a Database Thing to connect to a SQL Server (2005 or later) database. There are a couple of ways to do this but the tried and true settings are listed below.connectionValidationString - SELECT GetDate() jDBCConnectionURL - jdbc:sqlserver://servername;databaseName=databasenamejDBCDriverClass - com.microsoft.sqlserver.jdbc.SQLServerDriver Max number of connections in the pool - 5 (this can be modified based on number of concurrent connections required) Database Password - databaseusername Database User Name - databaseuserpassword <br> The jdbc driver file sqljdbc4.jar is by default installed with the ThingWorx server. It is located in TomcatDir\webapps\Thingworx\WEB-INF\lib\
Connecting to other databases seemed to be a hot desirable from our training feedback.So we've just added a video tutorial in the Wiki for connecting ThingWorx to SQL Server (or SQL Server Express).See topic 7.04 or go to the Video Appendix.In essence connecting to other databases like mySQL or Oracle will work the same way except you will have to change the Database URL and JDBC reference.Also let me take this opportunity to wish everyone a blessed holiday season!
Recently, mentor.axeda.com was retired. The content has not yet been fully migrated to Thingworx Community, though a plan is in place to do this over the coming weeks.Attached, please find OneNote 2016 and PDF attachments that contain the content that was previously available on the Axeda Mentor website.
This is just a quick reference on how to install pgadmin 3 if the autoinstall with yum command (sudo yum install pgadmin3) fails.Two routes would be available.Try runningyum list pgadmin*If you see something like this:that means the package is available in the highlighted repository, you'd just need to add it.rpm -Uvh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-redhat94-9.4-3.noarch.rpmAfter that, try sudo yum install pgadmin3_94 (insert your actual version)2. If you would like a different version (or the latest one) of pgadmin, what you could do is grab the .tar.gz file from here https://www.postgresql.org/ftp/pgadmin3/release/Then manually install it. For example for version 1.22.2 (the version is just for demoing purposes – I grabbed the top one available in the list):mv pgadmin3-1.22.2.tar.gz /usr/local/srccd /usr/local/srctar –zxvf pgadmin3-1.22.2.tar.gzcd pgadmin3-1.22.2./configuremakemake installThen you would need to configure your server to allow remote user acces
Welcome to the Thingworx Community area for code examples and sharing. We have a few how-to items and basic guidelines for posting content in this space. The Jive platform the our community runs on provides some tools for posting and highlighting code in the document format that this area is based on. Please try to follow these settings to make the area easy to use, read and follow. At the top of your new document please give a brief description of the code sample that you are posting. Use the code formatting tool provided for all parts of code samples (including if there are multiple in one post). Try your best to put comments in the code to describe behavior where needed. You can edit documents, but note each time you save them a new version is created. You can delete old versions if needed. You may add comments to others code documents and modify your own code samples based on comments. If you have alternative ways to accomplish the same as an existi
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.