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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

arduino weather app rest call failed

cvrindavan
1-Visitor

arduino weather app rest call failed

I am using the arduino weather app project to connect with thingworx. On the serial monitor I can see the values of temperature and humidity been updated. but they are not updated on the thingworx . (I checked by refreshing). i went through posts in the community and got to know about the things to be checked and unchecked in the platform subsystems. I was working on the academic instance. I was unable to check and uncheck. it flashed message saying u are not authorized to do so. then i launched the thingworx foundation server 30 day trial edition. i could easily check and uncheck in platform systems. but for the server name when i checked the url in the address bar it just showed me http://52.198.165.187/Thingworx/Composer/index.html .now as per the tutorial if my link is  https://academic.cloud.thingworx.com/Thingworx/Composer/ then i can use the server name as academic.cloud.thingworx.com   so from the above url i was just confused as to what should be the server name. i tried http://52.198.165.187 as the server name. icould still see the updated readings on serial monitor but on thingworx it was not updated. i tried 52.198.165.187 then the serial monitor showed the message that the server could not be established.

my question is my foundation instance shows http://52.198.165.187/Thingworx/Composer/index.html   this url. wha should be the server name? and if there is anything more to that. i have checked the property variables the service their case senstivity.

2 REPLIES 2

I am moving this to the Developer Community to get the right eyes on it.

Best,

Toby

supandey
19-Tanzanite
(To:Tmetcalf)

Hi Crish, the server address would be the IP in that URL of yours however  along with thingworx, here's how i would try :

Webhost = "http://52.198.165.187/Thingworx/Things/<yourThingName>/Properties/*"

App_Key = "<yourAppKey>"

humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)

#you can either use the thing name directly in the URL or can use a parameter like below

#ThingName = "<ThingName>"

headers = {'Content-Type': 'application/json', 'appKey': App_Key}

payload = {'temp': temperature, 'hum': humidity}

response = requests.put(Webhost, headers=headers,json=payload, verify=False)

Do note that you won't see isConnected = true once you start receiving the data on ThingWorx side as this isn't a websocket connection also the lastConnection date will not reflect appropriately (which is expected as its a REST API)

BTW, since this seems you are exploring the the ThingWorx and device connectivity there's already an article on Arduino connecting to ThingWorx using MQTT protocol - you can give this a try if you haven't already DeliveringArduinoDataToThingworx.pdf

Hope this helps.

Announcements


Top Tags