Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
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 Configuration
ClientConfigurator config = new ClientConfigurator();
// application key RemoteAccessThingKey
String appKey = "s2ad46d04-5907-4182-88c2-0aad284f902c";
config.setAppKey(appKey);
// Thingworx server Uri
config.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 EMS
config.tunnelsEnabled(true);
// initialize a virtual thing with identifier PTCDemoRemoteAccessThing
VirtualThing myThing = new VirtualThing(ThingName, "PTCDemoRemoteAccessThing", "PTCDemoRemoteAccessThing", client);
**// for the file transfer functionality
FileTransferVirtualThing myThing = new FileTransferVirtualThing(ThingName, "PTCDemoRemoteAccessThing", "PTCDemoRemoteAccessThing", client);
myThing.addVirtualDirectory("AssetRepo", "E:/AssetRepo");
Step 2. Install TightVNC on the asset ( http://www.tightvnc.com/download.php )
Step 3. Go to Thingworx Composer, search for thing PTCDemoRemoteAccessThing
a. pair PTCDemoRemoteAccessThing with identifier PTCDemoRemoteAccessThing
b. go to PTCDemoRemoteAccessThing Configuration and add a tunnel
c. go to PTCDemoRemoteAccessThing Properties and set the vncPassword
Troubleshooting
If the VNC server is on the same machine with the Thingworx server, check “Allow loopback connections” from Access Control tab in TightVNC Server Configuration.