ESP8266 stopped receiving data from firebase












0















I am trying to receive data from firebase to my ESP8266 so that I can send a mail using received data on button press. But the ESP stops receiving data after a couple of minutes. Can anyone tell the reason behind it?



Here's the code.



#include <ESP8266WiFi.h>
#include "Gsender.h"
#include <FirebaseArduino.h>
#define FIREBASE_HOST "iotapp11.firebaseio.com"
int button = 0;
const char* ssid = "Redmi 3s";
const char* password = "alohomora";

void setup()
{
pinMode(button,INPUT);
Serial.begin(115200);
Serial.printf("Connecting to %s ", ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");}
Serial.println(" connected");
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST);
}

void loop(){
Firebase.get(FIREBASE_HOST); //Tried putting it in void setup and even removed it but nothing worked.

int but_val = digitalRead(button);
Gsender *gsender = Gsender::Instance();

String emailid =Firebase.getString("Email");
String subject =Firebase.getString("Subject");
String content =Firebase.getString("Content");
Serial.println(emailid);
Serial.println(subject);
Serial.println(content);

if ( but_val == LOW){
Serial.println("Button pressed");
delay(1000);
gsender->Subject(subject)->Send(emailid, content) ;
Serial.println("Message sent.");
delay(1000);
} else {
Serial.println("Button Not pressed");
delay(1000);
}
}









share|improve this question























  • Try adding a Serial.println(ESP.getFreeHeap()); to check you are not filling the ram

    – Frenchy
    Dec 31 '18 at 13:11











  • While not the answer you are looking for, consider if you are perhaps going about this the wrong way around - you probably want logic in the cloud to generate email based on information uplinked from the embedded gadget. Trying to originate email in the gadget is likely unsustainable, as mail service/server interfaces will probably continue to get more and more locked down for anti-spam and security reasons, and even if your gadget has an update mechanism, it's not a given that what you'll be required to do in the future would readily fit on it.

    – Chris Stratton
    Dec 31 '18 at 18:00













  • @Frenchy I tried what you suggested. The values printed on the serial monitor were almost same before and receiving the data from cloud.

    – user10851894
    Jan 1 at 16:39











  • @ChrisStratton Actually the logic is in the microcontroller. I have separate header class for sending email. I'm just trying to fetch email address from the cloud to microcontroller. And it's working fine for couple of minutes and after that it stops.

    – user10851894
    Jan 1 at 16:41











  • The points was trying to do that in the MCU is unsustainable when Gmail security rules and algorithms change. When, not if.

    – Chris Stratton
    Jan 1 at 16:45


















0















I am trying to receive data from firebase to my ESP8266 so that I can send a mail using received data on button press. But the ESP stops receiving data after a couple of minutes. Can anyone tell the reason behind it?



Here's the code.



#include <ESP8266WiFi.h>
#include "Gsender.h"
#include <FirebaseArduino.h>
#define FIREBASE_HOST "iotapp11.firebaseio.com"
int button = 0;
const char* ssid = "Redmi 3s";
const char* password = "alohomora";

void setup()
{
pinMode(button,INPUT);
Serial.begin(115200);
Serial.printf("Connecting to %s ", ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");}
Serial.println(" connected");
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST);
}

void loop(){
Firebase.get(FIREBASE_HOST); //Tried putting it in void setup and even removed it but nothing worked.

int but_val = digitalRead(button);
Gsender *gsender = Gsender::Instance();

String emailid =Firebase.getString("Email");
String subject =Firebase.getString("Subject");
String content =Firebase.getString("Content");
Serial.println(emailid);
Serial.println(subject);
Serial.println(content);

if ( but_val == LOW){
Serial.println("Button pressed");
delay(1000);
gsender->Subject(subject)->Send(emailid, content) ;
Serial.println("Message sent.");
delay(1000);
} else {
Serial.println("Button Not pressed");
delay(1000);
}
}









share|improve this question























  • Try adding a Serial.println(ESP.getFreeHeap()); to check you are not filling the ram

    – Frenchy
    Dec 31 '18 at 13:11











  • While not the answer you are looking for, consider if you are perhaps going about this the wrong way around - you probably want logic in the cloud to generate email based on information uplinked from the embedded gadget. Trying to originate email in the gadget is likely unsustainable, as mail service/server interfaces will probably continue to get more and more locked down for anti-spam and security reasons, and even if your gadget has an update mechanism, it's not a given that what you'll be required to do in the future would readily fit on it.

    – Chris Stratton
    Dec 31 '18 at 18:00













  • @Frenchy I tried what you suggested. The values printed on the serial monitor were almost same before and receiving the data from cloud.

    – user10851894
    Jan 1 at 16:39











  • @ChrisStratton Actually the logic is in the microcontroller. I have separate header class for sending email. I'm just trying to fetch email address from the cloud to microcontroller. And it's working fine for couple of minutes and after that it stops.

    – user10851894
    Jan 1 at 16:41











  • The points was trying to do that in the MCU is unsustainable when Gmail security rules and algorithms change. When, not if.

    – Chris Stratton
    Jan 1 at 16:45
















0












0








0








I am trying to receive data from firebase to my ESP8266 so that I can send a mail using received data on button press. But the ESP stops receiving data after a couple of minutes. Can anyone tell the reason behind it?



Here's the code.



#include <ESP8266WiFi.h>
#include "Gsender.h"
#include <FirebaseArduino.h>
#define FIREBASE_HOST "iotapp11.firebaseio.com"
int button = 0;
const char* ssid = "Redmi 3s";
const char* password = "alohomora";

void setup()
{
pinMode(button,INPUT);
Serial.begin(115200);
Serial.printf("Connecting to %s ", ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");}
Serial.println(" connected");
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST);
}

void loop(){
Firebase.get(FIREBASE_HOST); //Tried putting it in void setup and even removed it but nothing worked.

int but_val = digitalRead(button);
Gsender *gsender = Gsender::Instance();

String emailid =Firebase.getString("Email");
String subject =Firebase.getString("Subject");
String content =Firebase.getString("Content");
Serial.println(emailid);
Serial.println(subject);
Serial.println(content);

if ( but_val == LOW){
Serial.println("Button pressed");
delay(1000);
gsender->Subject(subject)->Send(emailid, content) ;
Serial.println("Message sent.");
delay(1000);
} else {
Serial.println("Button Not pressed");
delay(1000);
}
}









share|improve this question














I am trying to receive data from firebase to my ESP8266 so that I can send a mail using received data on button press. But the ESP stops receiving data after a couple of minutes. Can anyone tell the reason behind it?



Here's the code.



#include <ESP8266WiFi.h>
#include "Gsender.h"
#include <FirebaseArduino.h>
#define FIREBASE_HOST "iotapp11.firebaseio.com"
int button = 0;
const char* ssid = "Redmi 3s";
const char* password = "alohomora";

void setup()
{
pinMode(button,INPUT);
Serial.begin(115200);
Serial.printf("Connecting to %s ", ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");}
Serial.println(" connected");
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST);
}

void loop(){
Firebase.get(FIREBASE_HOST); //Tried putting it in void setup and even removed it but nothing worked.

int but_val = digitalRead(button);
Gsender *gsender = Gsender::Instance();

String emailid =Firebase.getString("Email");
String subject =Firebase.getString("Subject");
String content =Firebase.getString("Content");
Serial.println(emailid);
Serial.println(subject);
Serial.println(content);

if ( but_val == LOW){
Serial.println("Button pressed");
delay(1000);
gsender->Subject(subject)->Send(emailid, content) ;
Serial.println("Message sent.");
delay(1000);
} else {
Serial.println("Button Not pressed");
delay(1000);
}
}






firebase arduino iot esp8266 nodemcu






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 31 '18 at 12:40









user10851894user10851894

1




1













  • Try adding a Serial.println(ESP.getFreeHeap()); to check you are not filling the ram

    – Frenchy
    Dec 31 '18 at 13:11











  • While not the answer you are looking for, consider if you are perhaps going about this the wrong way around - you probably want logic in the cloud to generate email based on information uplinked from the embedded gadget. Trying to originate email in the gadget is likely unsustainable, as mail service/server interfaces will probably continue to get more and more locked down for anti-spam and security reasons, and even if your gadget has an update mechanism, it's not a given that what you'll be required to do in the future would readily fit on it.

    – Chris Stratton
    Dec 31 '18 at 18:00













  • @Frenchy I tried what you suggested. The values printed on the serial monitor were almost same before and receiving the data from cloud.

    – user10851894
    Jan 1 at 16:39











  • @ChrisStratton Actually the logic is in the microcontroller. I have separate header class for sending email. I'm just trying to fetch email address from the cloud to microcontroller. And it's working fine for couple of minutes and after that it stops.

    – user10851894
    Jan 1 at 16:41











  • The points was trying to do that in the MCU is unsustainable when Gmail security rules and algorithms change. When, not if.

    – Chris Stratton
    Jan 1 at 16:45





















  • Try adding a Serial.println(ESP.getFreeHeap()); to check you are not filling the ram

    – Frenchy
    Dec 31 '18 at 13:11











  • While not the answer you are looking for, consider if you are perhaps going about this the wrong way around - you probably want logic in the cloud to generate email based on information uplinked from the embedded gadget. Trying to originate email in the gadget is likely unsustainable, as mail service/server interfaces will probably continue to get more and more locked down for anti-spam and security reasons, and even if your gadget has an update mechanism, it's not a given that what you'll be required to do in the future would readily fit on it.

    – Chris Stratton
    Dec 31 '18 at 18:00













  • @Frenchy I tried what you suggested. The values printed on the serial monitor were almost same before and receiving the data from cloud.

    – user10851894
    Jan 1 at 16:39











  • @ChrisStratton Actually the logic is in the microcontroller. I have separate header class for sending email. I'm just trying to fetch email address from the cloud to microcontroller. And it's working fine for couple of minutes and after that it stops.

    – user10851894
    Jan 1 at 16:41











  • The points was trying to do that in the MCU is unsustainable when Gmail security rules and algorithms change. When, not if.

    – Chris Stratton
    Jan 1 at 16:45



















Try adding a Serial.println(ESP.getFreeHeap()); to check you are not filling the ram

– Frenchy
Dec 31 '18 at 13:11





Try adding a Serial.println(ESP.getFreeHeap()); to check you are not filling the ram

– Frenchy
Dec 31 '18 at 13:11













While not the answer you are looking for, consider if you are perhaps going about this the wrong way around - you probably want logic in the cloud to generate email based on information uplinked from the embedded gadget. Trying to originate email in the gadget is likely unsustainable, as mail service/server interfaces will probably continue to get more and more locked down for anti-spam and security reasons, and even if your gadget has an update mechanism, it's not a given that what you'll be required to do in the future would readily fit on it.

– Chris Stratton
Dec 31 '18 at 18:00







While not the answer you are looking for, consider if you are perhaps going about this the wrong way around - you probably want logic in the cloud to generate email based on information uplinked from the embedded gadget. Trying to originate email in the gadget is likely unsustainable, as mail service/server interfaces will probably continue to get more and more locked down for anti-spam and security reasons, and even if your gadget has an update mechanism, it's not a given that what you'll be required to do in the future would readily fit on it.

– Chris Stratton
Dec 31 '18 at 18:00















@Frenchy I tried what you suggested. The values printed on the serial monitor were almost same before and receiving the data from cloud.

– user10851894
Jan 1 at 16:39





@Frenchy I tried what you suggested. The values printed on the serial monitor were almost same before and receiving the data from cloud.

– user10851894
Jan 1 at 16:39













@ChrisStratton Actually the logic is in the microcontroller. I have separate header class for sending email. I'm just trying to fetch email address from the cloud to microcontroller. And it's working fine for couple of minutes and after that it stops.

– user10851894
Jan 1 at 16:41





@ChrisStratton Actually the logic is in the microcontroller. I have separate header class for sending email. I'm just trying to fetch email address from the cloud to microcontroller. And it's working fine for couple of minutes and after that it stops.

– user10851894
Jan 1 at 16:41













The points was trying to do that in the MCU is unsustainable when Gmail security rules and algorithms change. When, not if.

– Chris Stratton
Jan 1 at 16:45







The points was trying to do that in the MCU is unsustainable when Gmail security rules and algorithms change. When, not if.

– Chris Stratton
Jan 1 at 16:45














0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53987650%2fesp8266-stopped-receiving-data-from-firebase%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53987650%2fesp8266-stopped-receiving-data-from-firebase%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas