Skip to main content
September 22, 2015
Solved

Arduino Uno weather app REST call not updating thing properties

  • September 22, 2015
  • 7 replies
  • 3645 views

Hi All, I am new to thingworx and trying to complete the Arduino Uno weather app from the tutorial provided on the following link:

Weather App with Arduino Uno | ThingWorx

I am using a developer account and ThingWorx Composer 6.0. I am stuck at the following part of tutorial:

http://www.thingworx.com/~/media/Files/PDFs/Academics/2AUHowtoReadTemperatureandHumidityfromHTU21DSensorUsingRestCallsinCforArduinoUno.ashx?la=en

This primarily deals with updating the temp and humid values using REST call in the thing properties. The structure of the REST call that I have even tried from REST clients is following:

POST /Thingworx/Things/DHT11Thing/Services/setTempAndHumid?appKey=8510MYAPPKEY-1918-4ad8-961f-475f22c50a02&method=post&x-thingworx-session=true<&Temp=32.04&Humid=12.17> HTTP/1.1

Host: geX-XXX.cloud.thingworx.com    {This is my thingworx account link to composer}

Content-Type: text/html

Any pointers on what I may be doing wrong.

P.S. I amusing a DHT11 temperature sensor so my thing name is matching with the thing name I have created on ThingWorx.

Thanks,

Avinash

Best answer by vmihai

Hi,

On ThingWorx 6.0  REST calls  need to be enabled  by following these steps :

1.           Click on Subsystems under SYSTEM within the left pane of Composer

2.            Click on PlatformSubsystem

3.            Click on Configuration

4.            Check the box next to Allow Request Method Switch to allow all REST API calls through a browser URL

5.            Uncheck Filter Content-Type

Let me know if this fixes the issue,

Veronica

7 replies

vmihai1-VisitorAnswer
1-Visitor
September 22, 2015

Hi,

On ThingWorx 6.0  REST calls  need to be enabled  by following these steps :

1.           Click on Subsystems under SYSTEM within the left pane of Composer

2.            Click on PlatformSubsystem

3.            Click on Configuration

4.            Check the box next to Allow Request Method Switch to allow all REST API calls through a browser URL

5.            Uncheck Filter Content-Type

Let me know if this fixes the issue,

Veronica

September 22, 2015

Thanks a lot Veronica, I was able to POST data using REST call.


I have another doubt regarding the Application Key based authentication, that I am using in my REST call.

To be precise I am using the following POST:

http://ge<MYMACHINE>.cloud.thingworx.com/Thingworx/Things/DHT11Thing/Services/setTempAndHumid?<&Temp=12.04&Humid=12.17>

It seems like I am able to POST data without application key authentication. What settings I need to correct to put application key authentication for my thing?

Thanks,

Avinash

1-Visitor
September 22, 2015

Hi Avinash,

Are you making the rest call in a browser ? Maybe you are already logged in and this is why you are no longer required to input an authentication key as alternative for log in. Use also the following parameter in your Rest call : x-thingworx-session=true. This will create a  thingworx session for your rest call.

Veronica