Open stechome opened 5 years ago
Hi
I am also facing the same issue. I am using ESP.reset as a temporary remedy.
Though it does not fully resolve the problem but ESP.reset(); helps to reconnect to firebase.
// header
int count =0;
void setup{// wifi etc.}
void loop()
{
if (Firebase.failed())
{
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Serial.println(Firebase.error());
delay(10);
Serial.println("Error connecting firebase!");
count++;
if (count == 10) {
count = 0;
ESP.reset();
}
return;
}
I can't seem to set or push any value to firebase from NodeMCU that worked a month ago. Does anyone has the same problem? Is the fingerprint of the firebase changed again?
Edit: NVM firebase changed their fingerprint to B6:F5:80:C8:B1:DA:61:C1:07:9D:80:42:D8:A9:1F:AF:9F:C8:96:7D for anyone who has the problem connecting, go to firebase-arduino-master/src/FirebaseHttpClient.h and change kFirebaseFingerprint[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
error stream :((
I installed the Version 5.13.4 of ArduinoJson library, the newer versions seems to not work for NodeMCU
Hi
ArduinoJson 6.0 is not compatible with firebase-arduino right now.
This one will work:-
@FrankAndYoung Hey frank, how do you check the fingerprint of firebase? I used the GRC website (https://www.grc.com/fingerprints.htm) to check and I got a different fingerprint for console.firebase.google.com than what you have got. The fingerprint you gave worked, but the one I found did not work.
Oh you dont enter the actual url, instead you enter the host reference to your realtime database For example #define FIREBASE_HOST "example.firebaseio.com" in the FirebaseDemo, it will be "example.firebaseio.com".
@FrankAndYoung Thanks a lot Frank! It worked
It Works... @FrankAndYoung Thank you. Do you know if will be necessary to rebuild to all devices every time it occurs? Does it happen that often?
Hi @ironaraujo
Yes, it is necessary to rebuild all devices after fingerprint update.
It happens everytime whenever firebase server SSL certificate renewed.
@TrickSumo Is there anyway to avoid that?
This library does not use fingerprint to connect to firebase:-
Two days I did everything to connect to the firebase but I couldn't connect. below is my code. Looking for help plz:
void setup() { pinMode(LedPin, OUTPUT); Serial.begin(115200); // connect to wifi. WiFi.begin(WIFI_SSID, WIFI_PASSWORD); Serial.print("connecting"); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.println(); Serial.print("connected: ") ; Serial.println(WiFi.localIP()); Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); Firebase.stream("/Myhome"); } void loop() { if (Firebase.failed()) { Serial.println("streaming error"); Serial.println(Firebase.error()); }
if (Firebase.available()) { FirebaseObject event = Firebase.readEvent(); String eventType = event.getString("type"); Serial.print("event: "); Serial.println(eventType); if (eventType == "put") { String path = event.getString("path"); String data = event.getString("data"); Serial.println(String("data: ") + data); if (path.equals("/light/value")) { if (data.equals("off")) { digitalWrite(LedPin, HIGH); } else { digitalWrite(LedPin, LOW); } } } } }
@TrickSumo This libs is awesome. It recovers from internet disconnection and firebase stream time out. Ty.
@nheoo Check if your Arduino Library is updated, google fingerprint have change a couple days ago. So I would reinstall Arduino lib, if you want continue using that one...
I also would add an delay(1000) immediately after "Firebase.stream("/Myhome");" in setup. It will give more time to estabilish the connection.
@ironaraujo
Yes, that library is awesome.
Thanks to @mobizt
@nheoo Check if your Arduino Library is updated, google fingerprint have change a couple days ago. So I would reinstall Arduino lib, if you want continue using that one...
I also would add an delay(1000) immediately after "Firebase.stream("/Myhome");" in setup. It will give more time to estabilish the connection.
thank u <3 I knew my problem. Are there any i/o pins to declare that I can use?
@FrankAndYoung Thanks man! It solved the problem for me.
not able to connect NodeMCU to firebase right now help me please
can see any value which is fetched from a database from firebase to nodemcu
Once the internet connection is disconnected, it's wired again. When I'm wired again, firebase does not connect. So when the problem is wired again, it's not connected to firebasis again. How do I do that?
`boolean WiFiReturns() { if (WiFi.localIP() == IPAddress(0, 0, 0, 0)) return 0; switch (WiFi.status()) { case WL_NO_SHIELD: return 0; case WL_IDLE_STATUS: return 0; case WL_NO_SSID_AVAIL: return 0; case WL_SCAN_COMPLETED: return 1; case WL_CONNECTED: return 1; case WL_CONNECT_FAILED: return 0; case WL_CONNECTION_LOST: return 0; case WL_DISCONNECTED: return 0; default: return 0; } } void firebasereconnect() { Serial.println("Trying to reconnect"); Firebase.begin(firebaseURl, authCode); } void loop() {
if (!WiFiReturns()) { WiFi.isConnected(); digitalWrite(WIFILED, HIGH); firebasereconnect();
} else { digitalWrite(WIFILED, LOW); } }`