cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Trying to run the Raspberry PI demo -- seeing errors when targeting the Academic cloud instance

walterh
1-Newbie

Trying to run the Raspberry PI demo -- seeing errors when targeting the Academic cloud instance

I have access to ThingWorx via this URL as provided to me as part of the academic program:

I can access the composer there just fine.

I created an App key as the Raspberry PI tutorial describes. I compiled the EMS jar and deployed it to the PI.

The command line I use on the PI is:

java -jar ./temperature-thing-jar-with-dependencies.jar ws://thingworx-academic-vu.ptcmscloud.com/Thingworx/WS <<myapikey>> simulated

I am hiding the API string for privacy.

The process on the PI starts up OK but then I see this log sequence repeated:

19:56:33.268 /main DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - Initializing CommunicationEndpoint Connection Monitor...

19:56:33.274 /Client-EndpointMonitor-1 DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

19:56:33.277 /Client-EndpointMonitor-1 INFO  c.t.c.c.e.m.CommunicationEndpointMonitorTask - Endpoint not connected name: EP_0, id: 0. Attempting /reconnect...

19:56:33.284 /Client-EndpointMonitor-1 DEBUG c.t.c.c.e.ClientCommunicationEndpoint - Clearing endpoint authentication data id: 0

19:56:33.286 /Client-EndpointMonitor-1 INFO  c.t.c.c.e.ClientCommunicationEndpoint - Needed to refill connections on client endpoint id: 0 : active: 0, max: 1

19:56:33.550 /Client-EndpointMonitor-1 ERROR c.t.c.c.e.ClientCommunicationEndpoint - Refilling connections on endpoint 0, uri: ws://thingworx-academic-vu.ptcmscloud.com/Thingworx/WS failed : null

19:56:33.552 /Client-EndpointMonitor-1 INFO  c.t.c.c.e.m.CommunicationEndpointMonitorTask - Endpoint reconnection was unsuccessful name: EP_0, id: 0

I think I have the WS URL for my cloud instance correctly included in the pom.xml file used to deploy the jar. This is the same one that I use on the command line and that URL is leading to a failed connection.

As far as I can tell, I have followed all tutorial steps correctly. Do I need to create a remote thing first in the Composer? The tutorial does not describe this step.

Any advice appreciated.

7 REPLIES 7
jamesso
10-Marble
(To:walterh)

I later commented:


More info.

If I run from my laptop, AND I use port 80 in the url string, then on the EMS command line I do see simulated temperatures and humidity values. But on the ThingWorx server, if I chose to monitor unbound remote things, nothing is showing up there.


On the PI, I get a different error: 

20:46:12.237 DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - WebSocket Channel is connected

20:46:12.299 DEBUG i.n.h.c.h.w.WebSocketClientHandshaker13 - WebSocket version 13 client handshake key: oHqzZvpi3anAQC4F+gEm7g==, expected response: pQYG6OwuJhogu7qGuxGUELv22s0=

20:46:21.414 INFO  c.t.c.c.c.n.NettyClientConnectionFactory - forcing underlying tcp channel closed

20:46:21.423 ERROR c.t.c.c.e.ClientCommunicationEndpoint - Refilling connections on failed : timeout waiting for websocket handshake to complete

20:46:21.425 INFO  c.t.c.c.e.m.CommunicationEndpointMonitorTask - Endpoint reconnection was unsuccessful


And then still later:


Based on some email from Adrian Petrescu I can get the EMS on the Raspberry PI to run without error if I use the IP address for my ThingWorx server instead of its FQDN. I see simulated temp and humidity values in the log stream.

But I don't see anything on the server when I select the Monitoring option to look at Unbound Remote Things. The messages on the PI suggest that the name Am2302Thing is being used from there, but I have not created such a thing in the Composer. Do I need to do that? The tutorial does not show that this step is required BEFORE trying to see the connection in the Monitoring window. 


BUT, later in the How to Bind Data tutorial video, the narrator shows how to create a Data Shape, then a Thing Template and finally a Thing. The Thing she creates IS Am2302Thing. So perhaps there is a cart before the horse issue here?


And finally:


There is something wrong with my ThingWorx server instance I suspect. After making all of the definitions: Shape, Template, Thing and binding the remote properties to the thing successfully, I still don't see a thing name in the Monitoring window, either under the All tab or the Unbound tab.

This is an educational show stopper for me at the moment!


I have uploaded some screen shots to My File Repository to show what I see from the ThingWorx Monitoring UI.



jamesso
10-Marble
(To:walterh)

I uploaded another screen shot labelled LiveUpdating.

Despite Monitoring not working, I am seeing my property values update live when the EMS is running. I just refresh the view. So the remote server is running correctly now.

Did you ever figure out what the problem was?

adrianpet
5-Regular Member
(To:walterh)

Hi,

     In order to connect to Thingworx via WS you will need to add the port to the hostname, so, your URL will be: <a href="http://thingworx-academic-vu.ptcmscloud.com/Thingworx/" style="font-family: 'Segoe UI', sans-serif; font-size: 9pt; background-color: white;">http://thingworx-academic-vu.ptcmscloud.com:80/Thingworx/</a> . In this case, the command line from the PI will be: 

That worked Thanks!

And this post also solved my challenge, cheers! 

jamesso
10-Marble
(To:walterh)

Adrian sent me an email this morning (December 3) informing me that I am an admin of my academic instance. Now the Monitoring features work as the Tutorial videos show us.

Thanks Adrian!

Top Tags