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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

AT commands to Update Property value through Arduino+ESP8266

DavorGranic
16-Pearl

AT commands to Update Property value through Arduino+ESP8266

I'm trying to update property value on Thingworx through Arduino connected to ESP8266mod,by using HTTP PUT with AT commands. I managed to test updating in Postman and it works fine.

 

1. I only manage to connect to thingworx with AT+CIPSTART="UDP","XX.XX.XX.XX","8080"

    When I use AT+CIPSTART="TCP","XX.XX.XX.XX","8080" it hangs for a bit and i get ERROR.

    (TCP works when connecting to Academic but not Trial)

 

2. Can anyone give me example how would  AT+CIPSEND data package look like?

    My guess is something like:

 

    AT+CIPSEND=0,226

    PUT /Thingworx/Things/TestThing/Properties/TestValue?appKey=xxxxxxxxxxxxxxxxxxxxxx HTTP/1.1
    Accept: application/json 
    Content-Type: application/json
    Host: XX.X.XX.X
    {"TestValue" : "15"}
    #26

   But all i get is SEND OK 

 

   Thanks in advance.

 

 

 

 

 

ACCEPTED SOLUTION

Accepted Solutions

Your PUT message is pretty close, but I see a couple of problems.

  • You must have an empty line after the headers and before the body of your put ( \r\n\r\n\ )
  • You are missing a Content-Length header. I am not positive it is required if your client closes the connection after sending the message, but it is a good idea to send it

The Developer Portal 30 day hosted servers use https on the default port 443. I don't know if your device can make an https connection

 

This guide has an example working PUT command:

https://developer.thingworx.com/resources/guides/rest-api-how-guide/property-values-rest-api-how

 

 

View solution in original post

1 REPLY 1

Your PUT message is pretty close, but I see a couple of problems.

  • You must have an empty line after the headers and before the body of your put ( \r\n\r\n\ )
  • You are missing a Content-Length header. I am not positive it is required if your client closes the connection after sending the message, but it is a good idea to send it

The Developer Portal 30 day hosted servers use https on the default port 443. I don't know if your device can make an https connection

 

This guide has an example working PUT command:

https://developer.thingworx.com/resources/guides/rest-api-how-guide/property-values-rest-api-how

 

 

Announcements


Top Tags