IoT & Connectivity Tips | ThingWorx & Kepware PTC
Recently active
This has been moved to its new home in the Augmented Reality Category in the PTC Community.
Does WSEMS use SSL pinning?Yes, it does. To explain the process a bit more, the ssl pinning is the act of verifying a server certificate by comparing it to the exact certificate that is expected. We “install” a certificate on the EMS (copying the cert to the ems device, and specifying the cert in config.json), EMS will then check all incoming certs against the cert in config.json, looking for an exact match and verifying the certificate chain.Should it be expected that the client, WSEMS.exe, installs the client certificate in order to validate the server certificate using SSL pinning?This does not happen automatically, the cert must be downloaded and manually added to the device. The config must also be manually updated.If so, how we issue the client cert for WSEMS.exe? Does it need to be issued the same way as the server certificate?If talking about pinning, one could use either the server cert directly, or the root cert (recommended). The root cert is the public cert of the signing a
In case we would like to create an external application and we aren't sure what's the best solution to use, below are some useful tips.Scenario:Let's say we use a gateway in order to access the external application we want to create. We would like to implement this gateway translating the ThingWorx standard protocol to the SCADA protocol. The system administrator, who manages the grid, has the own secure system, with a standard for communication inside the SCADA system, and we want to be able to get data from our system to the system they have. Let's also consider that the data is connected on the electrical field. Tips:It is recommended to develop a 3rd party that on one side talks to ThingWorx, and on the other side, talks to the SCADA system.This external ThingWorx application that we want to implement would have a series-edge-interface allowing to enter in our customer's Ethernet network, in order for both systems to communicate.JDBC is not recommended - it's mostly for connecting
IntroductionIn-Memory Column stores the data in columnar format contrary to row format. Allowing users to run faster analytics which is also the idea behind this is to push the computation as close to the data store as possible.In this post I'll configure the Oracle database to enable this feature and then populate one or more tables in the In Memory Column store. This could be particularly helpful if you are using Oracle 12c as an external data store for storing data in database table via JDBC connection, current/historic values from DataTable, Streams or ValueStreams for running analytics or DMLs with lots of join and require lot of computation before the data is finally presented on to the Mashup(s).For this post I used the data generated by temperature sensor getting stored in ValueStream, exported to CSV from the ValueStream and imported it in the Oracle table.In-Memory Column Store vs In-Memory database UsageAs mentioned above Oracle 12c version 12.1.2 comes with in built In-Memo
This document is designed to help troubleshoot some commonly seen issues while installing or upgrading the ThingWorx application, prior or instead of contacting Tech Support. This is not a defined template for a guaranteed solution, but rather a reference guide that provides an opportunity to eliminate some of the possible root causes.While following the installation guide and matching the system requirements is sufficient to get a successfully running instance of ThingWorx, some issues could still occur upon launching the app for the first time. Generally, those issues arise from minor environmental details and can be easily fixed by aligning with the proper installation process.Currently, the majority of the installation hiccups are coming from the postgresql side. That being said, the very first thing to note, whether it's a new user trying out the platform or a returning one switching the database to postgresql, note that: Postgresql database must be installed, configured, and runn
PLEASE NOTE DataConnect has now been deprecated and no longer in use and supported. We are regularly asked in the community how to send data from ThingWorx platform to ThingWorx Analytics in order to perform some analytics computation. There are different ways to achieve this and it will depend on the business needs. If the analytics need is about anomaly detection, the best way forward is to use ThingWatcher without the use of ThingWorx Analytics server. The ThingWatcher Help Center is an excellent place to start, and a quick start up program can be found in this blog. If the requirement is to perform a full blown analytics computation, then sending data to ThingWorx Analytics is required. This can be achieved by Using ThingWorx DataConnect, and this is what this blog will cover Using custom implementation. I will be very pleased to get your feedback on your experience in implementing custom solution as this could give some good ideas to others too. In this blog we
In this video we cover the installation of the UploadThing module. This video applies to ThingWorx Analytics 52.2 till 8.0. This is no longer applicable with ThingWorx Analytics 8.1 Useful links: How to copy files from Windows to Linux Updated Link for access to this video: Installing Thingworx Analytics Builder: Part 3 of 3
Validator widgets provide an easy way to evaluate simple expressions and allow users to see different outcomes in a Mashup.Using a validator is fairly intuitive for simple expressions, such as is my field blank? But if we need to evaluate a more complex scenario based on multiple parameters, then we can user our validator with a backing service that will perform more complex analytics.To show how services can work in conjunction with a validator widget, let’s consider a slightly more complicated scenario such as: A web form needs to validate that the zip or postal code entered by the user is consistent with the country the user selected.Let’s go through the steps of validating our form:Create a service with two input parameters. Our service will use regex to validate a postal code based on the user’s country. Here’s some sample code we could use on an example Thing://Input parameters: Country and PostalCode (strings)//Country-based regular expressions:var reCAD = /^[ABCEGHJKLMNPR
ThingWorx Analytics is capable of being assembled in multiple Operating Systems. In this post, we will discuss common issues that have been encountered by other users.Permissions Denied – Read/Write access to Third Party ComponentsThis is encountered when executing the desired Shell script to begin the creation process. In MacOS and Linux you may encounter a “Permissions Denied” error on the two required components in the creation, the packer-post-processor-vhd and packer components.Error MessageThis will result in a Terminal dialog message that will read “Process Completed, No Artifacts Created”. This indicates that the Packer Script has failed to complete the task, and the desired appliance images were not created.To correct this issue, you will have to change the permissions of the packer-post-processor-vhd and packer components to be able to be read and executable by the user account that is attempting to create the appliance.SolutionRun the following commands in the Virtual Machin
Here is a sample to run ConvertJSON just for test1. Create a DataShape 2. There are 4 input for service ConvertJSONfieldMap (The structure of infotable in the json row)json (json content) { "rows":[ { "email":"example1@ptc.com" }, { "name":"Lily", "email":"example2@ptc.com" } ]}rowPath (json rows that indicate table information)rowsdataShape (infotable dataShape)UserEmail
One of the issues we have encountered recently is the fact that we could not establish a VNC Remote session.The edge was located outside of the internal network where the Tomcat was hosted, and all access to the instance was through an Apache reverse proxy.The EMS was able to connect successfully to the Server, because the Apache had correctly setup the Websocket forwarding through the following directive:ProxyPass "/Thingworx/WS/" "wss://192.168.0.2/Thingworx/WS"However, we saw that tunnels immediately closed after creation and as a result (or so we thought), we could not connect from the HTML5 VNC viewer.More diagnostics revealed that you need to have ProxyPass directives for the following:-the EMS will make calls to another WS endpoint, called WSTunnelServer. After you setup this, the EMS will be able to create tunnels to the server.-the HTML5 VNC page will make a "websocket" call to yet another WS endpoint, called WSTunnelClient.Only at this step you have the ability to succe
Hello,Since there have been discussions regarding SNMP capabilities when using the ThingWorx platform, I have made a guide on how you can manage SNMP content with the help of an EMS.Library used: SNMP4J - http://www.snmp4j.org/Purpose: trapping SNMP events from an edge network, through a JAVA SDK EdgeMicroServer implementation then forwarding the trap information to the ThingWorx server. Background: There are devices, like network elements (routers, switches) that raise SNMP traps in external networks. Usually there are third party systems that collect this information, and then you can query them, but if you want to catch directly the trap, you can use this starter-kit implementation.Attached to this blog post you can find an archive containing the source code files and the entities that you will need for running the example, and a document with information on how to setup and run and the thought process behind the project. Regards,Andrei Valeanu
There are some scenarios where you don't necessarily want to connect to your corporate mail server, or a public mail server like gmail - e.g. when testing a new function that possibly spams the official mail servers - or the mail server is not yet available. In such a scenario it might be a good idea to use a custom, private mail server to be able to send and receive emails locally on a test- or development-environment. In this post I will show how to use the hMailServer and setup the ThingWorx mail extension to send emails. This post will concentrate on installing and deploying within a Windows environment. More specifically on a Windows 2012 R2 server virtual machine. Installing hMailServer Download and install the .NET Framework 3.5 (includes .NET 2.0 and 3.0). In Windows Server 2012 R2 open the Server Manager and in the Configuration add roles and features. Click through the "Role-based or feature-based installation" steps and install the ".NET Framework 3.5
Concepts of Anomaly Detection used in ThingWatcherThingWatcher is based on anomaly detection with the normal distribution. What does that mean? Actually, normally distributed metrics follow a set of probabilistic rules. Upcoming values who follow those rules are recognized as being “normal” or “usual”. Whereas value who break those rules are recognized as being unusual. What is a normal distribution?A normal distribution is a very common probability distribution. In real life, the normal distribution approximates many natural phenomena.A data set is known as “normally distributed” when most of the data aggregate around it's mean, in a symmetric way. Also, it's extreme values get less and less likely to appear.ExampleWhen a factory is making 1 kg sugar bags it doesn’t always produce exactly 1 kg. In reality, it is around 1 kg. Most of the time very close to 1 kg and very rarely far from 1 kg.Indeed, the production of 1 kg sugar bag follows a normal distribution.Mathematical rulesW
In this particular scenario, the server is experiencing a severe performance drop.The first step to check first is the overall state of the server -- CPU consumption, memory, disk I/O. Not seeing anything unusual there, the second step is to check the Thingworx condition through the status tool available with the Tomcat manager.Per the observation:Despite 12 GB of memory being allocated, only 1 GB is in use.Large number of threads currently running on the server is experiencing long run times (up to 35 minutes)Checking Tomcat configuration didn't show any errors or potential causes of the problem, thus moving onto the second bullet, the threads need to be analyzed.That thread has been running 200,936 milliseconds -- more than 3 minutes for an operation that should take less than a second. Also, it's noted that there were 93 busy threads running concurrently.Causes:Concurrency on writing session variable values to the server.The threads are kept alive and blocking the system.Tracing the
Hi everybody,In this blogpost I want to share with you my local ThingWorx installation, with some optimizations that I did for local development.-use the -XX:+UseConcMarkSweepGC . This uses the older Garbage Collector from the JVM, instead of the newer G1GC recommended by the ThingWorx Installation guide since version 7.2. The advantage of ConcMarkSweepGC is that the startup time is faster and the total memory footprint of the Tomcat is far lower than G1GC.-use -agentlib:jdwp=transport=dt_socket,address=1049,server=y,suspend=n. This allows using your Java IDE of choice to connect directly to the Tomcat server, then debugging your Extension code, or even the ThingWorx code using the Eclipse Class Decompilers for example. Please modify the 1049 to your port of choice for exposing the server debugging port.-use -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=60000 -Dcom.sun.management.jmxremote.ssl=false &
This document contains information that should be reviewed before installing or upgrading to the latest version ThingWorx for both new and existing customers. Note that many of the links in this document require that you have created and validated an account on the PTC website.Account CreationFor users who do not yet have an active maintenance agreement, an account can be created by accessing the Basic Account Creation page. With a basic account, you will have access to the ThingWorx Community, product documentation, and support articles. Also, a basic level account will grant access to our new Developer eSupport Portal, which is a great resource for users of all levels to become more proficient with ThingWorx and the emerging world of IoT in general. For more details on the new Developer eSupport Portal, please refer to our Getting Started with the New eSupport Portal guide.For users having an active maintenance agreement with PTC that have not yet created an account on th
This is an example for setting up remote desktop and file transfer for an asset in Thingworx Utilities using the Java Edge SDK.Step 1. EMS ConfigurationClientConfigurator config = new ClientConfigurator();// application key RemoteAccessThingKey String appKey = "s2ad46d04-5907-4182-88c2-0aad284f902c";config.setAppKey(appKey);// Thingworx server Uriconfig.setUri("wss://10.128.49.63:8445//Thingworx/WS");config.ignoreSSLErrors(true);config.setReconnectInterval(15);SecurityClaims claims = SecurityClaims.fromAppKey(appKey);config.setSecurityClaims(claims); // enable tunnels for the EMSconfig.tunnelsEnabled(true);// initialize a virtual thing with identifier PTCDemoRemoteAccessThingVirtualThing myThing = new VirtualThing(ThingName, "PTCDemoRemoteAccessThing", "PTCDemoRemoteAccessThing", client);**// for the file transfer functionalityFileTransferVirtualThing myThing = new FileTransferVirtualThing(ThingName, "PTCDemoRemoteAccessThing", "PTCDemoRemoteAccessTh
Part I – Securing connection from remote device to Thingworx platformThe goal of this first part is to setup a certificate authority (CA) and sign the certificates to authenticate MQTT clients. At the end of this first part the MQTT broker will only accept clients with a valid certificate.A note on terminology: TLS (Transport Layer Security) is the new name for SSL (Secure Sockets Layer). RequirementsThe certificates will be generated with openssl (check if already installed by your distribution). Demonstrations will be done with the open source MQTT broker, mosquitto. To install, use the apt-get command:$ sudo apt-get install mosquitto$ sudo apt-get install mosquitto-clientsProcedureNOTE: This procedure assumes all the steps will be performed on the same system.1. Setup a protected workspaceWarning: the keys for the certificates are not protected with a password. Create and use a directory that does not grant access to other users.$ mkdir myCA$ chmod 700 myCA$ cd myCA2. S
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.