0

I am trying to connect nodeMCU with firebase but it does not work

My Codes

    #include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
#define FIREBASE_HOST "https://*******-*****.firebaseio.com/"
#define FIREBASE_AUTH "oHFLbR9U4Qf3r3zJ********09E76uddawfEWLTv"
#define WIFI_SSID "Kocak"
#define WIFI_PASSWORD "Yusuf326"
#define LED LED_BUILTIN
void setup() {
  pinMode(LED,OUTPUT);
  digitalWrite(LED,0);
  Serial.begin(9600);
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  Serial.print("baglaniyor");
  while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
  }
  Serial.println();
  Serial.print("baglandi, ip: ");
  Serial.println(WiFi.localIP());
  Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
}
void loop() {
  Serial.println(Firebase.getInt("LEDStatus"));
  if(Firebase.getInt("LEDStatus"))
  {  
digitalWrite(LED,HIGH);
  }
  else
  {
digitalWrite(LED,LOW);
  }
  if (Firebase.failed())
 {
  Serial.print("HATA:");
  Serial.println(Firebase.error());  
  return;
  }  
  delay(100);
}

The result is always 0.

When I change a different api key which is not true it still same.

Always 0 returning.

I resarched lots of reference on github or this forum but could not solve the problem.

1 Answers1

0

As mentioned in the comments, try:

  1. Removing any https:// and trailing slash from the Firebase host
  2. Check that the fingerprint that the library uses matches the current fingerprint. See https://stackoverflow.com/a/54552554/1373856
Ben T
  • 4,656
  • 3
  • 22
  • 22