FirebaseExtended / firebase-arduino

Arduino samples for Firebase.
Apache License 2.0
943 stars 494 forks source link

Fairebase.failed() is always true with empty Firebase.error #474

Closed vodibe closed 4 years ago

vodibe commented 4 years ago

Hey, I can't connect to firebase, after any kind of commands (setInt, setFloat, getString ...), firebase.failed() method always returns true with an empty error. Here is what i tried to do:

include

include

include

include

include

include

include

include

include

//VARIABILI FIREBASE

define FIREBASE_HOST "myproj.firebaseio.com/"

define FIREBASE_AUTH "xxxx"

//VARIABILI ESP8266

define WIFI_SSID "wifi"

define WIFI_PASSWORD "password"

String passcode = ""; void setup() { Serial.begin(9600); WiFi.begin(WIFI_SSID, WIFI_PASSWORD); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.print("\nconnected: "); Serial.println(WiFi.localIP());

////////////////////////////////// Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); delay(500); }

void loop() { passcode = Firebase.getString("user1"); if (Firebase.failed()) { Serial.println("errore>>"); Serial.println(Firebase.error()); Serial.print(";;"+passcode); Serial.println("<<"); }

if(Firebase.success()) { Serial.print("\nserver = "+passcode); Serial.print("\n###############"); }

delay(2500); } Cattura

vodibe commented 4 years ago

Solved, here is what you have to do: 1 - Close Arduino IDE 2 - Copy firebase host url and generate your own fingerprint here 3 - Copy your own fingeprint (it should be like this XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX ) and copy it in FirebaseHttpClient.h file. 4 - you will have something like this: ... other code ... static const char kFirebaseFingerprint[] = "XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX";

N.B. do not delete colon (:), just paste the fingerprint

Mohfarrag commented 3 years ago

same issue and the fingerprint work for me, but for clarification. use the same firebase host url you use in arduino code. thanks @brearlycoffee

m4ddySF commented 3 years ago

Thanks a lot! This saved me a lot of trouble!

Eronrhcp commented 2 years ago

Muito obrigado, amigo! Funcionou para mim <3

AazainUmrani commented 10 months ago

Good work brother you made my day :)

CNJAY1911 commented 2 weeks ago

Solved, here is what you have to do: 1 - Close Arduino IDE 2 - Copy firebase host url and generate your own fingerprint here 3 - Copy your own fingeprint (it should be like this XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX ) and copy it in FirebaseHttpClient.h file. 4 - you will have something like this: ... other code ... static const char kFirebaseFingerprint[] = "XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX";

N.B. do not delete colon (:), just paste the fingerprint

Saved my life bro...thanks