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

Thingworx Protocol with ESP8266

Telles
12-Amethyst

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Telles
12-Amethyst
(To:Telles)

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

Regards.
Telles.

View solution in original post

4 REPLIES 4
nmilleson
17-Peridot
(To:Telles)

@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

Telles
12-Amethyst
(To:nmilleson)

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.

Telles
12-Amethyst
(To:Telles)

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

Regards.
Telles.


Telles
12-Amethyst
(To:Telles)

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

Regards.
Telles.

Top Tags