Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Previously
Installing & Connecting C SDK to Federated ThingWorx with VNC Tunneling to the Edge device
Pre-requisite
Configuring Tunnel Subsystem
1. Logon to ThingWorx Composer > System > Tunnel Subsystem > Configuration
2. Public host name used for tunnels & Public port used for tunnels parameters require publically address FQDN or IP of the instance running ThingWorx server and the port on which its listening.
3. From the screenshot above the TW802Neo is the name of the server and 443 is the port configured for ThingWorx to listen on
4. Navigate back to the RemoteThing we created above to connect our C SDK client to on the ThingWorx platform and ensure that the Enable Tunnelling is turned on
5. Click on Configuration and click Add My Tunnel button to configure where should the tunnel be opened to
6. In the above example Host and Port parameter is from the Ubuntu machine were my C SDK client is running together with the VNC server. If you are looking for more detail on how to configure these topics refer to the Simple diagnostic utility to analyse tunneling performance in ThingWorx
7. Once done, Save the entity
Configuring Remote Access & WebSocket tunnel widgets in a Mashup
1. Navigate to the ThingWorx Composer > Visualization > Mashups > New to create a Mashup
2. From the list of Widgets drag and drop following two widgets that are added as part of the Web Socket Tunnel Widget and Library extension
4. Since I have my C SDK client binding to SteamSensor2 (remember it was created with RemoteThingWithTunnel ThingTemplate) I have that selected that as RemoteThingName
5. TunnelName is the vnc as configured in the SteamSensor2 configuration
6. For Web Socket Tunnel Widget following configuration is required
7. Parameters defined in a & b point are exactly the same as already done for the Remote Access Widget parameter above, the VNCPassword is the same password with which you have configured your VNC server with
8. Once done Save the mashup and View it
9. Click on the Remote Access to download the websocket adapter plugin, once downloaded click on it to initiate the websocket you will be prompted with following
Accept and Run
This will open the Remote tunnel with following confirmation, Don't click on OK else it will close
You can now utilize this tunnel to perform required action. Note that if in case there is no connection through this opened tunnel it will time out and will close automatically.
10. For doing remote desktop to the edge device I will use the Remote Device button , which will open a new browser window like so
11. Click on Connect to initiate the remote desktop session, like so
12. I can now start the terminal on the edge device and navigate through
Up Next