Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Installing ThingWorx

c
Important User Information
This documentation, whether, illustrative, printed, “online” or electronic (hereinafter “Documentation”) is intended for use only as
a learning aid when using Rockwell Automation approved demonstration hardware, software and firmware. The Documentation
should only be used as a learning tool by qualified professionals.

The variety of uses for the hardware, software and firmware (hereinafter “Products”) described in this Documentation, mandates
that those responsible for the application and use of those Products must satisfy themselves that all necessary steps have been
taken to ensure that each application and actual use meets all performance and safety requirements, including any applicable
laws, regulations, codes and standards in addition to any applicable technical documents.

In no event will Rockwell Automation, Inc., or any of its affiliate or subsidiary companies (hereinafter “Rockwell Automation”) be
responsible or liable for any indirect or consequential damages resulting from the use or application of the Products described in
this Documentation. Rockwell Automation does not assume responsibility or liability for damages of any kind based on the
alleged use of, or reliance on, this Documentation.

No patent liability is assumed by Rockwell Automation with respect to use of information, circuits, equipment, or software
described in the Documentation.

Except as specifically agreed in writing as part of a maintenance or support contract, equipment users are responsible for:task
• properly using, calibrating, operating, monitoring and maintaining all Products consistent with all Rockwell Automation
or third-party provided instructions, warnings, recommendations and documentation;
• ensuring that only properly trained personnel use, operate and maintain the Products at all times;
• staying informed of all Product updates and alerts and implementing all updates and fixes; and
• all other factors affecting the Products that are outside of the direct control of Rockwell Automation.

Reproduction of the contents of the Documentation, in whole or in part, without written permission of Rockwell Automation is
prohibited.

Throughout this manual we use the following notes to make you aware of safety considerations:

Identifies information about practices or circumstances


that can cause an explosion in a hazardous environment,
which may lead to personal injury or death, property damage, or economic loss.

Identifies information that is critical for successful application and understanding of the product.

Identifies information about practices or circumstances that can lead to personal injury or death, property
damage, or economic loss. Attentions help you:
• identify a hazard
• avoid a hazard
• recognize the consequence

Labels may be located on or inside the drive to alert people that dangerous voltage may be present.

Labels may be located on or inside the drive to alert people that surfaces may be dangerous temperatures.
Installing ThingWorx

Contents
Before you begin ........................................................................................................................................... 4
About this lab .................................................................................................................................................................................... 4
Tools & Prerequisites ........................................................................................................................................................................ 4

Install Java .................................................................................................................................................... 5

Install Apache Tomcat................................................................................................................................... 6

Install and Configure PostgreSQL (Windows) .............................................................................................. 7

Install Thingworx Platform ........................................................................................................................... 10

OPTIONAL DEMO: Obtaining a Thingworx License ................................................................................. 11

3 of 12
Before you begin

About this lab


This lab activity is intended to illustrate a very basic installation of the Thingworx IoT platform. It is intended for individuals with a
software background and a fair knowledge of the Windows operating system navigation and folder permissions. This should not
be used for a production installation as there is minimal security and most settings have been left at defaults.
Production deployments should refer to PTC documentation for the most current best practices.

This lab takes approximately 120 minutes to complete.

Tools & Prerequisites


Hardware devices required
 None (Emulation is used)
Software programs required
 Latest Java Development Kit from Oracle (Account Req’d)
 Latest Tomcat webserver from Apache Foundation
 Latest Thingworx platform (w/ Postgres) installation files downloaded from the eSupport website
Related Documentation
 Thingworx Minimum Requirements Manual
 Thingworx 8.5 Installation Guide

4 of 12
Install Java

1. Locate the “jdk-8u241-windows-x64.exe” file in the Desktop2020 Updates1-Java folder. Right-click


on the file and choose Run as administrator. Accept all default settings to complete the installation.

2. We need to include the path to the Java runtime in the Environment Variables:

a. Open the “Thingworx Installation.txt” file on the Desktop.

b. Under the [JAVA] and JAVA_HOME heading, copy the path text to the Windows clipboard.

c. Right-click on the Windows start menu and navigate to SystemAdvanced System Settings.

d. Select Environment Variables…

e. In the System variables section, click New.

f. In the Variable name field, enter JAVA_HOME.

g. In the Variable value field, paste the clipboard text you copied earlier in step b.

3. Click OK and OK again.

5 of 12
Install Apache Tomcat

1. Locate the “apache-tomcat-9.0.31.exe” file in the Desktop2020 Updates2-Tomcat folder. Right-click


on the file and choose Run as administrator. Accept all default settings to complete the installation.

2. In Windows Explorer, browse to the C:\Program Files\Apache Software Foundation/Tomcat 9.0 folder.

3. Click Continue to gain access permission to the folder at the prompt.

4. We will need to set a few parameters in Tomcat to work with Thingworx:

a. Return to the “Thingworx Installation.txt” file and copy the text below the [TOMCAT] heading to the
Windows clipboard.

b. Next, launch the Tomcat properties by selecting StartConfigure Tomcat.

c. Select the Java tab and scroll to the end of the Java Options text window.

d. Paste the contents of the Windows clipboard you just copied.

e. Lastly, remove the values for both memory pool settings.

f. Click OK.

6 of 12
Install and Configure PostgreSQL (Windows)

This section describes the installation of PostgreSQL as the persistent storage database for Thingworx.

1. Locate the “postgresql-10.12-1-windows-x64.exe” file in the Desktop2020 Updates3-Postgres folder.


Right-click on the file and choose Run as administrator.

2. The initial dialogs should be left at their defaults, but you will need to enter and confirm a password for the
postgres superuser account. Enter “postgres” into both text boxes and click Next.

3. Accept the rest of the default settings to complete the installation. Do not launch Stackbuilder.

4. Next, launch the postgres admin tool by selecting StartPostgreSQL 10pgAdmin 4.

5. At the pgAdmin master password prompt, enter “pgadmin” and click OK.

6. We will need to set up a special user through which Thingworx will be connected:

a. Expand the Servers option in the tree browser at the left.

b. At the Connect to Server prompt, enter your postgres user password, “postgres”.

c. Right-click on the Login/Group Roles and select CreateLogin/Group Role.

d. Enter “twadmin” for the Name.

e. Select the Definition tab and enter “twadmin” again for the password.

f. Select the Privileges tab and enable the Can login? option.

g. Click Save and minimize pgAdmin 4.

7 of 12
7. Let’s continue the configuration of PostgreSQL:

a. Open the “Thingworx Installation.txt” file on the Desktop. Under the [POSTGRESQL] and PATH
heading, copy the path text to the Windows clipboard.

b. Right-click on the Windows start menu and navigate to SystemAdvanced System Settings.

c. Select Environment Variables…

d. In the System variables section, highlight the Path variable and click Edit…

e. Click the New button and paste the clipboard text you copied earlier in step a.

f. Click OK, OK, and OK again to complete the process and close the dialogs.

8. We will need to create a folder in the root directory to store the tablespace information.

a. In the “Thingworx Installation.txt” file on the Desktop, under the [POSTGRESQL] and FOLDER
heading, copy the text to the Windows clipboard.

b. In Windows Explorer, browse to the root C:\ drive and create a new folder.

c. Name the folder by pasting the text from the Windows clipboard.

d. Set the Security permissions for this folder to allow the LOCAL_SERVICE Full Control.

e. Set the Security permissions for this folder to allow the NETWORK_SERVICE Full Control.

f. Click OK.

9. The next few steps configure the tables, ports, and database definitions for Thingworx within Postgres
through the use of script files. Fairly common for web applications:
a. From the Windows Start menu, right-click and choose Command Prompt (Admin).
b. Change the directory to the c:\install. (Type “CD\install” <enter>)

c. In the “Thingworx Installation.txt” file on the Desktop, under the [POSTGRESQL] and SCRIPTS
heading, copy the first line of script to the Windows clipboard.

d. Return to the Command Prompt window, paste the text into the C:\install prompt and hit <Enter>.

e. Enter “postgres” at the Password prompt and Press any key to continue.

IMPORTANT: The script should complete with no errors, End Execution and return to the C:\install
command prompt. If you receive any errors or warnings, please notify your instructor.

8 of 12
f. Next, in the “Thingworx Installation.txt” file on the Desktop, under the [POSTGRESQL] and
SCRIPTS heading, copy the second line of script (…Schema…) to the Windows clipboard.

g. Return to the Command Prompt window, paste the text into the C:\install prompt and hit <Enter>.

h. Enter “twadmin” at the Password prompt (4x) and Press any key to continue.

IMPORTANT: The script should complete with no errors, End Execution and return to the C:\install
command prompt. If you receive any errors or warnings, please notify your instructor.

10. Let’s verify that all of the persistent database storage components have been created:
a. Return to the pgAdmin 4 web console (Chrome), right-click on the Server at the top of the tree and choose
Refresh.
b. Drill down into the Databases and verify that you have a thingworx database and (69) tables under the
Schemas.
c. Verify that you have a thingworx folder in the Tablespaces area.

d. In Windows Explorer, verify that there is now an additional folder with sub-components populated within the
C:\ThingworxPostgresqlStorage folder.

9 of 12
Install Thingworx Platform

The purpose of this section is to complete the formal installation of the Thingworx web application.

1. In Windows Explorer, browse to the root C:\ drive and create a new folder named “ThingworxPlatform”.

2. Set the Security permissions to allow BOTH the LOCAL_SERVICE and NETWORK_SERVICE Full Control.

3. Lastly, on the root C:\ drive, create a new folder named “ThingworxStorage”.

Thingworx uses a configuration file to obtain basic settings when launched. The settings are stored in a java script
object notation (JSON) file. PTC provides a file containing initial settings, but we’ve modified this file for our use.

4. In Windows Explorer, browse to the Desktop2020 Updates4-Thingworx folder, copy the “platform-
settings.json” file and paste it into the C:\ThingworxPlatform folder.

Among other things, this file:


• Sets the Administrator password to “RockwellAuto#1”
• Enables users to import Extensions
• Defines a backup storage file location

5. In order to continue with the web application deployment, we will need to stop the web server. In Windows
Services, locate the “Apache Tomcat9” service. If it is running, right-click on it and choose “Stop”.

6. To deploy the Thingworx web application archive file, in Windows Explorer, browse to the Desktop2020
Updates4-Thingworx folder, copy the “Thingworx.war” file and paste it into the Tomcat installation webapps
folder path below:

C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps

7. Restart the Tomcat service.

8. After a minute or so, open the C:\ThingworxPlatform folder and notice that there is a “LicenseRequext.txt“ file
present. This file contains the PTC Device ID information that should be used to retrieve a valid Thingworx
license manually from the eSupport website.

Without a valid license, Thingworx will run in limited mode until a valid license is provided. Limited mode will
not allow users to persist any licensed entities such as Things, Mashups, Masters, Gadgets, Users, etc.

9. Let’s test our current functionality (verify connectivity to Thingworx Composer):

a. Launch Chrome and navigate to “server01:8080/Thingworx”.

b. Login: Administrator RockwellAuto#1

Thingworx Composer should open, displaying a browse menu along the left side of the screen.

10 of 12
OPTIONAL DEMO: Obtaining a Thingworx License

1. Open the licenseRequestFile.txt and copy the ptc device id string.


2. On a computer connected to the internet, navigate to the PTC eSupport site and log in using your partner credentials.

https://www.ptc.com/en/support/login?returnUrl=%2fen%2fsupport

3. Choose the Manage Licenses option.


4. Scroll down to the Thingworx area, select the Thingworx 8.1+ or later product option.
5. Enter or paste your Device ID into the text entry area and click Retrieve.

You will see a confirmation displayed indicating that the request has been submitted. The creation of a license file is processing
but may take a few minutes to complete.
6. You can retrieve the license file once you have received a successful creation email. Within the eSupport portal, the
newly created license file will be available under the License Repository area at the right of the page. Click Download.
7. Back on the Thingworx installation system, Stop the Tomcat service.
8. CRITICAL STEP: The license file MUST be placed into the C:\ThingworxPlatform folder AND renamed as
“license_capability_response.bin”. (spelling is absolutely critical here)

9. Restart the Tomcat service.


10. If everything is successful, the new file will be replaced by a file called “successful_license_capability_response.bin” file
in the C:\ThingworxPlatform folder.

11 of 12
Notes

12 of 12

You might also like