Dear All - Please check here first for the FAQ. We will keep on updating the FAQ! Thanks!
Good afternoon, Sir.
I faced a major problem with how to send my data from ESP32 to Favoriot Data Stream. I am total cannot understand the codings that I got it from Google. Can you simply explain the coding structures for me and my project team?
Thank you so much, Sir.
.
.
We cannot understand the codings below:
if (client.connect(server, 80)) {
// if (1) {
// the 'if' function is connected successfully, and it is if(1).
// the if function is executing
client.println("POST /v2/iot/streams HTTP/1.1");
client.println("Host: api.favoriot.com");
client.println(F("apikey: abcdef")); // change it!
client.println("Content-Type: application/json");
client.println("cache-control: no-cache");
client.print("Content-Length: ");
int thisLength = json.length();
client.println(thisLength);
client.println("Connection: close");
client.println();
client.println(json);
Serial.println("asfas"); //testing is the 'if' function looping or not
}
while (client.available()) {
char c = client.read();
Serial.write(c);
}
if (!client.connected()) {
client.stop();
}
Can I get the format of URL to update the data to Favoriot?
Please refer to the following post regarding connecting ESP32 to Favoriot Platform. The code and tutorial in given in the GitHib.
https://www.favoriot.com/forum/favoriot-iot-platform/esp32-to-favoriot-platform#post-189