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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Temperature sensor connection using Thingworx java SDK

asingla
1-Visitor

Temperature sensor connection using Thingworx java SDK

Hi All,

i am making one IOT project in Thingworx for getting temperature sensor value and update thingworx properties using thingworx java SDK.

I have installed Thingworx extension in eclipse and make 1 thinhgworx project.

I have few question:

1. How can i create thingtemplate , thing using java SDK.

2. How to update thing properties when sensor value changed.

Please give some pointer.

Thanks.

3 REPLIES 3

Just to clarify, are you using the Edge Java SDK, or the Extension SDK which is written in Java?

When using the Edge Java SDK:

1. If you want to use a simple REST call to the EntityServices Resource's service CreateThingTemplate, that would be the best way to create a ThingTemplate with the Java SDK. Here is a quick tutorial on sending REST calls from the Java SDK: POSTing via a REST call in Java

2. Regarding question 2, have you taken a look at the SteamSensor example provided with the Java SDK? This provides a great starting point to show how to send property values. You'll see that the setProperty() function is being called to set values to properties that have been defined through annotations at the beginning of the SteamThing.java file, and the updateSubscribedProperties() function is called to push all of the registered properties to the ThingWorx server.

Meghan

Thanks Meghan...

i am using Extension SDK.

i want to create all thing, thingtemplate in Extension SDK.

I am making project from scratch and little confuse from where i will start my project.

Please guide me .

Thanks

Just based on the title of this post I think you might want to use the Java SDK instead of the Extension SDK. The Extension SDK is used to add additional functionality to ThingWorx, and the Java SDK is used to connect remote devices to the platform to send data to and from the device; an example of that would be a temperature sensor reading.

Try downloading this instead: http://marketplace.thingworx.com/Items/java-sdk Keep in mind though that you will need to have a device that is capable of running a java application. There are other SDKs available for download such as the Android, iOS, C, and C# .NET versions.

Just in case you really intend to use the Extension SDK I recommend you download the Eclipse plugin (make sure Eclipse Mars is installed). Once that plugin is installed you will have a menu in Eclipse that can automatically generate ThingTemplates and other entities for ThingWorx.

Extensibility Section - Help Center <-- Further reading available here

http://marketplace.thingworx.com/Items/eclipse-plugin-for-thingworx-extensions <-- Eclipse Plugin

Meghan

Announcements


Top Tags