Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Issue POSTing data to Easyiot cloud

Issue POSTing data to Easyiot cloud 1 year 3 months ago #3273

  • mamic2
  • mamic2's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
hi guys,
i have problems while using POST to send data to Easyiot cloud.

In the examples given by Easyiot website, it connects to wifi network, then:
// Set up TCP connection.
String cmd = "AT+CIPSTART=\"TCP\",\"";
cmd += EIOT_CLOUD_ADDRESS;
cmd += "\",40404";
esp8266.println(cmd);

// Sending data
String url = "";
// URL: /RestApi/SetParameter/[instance id]/[parameter id]/[value]
url += "/RestApi/SetParameter/"+ String(EIOT_CLOUD_INSTANCE_PARAM_ID) + "/"+String(temp); // generate EasIoT cloud update parameter URL

esp8266.print(String("POST ") + url + " HTTP/1.1\r\n" +
"Host: " + String(EIOT_CLOUD_ADDRESS) + "\r\n" +
"Connection: close\r\n" +
"Content-Length: 0\r\n" +
"\r\n");


Since this code is not working for me, i would like ot ask if AT+CIPSEND=xxx is needed before POST.
I didnt find it in code provided by Easyiot website.
Thanks for helping me.
Ciao
The administrator has disabled public write access.

Issue POSTing data to Easyiot cloud 1 year 3 months ago #3276

  • EasyIoT
  • EasyIoT's Avatar
  • Offline
  • Administrator
  • Posts: 833
  • Thank you received: 258
  • Karma: 24
mamic2 wrote:
hi guys,
i have problems while using POST to send data to Easyiot cloud.

In the examples given by Easyiot website, it connects to wifi network, then:
// Set up TCP connection.
String cmd = "AT+CIPSTART=\"TCP\",\"";
cmd += EIOT_CLOUD_ADDRESS;
cmd += "\",40404";
esp8266.println(cmd);

// Sending data
String url = "";
// URL: /RestApi/SetParameter/[instance id]/[parameter id]/[value]
url += "/RestApi/SetParameter/"+ String(EIOT_CLOUD_INSTANCE_PARAM_ID) + "/"+String(temp); // generate EasIoT cloud update parameter URL

esp8266.print(String("POST ") + url + " HTTP/1.1\r\n" +
"Host: " + String(EIOT_CLOUD_ADDRESS) + "\r\n" +
"Connection: close\r\n" +
"Content-Length: 0\r\n" +
"\r\n");


Since this code is not working for me, i would like ot ask if AT+CIPSEND=xxx is needed before POST.
I didnt find it in code provided by Easyiot website.
Thanks for helping me.
Ciao

Hi, I see you are using old REST API. I recommend you to use REST API V1. You can download library here:
iot-playground.com/blog/2-uncategorised/...apiv1-0-library-v1-0

This are two examples with this library:
iot-playground.com/blog/2-uncategorised/...ot-cloud-rest-api-v1
iot-playground.com/blog/2-uncategorised/...i-v1-and-email-alarm
The administrator has disabled public write access.

Issue POSTing data to Easyiot cloud 1 year 3 months ago #3281

  • mamic2
  • mamic2's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
Thanks for the advice, but unfortunately im not able to solve my problem this way. I dont run my project on esp8266 but on arduino nano connected to esp8266 and the REST API V1 includes esp8266wifi.h and it doest work on nano.
Can you please advice how to send values to easyiot cloud using nano+esp8266? thanks
The administrator has disabled public write access.

Issue POSTing data to Easyiot cloud 1 year 3 months ago #3283

  • mamic2
  • mamic2's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
i did a further step reading new library code but still no able to send data:
can somebody help? if i do same post request with http request software it works!


int t=40;
String url = "";
url += "POST /RestApi/v1.0/Parameter/" + String(PARAM1_ID) + "/Value/" + t;
String ccmmdd=String(url+" HTTP/1.1\r\n") +
"Host: " + String(IP) + ":" + String(PORT) + "\r\n" +
"EIOT-AuthToken: "+ String(TOKEN) + "\r\n" +
"Accept: */*\r\n" +
"Content-Length: 0\r\n" +
"Content-Type: application/x-www-form-urlencoded\r\n"+
"\r\n";
Serial.println(ccmmdd);
esp8266.print("AT+CIPSEND=");
esp8266.println(ccmmdd.length());
delay(500);
esp8266.print(ccmmdd);
The administrator has disabled public write access.

Issue POSTing data to Easyiot cloud 8 months 1 week ago #3596

Hi, I'm having the same issue. Did you find the solution yet?
The administrator has disabled public write access.

Issue POSTing data to Easyiot cloud 3 months 5 days ago #3803

  • JonW
  • JonW's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Karma: 0
Hi this is what i did to get round not using ESP8266, i am using mega connected to the 8266 and works fine. now to get MQTT working on it.

String url = "";


String values("[{\"Id\": \""+parameterSetTemp+"\", \"Value\": \""+String(SetTemp)+"\" }]");

url = "POST /RestApi/v1.0/Parameter/Values";
client.print(String(url+" HTTP/1.1\r\n") +
"Host: " + String(EIOT_CLOUD_ADDRESS) + "\r\n" +
"EIOT-AuthToken: "+String(token) + "\r\n" +
"Connection: close\r\n" +
"Content-Length: " + values.length() +
"\n\n" +
values +
"\r\n");
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.271 seconds
Powered by Kunena Forum