Notifications
Clear all

[Sticky] FAQ - FAVORIOT PLATFORM

Mazlan Abbas
(@mazlan-abbas)
Trusted Member Moderator

Dear All - Please check here first for the FAQ. We will keep on updating the FAQ! Thanks!

  1. FAVORIOT Platform Documentation
  2. How to Subscribe
  3.  
Quote
Topic starter Posted : 04/04/2019 10:11 am
Topic Tags
jaywong
(@jaywong)
New Member Registered

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();
}

This post was modified 2 years ago 4 times by jaywong
ReplyQuote
Posted : 24/11/2019 7:52 pm
jaywong
(@jaywong)
New Member Registered

Can I get the format of URL to update the data to Favoriot?

 

ReplyQuote
Posted : 24/11/2019 8:39 pm
Gops
 Gops
(@gopish)
Eminent Member Moderator

@jaywong

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

 

 

ReplyQuote
Posted : 14/04/2020 9:49 am
Share:

Copyright © 2021 All rights reserved