Skip to main content
Sep 27, 2021 6:05 PM UTC
Solved

Thingworx Protocol with ESP8266

Hi, Team.

I´m use the ESP12F in my board, to communicate with TX.

I´m use the code bellow to update my Things.

String fullRequestURL = String(server) + "/Thingworx/Things/" + ThingName + "/Properties/" + Property1 + "?method=PUT&value=" + d + "&appKey=" + String(APPKEY);
http.begin(fullRequestURL);//Specify request destination
http.addHeader("Accept",ACCEPT_TYPE,false,false);
http.addHeader("Content-Type","application/json",false,false);

int httpCode = http.sendRequest("PUT", d);

The httpCode has answer -1. 
In reference table, -1 it´s 404 to web server. But the server keeps on line. Also I copy and paste the generated URL, the Property Thing has updated.

Regards.
Telles.

TellesAnswer
Oct 5, 2021 12:49 PM UTC

Unfortunately, I have to chance the microcontroller to ESP32 and solved the problem!

Regards.
Telles.

4 replies

Sep 28, 2021 8:52 PM UTC

@Telles ,

 

Did you check the tomcat localhost logs or the ThingWorx Error log?  Sometimes that will yield some useful information about why your request didn't go through correctly.

 

--Nick

TellesAuthor
Oct 1, 2021 2:38 PM UTC

Hi, @nmilleson.
I´m ever check all permissions programs, like TOMCAT, FIREWALLS, etc. At least no lower my security.
I made a different code, abstracting in just one single URL, and swaping the ESP8266 by ESP32, it´s some better. Now the server aswer to ESP: 401. But these test I made by homeofficing.

Regards. Have a nice weekend.
Telles.

TellesAuthor
Oct 1, 2021 6:11 PM UTC

Also, maybe that´s the reason for can´t get speach updates?

Regards.
Telles.