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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Mashup Weather App Tutorial

pfischer1
1-Newbie

Mashup Weather App Tutorial

hey folks,

i have a

little problem with this thingworx tutorial.

at the point where i start the command:

java -jar ./temperature-thing-jar-with-dependencies.jar ws://xxxxx.cloud.thingworx.com:80/Thingworx/WS <app-key>

i recive the temperature and the humidity of my wired sensor to my RPi...

There is also a "true" at the connection in my ThingTemplate, but my mashup wont show me the actual temp and hum, not on the LED and not on the gauge.

So i watched the working command and there seems to be a tiny error:

-----

Here is the standard output of the command:

stdout>Temp=23.0*  Humidity=22.0%

Here is the standard error of the command (if any):

17:33:45.804 [main] ERROR c.p.tempthing.BaseEdgeServer - Error Processing Scan Request for [WKAThing]

java.lang.NumberFormatException: For input string: "23.0*"

-----


Do you know where i can locate my mistake? :X

regards,

Philipp

6 REPLIES 6
adrianpet
5-Regular Member
(To:pfischer1)

Hello,

    Did you manage to connect the RPI to Thingworx? Did you manage to create an equivalent entity(RemoteThing) in Thingworx that has same name as the one from which you are sending data in your jar file? As i see in this error that you have posted, you have a WKAThing on which you should have the 2 properties(Temp and Humidity).

     In order to check if you successfully connected your device to Thingworx you should check the value of the isconnected Property to be true on your WKAThing( which should be a RemoteThing). Also, in TWX, from the menu bar, you should access Monitoring and go to Remote Things. Here you will see two tabs(All and Unbound). If you have correctly connected your device to TWX you will see it in the All tab with green.

Thank you,

Adrian  

Hey,

i checked all points you mentioned and everything seems to be o.k.!

the isCOnnected shows 'true', my thing appears in the monitoring at 'all' with a green symbol.

Also i changed the name of the thing in the main.c file to WKAThing. And thats the name i gave the Thing in TWX.

But that error still appears...

its just the problem, that my mashup wont show me the live data while i run the .jar file. But i dont know what the Error wants to tell me when i start the .jar program..

any other ideas?

regards

Philipp, does the properties on your Remote Thing (WKAThing) update?

hi,

when i go to Modeling - Things - WKAThing - Properties and start the .jar file it looks like this:

problem1.jpg

or did you think about something else?

vmihai
1-Newbie
(To:Aanjan)

Hi Philipp,

In this new version of the  AdafruitDHT.py file the format in which the Temperature and Humidity values are returned has changed.  It now returns the values in the form

The format in which it used to return data and which is expected in the TempAndHumidity.java includes also a C for Celsius after the temperature value

Could you make the following update:

  • The format in which temperature and humidity values are returned by the /projects/Adafruit_Python_DHT/examples/AdafruitDHT.py  file. Replace Temp={0:0.1f}*  with Temp={0:0.1f}*C  in the last if block of the file.


Let me know if this solves the parsing issue.

Thank you,

Veronica

Thank you very much guys, the C in the AdafruitDHT:py file was the problem.

Best regards,

Philipp

Top Tags