firebase-arduino: Firebase.failed()

Hey everyone,

I seem to be having a unique error that I can’t find anyone else facing. When I call Firebase.get("[path]") on a given path in my database, it returns unsuccessfully. As expected, Firebase.failed() is true, however, I can’t see any output with Serial.println(Firebase.error()); (the error is empty). My database url and api key are correct as I can use them in my NodeJS project. My usage is a follows:

After my ESP12E is connected successfully to WiFi, I run Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); in my setup function. Then, in my loop, I call FirebaseObject temp = Firebase.get("light-options"); (light-options being a path to an object in my database. Yes, I have also tried this with a single value within the object such as "light-options/red".). This is directly followed by: if (Firebase.failed()) { Serial.println("Firebase get failed"); Serial.println(Firebase.error()); } At which point, the console prints the string, but no output for Firebase.error(). Also, I have ensured that the network does remain connected throughout this process.

Any thoughts? I’m not sure how to proceed.

Many thanks, Nelly

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 43

Most upvoted comments

any update?still can’t figure it out what’s wrong with my sketch. already tried many tutorials, none of it able to talk to Firebase

[update] solved my problem by erasing the “https://” and “/” (at the end of the sentence) when defining the FIREBASE_HOST

@rishini just follow the steps in https://github.com/Chriton/Firebase-Arduino/tree/master/Arduino Project#troubleshooting :

  • first check the new Firebase fingerprint here Server Fingerprints. Copy your database address in there (eg. mydatabase.firebaseio.com) and click on Fingerprint Site. For me at this moment it shows: 6F:D0:9A:52:C0:E9:E4:CD:A0:D3:02:A4:B7:A1:92:38:2D:CA:2F:26
  • Do not just copy this one, maybe it has changed again, so just verify it yourself.
  • remove the firebase-arduino library added initially like shown in the “Removing an arduino library” section.
  • download a firebase-arduino zip release from the repository, then extract all the files into a folder of your choice and replace the old fingerprint which can be found in the extracted files -> src/FirebaseHttpClient.h -> kFirebaseFingerprint
  • after you add the new fingerprint into FirebaseHttpClient.h, save it and put all the files back into a zip file and reimport the library like shown in the “Arduino IDE Setup & adding libraries” section.
  • restart Arduino IDE and recompile your sketch.

@rishini just follow the steps in https://github.com/Chriton/Firebase-Arduino/tree/master/Arduino Project#troubleshooting :

  • first check the new Firebase fingerprint here Server Fingerprints. Copy your database address in there (eg. mydatabase.firebaseio.com) and click on Fingerprint Site. For me at this moment it shows: 6F:D0:9A:52:C0:E9:E4:CD:A0:D3:02:A4:B7:A1:92:38:2D:CA:2F:26
  • Do not just copy this one, maybe it has changed again, so just verify it yourself.
  • remove the firebase-arduino library added initially like shown in the “Removing an arduino library” section.
  • download a firebase-arduino zip release from the repository, then extract all the files into a folder of your choice and replace the old fingerprint which can be found in the extracted files -> src/FirebaseHttpClient.h -> kFirebaseFingerprint
  • after you add the new fingerprint into FirebaseHttpClient.h, save it and put all the files back into a zip file and reimport the library like shown in the “Arduino IDE Setup & adding libraries” section.
  • restart Arduino IDE and recompile your sketch.

@Chriton - This method really helps me solve the issue…

Hey everyone m having the same issue with my esp. I was using the demo code that comes with esp package to upload data to my firebase and its not able to do so. It’s showing error “setting /number failed:”. So far I have tried everything i could think of I have double checked my secret database key and hostname (tried it with and without that “/” at the end), changed upload speed to 9600 and even tried using older version of ide i.e “1.6.9”. Still no luck. Any help would be appreciated. Thanks!

@rishini don’t know any other, that worked for me

hey all, It’s urgent plz help. I also have the same problem. I was using the demo code that comes with esp package to upload data to my firebase. It’s showing error “setting /number failed:”. I am using the new arduinojson library. Tried by adding the secrets to FIREBASE_AUTH and also tried by removing it. But none of it didn’t work. If you can help it would be appreciated. Thank you!