- Posts: 2
- Thank you received: 0
Please Log in or Create an account to join the conversation.
rdavidsson wrote: Hello Easy IoT,
I´ve been using Easy IoT Cloud for almost a year now with great results, working very well etc. After maintenance I haven´t been able to use your cloud because I cannot use the EIoTCloudRestApi library (it is only for ESP8266). The library is not compatible with the WEB IDE for Particle devices ( www.particle.io ). Do you have a solution for this?
Regards,
Ragnar
bool EIoTCloudRestApi::setParameterProperty(String parameterId, String property, String value)
{
WiFiClient client;
while(!client.connect(EIOT_CLOUD_ADDRESS, EIOT_CLOUD_PORT)) {
debug("connection failed");
wifiConnect();
}
String url = "POST /RestApi/v1.0/Parameter/"+parameterId+"/"+property+"/"+value;
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: 0\r\n" +
"\r\n");
return parseResponse(&client);
}
Please Log in or Create an account to join the conversation.
void sendtoeasyiot()
{
clientIOT.connect(EIOT_CLOUD_ADDRESS, EIOT_CLOUD_PORT);
clientIOT.print(String("POST /RestApi/v1.0/Parameter/"+ String(EIOT_CLOUD_1_INSTANCE_PARAM_ID) + "/"+String(value0, 2) + "HTTP/1.1\r\n") +
"Host: " + String(EIOT_CLOUD_ADDRESS) + "\r\n" +
"EIOT-AuthToken: "+String(token) + "\r\n" +
"Connection: close\r\n" +
"Content-Length: 0\r\n" +
"\r\n");
}
TCPClient clientIOT;
#define EIOT_CLOUD_1_INSTANCE_PARAM_ID "XXX"
#define EIOT_CLOUD_ADDRESS "cloud.iot-playground.com"
#define EIOT_CLOUD_PORT 40404
#define token "The token I added in the cloud"
Please Log in or Create an account to join the conversation.