Giter Club home page Giter Club logo

Comments (6)

mobizt avatar mobizt commented on June 26, 2024 3

I don't think it is the issue.

I test it and it can compile and run normally with this simple code.

#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

#include <FirebaseESP8266.h>
#include "addons/TokenHelper.h"
#include "addons/RTDBHelper.h"

#define WIFI_SSID "WIFI_AP"
#define WIFI_PASSWORD "WIFI_PASSWORD"
#define API_KEY "API_KEY"
#define DATABASE_URL "URL"
#define USER_EMAIL "USER_EMAIL"
#define USER_PASSWORD "USER_PASSWORD"

FirebaseData fbdo;
FirebaseAuth auth;
FirebaseConfig config;

unsigned long dataMillis = 0;
int count = 0;

ESP8266WebServer server(80);

void setup() {

  Serial.begin(115200);

  WiFi.mode(WIFI_AP_STA);
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);

  Serial.print("Connecting to Wi-Fi");
  unsigned long ms = millis();
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(300);
  }
  Serial.println();
  Serial.print("Connected with IP: ");
  Serial.println(WiFi.localIP());
  Serial.println();

  Serial.printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION);

  config.api_key = API_KEY;
  auth.user.email = USER_EMAIL;
  auth.user.password = USER_PASSWORD;
  config.database_url = DATABASE_URL;

  Firebase.reconnectNetwork(true);
  fbdo.setBSSLBufferSize(4096, 1024);
  config.token_status_callback = tokenStatusCallback;

  Firebase.begin(&config, &auth);

  server.on("/", []() {
    server.send(200, "text/html", "<p>It works!</p>");
  });

  server.begin();
}

void loop() {
  server.handleClient();

  if (millis() - dataMillis > 5000 && Firebase.ready()) {
    dataMillis = millis();

    count++;

    Serial.printf("Set bool... %s\n", Firebase.setBool(fbdo, F("/test/bool"), count % 2 == 0) ? "ok" : fbdo.errorReason().c_str());

    Serial.printf("Get bool... %s\n", Firebase.getBool(fbdo, FPSTR("/test/bool")) ? fbdo.to<bool>() ? "true" : "false" : fbdo.errorReason().c_str());
  }
}

from firebase-esp8266.

mobizt avatar mobizt commented on June 26, 2024 1

You should create the simple sketch that reproduces the issue and post it here with the complete error.

from firebase-esp8266.

mobizt avatar mobizt commented on June 26, 2024 1

I'm not sure this related to your issue or not.
I found some problem with FirebaseJson integration when anywhere in the code or other libraries used the statement "using namespace std"
I update the FirebaseJson to fix the issue I've found, you can try by copy this json folder in Github and replace with json folder in your library install location on your PC.

from firebase-esp8266.

b1n0-kun avatar b1n0-kun commented on June 26, 2024

Hi Mobitz,

Thank you for the quick responding,
After asking you the question, I gged a little bit more and tried to include Firebase library before Webserver and somehow the issue disappeared.. But your test with Firebase included later still worked..hmm..It's hard to understand about the root cause.
But thanks anyway !!!

from firebase-esp8266.

b1n0-kun avatar b1n0-kun commented on June 26, 2024

Thanks Mobitz, will try to replace and test again when I have time !!!
I'm squeezing out the memory of ESP with Webserver,FSbrowser, WebSocket, Email and Firebase :D
So far the device still function well !

Hope to get your support from you in the future also.
Best regards

from firebase-esp8266.

jiperez11 avatar jiperez11 commented on June 26, 2024

Thanks Team

from firebase-esp8266.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.