Hello everybody,
I have a problem with this FirebaseArduino library that I want to use with my NodeMCU V3 that jhave an ESP8266 chip.
So I have follow some tutorials and the examples from this repository, but i have still some problem with the connection to the my Firebase, it's trying to reconnect continuosaly, and I don;t understand where I have the problem in my code,
If anybody does know about an already know this problem and how to solve, please help me.
this is my code:
#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
#define FIREBASE_HOST "name.firebaseio.com" // the project name address from firebase id
#define FIREBASE_AUTH "SECRET_KEY" // the secret key generated from firebase
#define WIFI_SSID "WIFI_NAME"
#define WIFI_PASSWORD "WIFI_PASSWORD"
void setup() {
Serial.begin(9600); //Initialize hardware serial with baudrate of 9600
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to ");
Serial.print(WIFI_SSID);
while (WiFi.status() != WL_CONNECTED)
{
Serial.print(".");
delay(500);
}
Serial.println();
Serial.print("Connected to ");
Serial.println(WIFI_SSID);
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
}
void loop() {
if (Firebase.failed())
{
Serial.print("setting number failed:");
Serial.println(Firebase.error());
firebasereconnect();
return;
}
Serial.println(Firebase.getString("DATE"));
}
void firebasereconnect()
{
Serial.println("Trying to reconnect");
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
}