Hi, Team.
I programming this sketch. I got it assembly the packge to my Thing. But the values don´t update.
If I get the URL in Monitor Serial, copy and paste in navigator. The properties of TW are updated.
Maybe the problema is in http.begin...
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ArduinoHttpClient.h>
#include <WiFiClientSecureBearSSL.h>
const char* ssid = "InfoAxis_NET1";
const char* password = "InfoNet1";
char server[] = "";
char appKey[] = "";
char thingName[] = "Box";
char property1[]="pressao";
char property2[]="temperatura";
#define ACCEPT_TYPE "text/csv"
void setup(){
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED){
delay(1000);
Serial.print(".");
}
}
void loop() {
if(WiFi.status() == WL_CONNECTED){
HTTPClient http;
String pressao = ("200");
int a = pressao.length();
Serial.print("Tamanho da String: ");
Serial.println(a);
String URL = String(server)+ "/Thingworx/Things/" + thingName + "/Properties/" + property1 + "?method=PUT&value=" + pressao + "&appKey=" + String(appKey);
http.begin(URL);
http.addHeader("Accept",ACCEPT_TYPE,false,false);
http.addHeader("Content-Type","application/json",false,false);
int httpcode=http.sendRequest("PUT",pressao);
Serial.println(httpcode);
Serial.println(URL);
Serial.println(pressao);
http.end();
}
delay(30000);
}
Thanks to all.
Regards.
Telles.
Up, team!
Hi @Telles.
Can you provide the version of ThingWorx you are running?
We also need more information. Are you seeing any error messages? What are you connecting to on the edge?
Regards.
--Sharon