# I want to connect to firebase database but continously getting this error

**URL:** <https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649>\
**Category:** Programming\
**Created:** [September 9, 2017, 9:36am UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649 "2017-09-09T09:36:53Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudhanshubhagat101](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@sudhanshubhagat101](https://forum.arduino.cc/u/sudhanshubhagat101)\
**Post date:** [September 9, 2017, 9:36am UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/1 "2017-09-09T09:36:53Z")

</div>

#include \<Firebase.h\>  
#include \<FirebaseArduino.h\>  
#include \<FirebaseCloudMessaging.h\>  
#include \<FirebaseError.h\>  
#include \<FirebaseHttpClient.h\>  
#include \<FirebaseObject.h\>

#define FIREBASE\_HOST "[fir-app-example.firebaseio.com](http://fir-app-example.firebaseio.com)"

#define FIREBASE\_AUTH "examplesd2asdasdasdasd2asd3asd2asd2as32das3d2as2da3"

#define WIFI\_SSID "abcd"

#define WIFI\_PASSWORD "123456"

#define LED 13

void setup() {

pinMode(LED,OUTPUT);

digitalWrite(LED,0);

Serial.begin(9600);

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.setInt("LEDStatus",0);

}

void loop() {

if(Firebase.getInt("LEDStatus"))

{

digitalWrite(LED,HIGH);

}

else

{

digitalWrite(LED,LOW);

}

if (Firebase.failed()) // Check for errors {

Serial.print("setting /number failed:");

Serial.println(Firebase.error());

return;

}

delay(1000);

}

Error:  
I'm constantly getting this error

arduino-builder/arduino-builder -compile -core-api-version 10611 -build-path /tmp/808655269 -hardware arduino-builder/hardware -hardware arduino-builder/packages/cores -tools arduino-builder/tools -tools arduino-builder/packages/tools -built-in-libraries arduino-builder/latest -libraries /tmp/608097246/pinned -libraries /tmp/608097246/custom -fqbn arduino:avr:uno -build-cache /tmp -verbose=false /tmp/608097246/Firebase

In file included from /tmp/608097246/Firebase/Firebase.ino:1:0:

/tmp/608097246/custom/firebase-arduino/src/Firebase.h:24:18: fatal error: memory: No such file or directory

#include

^

compilation terminated.

exit status 1

My Board: Arduino Uno+ESP8266

---

<div class="post-metadata">

**Author:** ![PaulMurrayCbr](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@PaulMurrayCbr](https://forum.arduino.cc/u/PaulMurrayCbr)\
**Post date:** [September 9, 2017, 11:38am UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/2 "2017-09-09T11:38:53Z")

</div>

So, Firebase.h - part of the third party library you are using - has an extremely basic error in it: no .h on the include. At this point, I would abandon using that library altogether.

If you want to fix it, go into your-arduino-install/libraries/firebase-arduino/src/Firebase.h and fix the offending line

```cpp
#include <memory.h>

```

But its a safe bet there will be tons more obvious errors.

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [September 9, 2017, 2:25pm UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/3 "2017-09-09T14:25:25Z")

</div>

It's no error. The error is that sudhanshubhagat101 is trying to compile a library that is written to run on ESP8266 for Uno, which it is not compatible with. The AVR toolchain does not contain that file but the ESP8266 toolchain does indeed.

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [September 9, 2017, 4:12pm UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/4 "2017-09-09T16:12:28Z")

</div>

None of the firebase-arduino examples include Firebase.h (or FirebaseError.h or FirebaseHttpClient.h or FirebaseObject.h). They include ONLY FirebaseArduino.h except the FirebaseCloudMessaging example which includes ONLY FirebaseCloudMessaging.h (doesn't include FirebaseArduino.h).

Try removing all of the includes except FirebaseArduino.h.

See the source code at: [GitHub - FirebaseExtended/firebase-arduino: Arduino samples for Firebase.](https://github.com/firebase/firebase-arduino)

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [September 9, 2017, 4:27pm UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/5 "2017-09-09T16:27:42Z")

</div>

Because the author of the FirebaseArduino library hasn't defined an [includes](https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-format)value in library.properties, when you do **Sketch \> Include Library \> FirebaseArduino** it automatically adds all those includes to the sketch.

FirebaseArduino.h includes Firebase.h, which includes memory so the same problem remains. However, FirebaseArduino.h includes string before that so you will get this error compiling for Uno:

```cpp
E:\arduino\libraries\firebase-arduino\src/FirebaseArduino.h:20:18: fatal error: string: No such file or directory

 #include <string>

```

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [October 7, 2017, 11:34pm UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/6 "2017-10-07T23:34:06Z")

</div>

From private message:

> kiroe:  
> I wanted to consult you over a comment you did in this post [I want to connect to firebase database but continously getting this error - Programming Questions - Arduino Forum](https://forum.arduino.cc/index.php?topic=499268.0)
> 
> Do you know where I can get the esp8266 toolchain element you mentioned that is required for Arduino Uno to be able to read the data on the Firebase-Arduino Master library?

There are at least a couple, they are in xtensa-lx106-elf-gcc, which you can download from here:

- Windows: [https://github.com/esp8266/Arduino/releases/download/2.3.0/win32-xtensa-lx106-elf-gb404fb9-2.tar.gz](https://github.com/esp8266/Arduino/releases/download/2.3.0/win32-xtensa-lx106-elf-gb404fb9-2.tar.gz)
- macOS: [https://github.com/esp8266/Arduino/releases/download/2.3.0/osx-xtensa-lx106-elf-gb404fb9-2.tar.gz](https://github.com/esp8266/Arduino/releases/download/2.3.0/osx-xtensa-lx106-elf-gb404fb9-2.tar.gz)
- Linux (64 bit): [https://github.com/esp8266/Arduino/releases/download/2.3.0/linux64-xtensa-lx106-elf-gb404fb9.tgz](https://github.com/esp8266/Arduino/releases/download/2.3.0/linux64-xtensa-lx106-elf-gb404fb9.tgz)
- Linux (32 bit): [https://github.com/esp8266/Arduino/releases/download/2.3.0/linux32-xtensa-lx106-elf.tar.gz](https://github.com/esp8266/Arduino/releases/download/2.3.0/linux32-xtensa-lx106-elf.tar.gz)
- Linux (ARM): [https://github.com/esp8266/Arduino/releases/download/2.3.0/linuxarm-xtensa-lx106-elf-g46f160f-2.tar.gz](https://github.com/esp8266/Arduino/releases/download/2.3.0/linuxarm-xtensa-lx106-elf-g46f160f-2.tar.gz)

How did I know that? I installed the [ESP8266 core for Arduino](https://github.com/esp8266/Arduino), searched the tools folder of the package for the files in question (memory and string), found the tool name from the folder name that contained them and then found the download URLs from the ESP8266 core for Arduino's Boards Manager JSON URL:  
[http://arduino.esp8266.com/versions/2.3.0/package\_esp8266com\_index.json](http://arduino.esp8266.com/versions/2.3.0/package_esp8266com_index.json)  
which contains the download URLs for all the tool dependencies of that package.

However, I don't think any of that will do you any good for trying to get the library working on your Uno. The uno has a different architecture from the ESP8266 and just grabbing some files out of the ESP8266 toolchain is highly unlikely to work.

---

<div class="post-metadata">

**Author:** ![kiroe](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kiroe](https://forum.arduino.cc/u/kiroe)\
**Post date:** [October 8, 2017, 10:39pm UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/7 "2017-10-08T22:39:03Z")

</div>

To solve this you'll need to change the board to generic ESP8266  
and use the #include

Unfortunately this solution doesn't seem to work for Arduino Uno Wifi board (which comes with an integrated esp8266 module) which is the subsequent issue I wanted to solve with the prior message sent to pert.

Tl;Dr: I think that as long as you have an external ESP8266 module, this solution should work. The firebase arduino library doesn't work with other options since it requires a #include \<$String\> which isn't present in libraries other than the ESP8266WiFi one

---

<div class="post-metadata">

**Author:** ![kiroe](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kiroe](https://forum.arduino.cc/u/kiroe)\
**Post date:** [October 8, 2017, 11:00pm UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/8 "2017-10-08T23:00:37Z")

</div>

Do you believe that if I connect an external ESP8266 module to the arduino uno wifi, I'll be able to select and send the arduino build to a "Generic 8266 module" board

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [October 8, 2017, 11:11pm UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/9 "2017-10-08T23:11:57Z")

</div>

> kiroe:  
> Do you believe that if I connect an external ESP8266 module to the arduino uno wifi, I'll be able to select and send the arduino build to a "Generic 8266 module" board

Yeah, some people will use their Arduino as a USB-serial adapter to directly program the ESP8266. You'll find tons of tutorials for this. The most confusing thing is that you need to make the connection between the ESP8266 and the Arduino pins as RX-RX, TX-TX instead of the standard RX-TX, TX-RX. The other trick is that you need to make sure the microcontroller (ATmega328P in your case) on the Arduino board is not interfering with the serial communication between the PC and the ESP8266. Doing this tends to lead to a lot of confusion and problems so it's only really worth doing if you have the Arduino board and the ESP8266 and don't want to wait for a dedicated USB-serial board to get shipped to you. If possible I recommend buying a cheap (\<$2 USD with free shipping from China) dedicated USB-serial breakout on eBay or whatever your favorite source for breakout boards is. You can even buy boards that the ESP-01 modules plug right in to.

If you're going to be using the ESP8266 standalone then you should consider a Wemos D1 Mini or NodeMCU board, which have the USB-serial circuitry on the board so you can just plug them in to the USB port on your computer and upload right to the board.

---

<div class="post-metadata">

**Author:** ![kiroe](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kiroe](https://forum.arduino.cc/u/kiroe)\
**Post date:** [October 10, 2017, 4:34am UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/10 "2017-10-10T04:34:32Z")

</div>

So I got a NodeMCU board and was able to build arduino code that connects to wifi and (supposedly) connects to firebase.

I followed the instructions on this video: [Tutoriales Arduino Center - Nodemcu + App Inventor + Firebase - YouTube](https://www.youtube.com/watch?v=oD90mwMuNSU)

While everything seems to work, the Firebase.setInt method doesn't upload any value to the connected Firebase

Have you got any clues as to why this may be happening?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 10, 2017, 9:39am UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/11 "2017-10-10T09:39:43Z")

</div>

> While everything seems to work, the Firebase.setInt method doesn't upload any value to the connected Firebase

I wouldn't expect it to. I'd expect it to set a value in the parameter list that eventually gets used to make a GET request.

Post all of your current code AND links to the non-standard libraries you are using.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 10:43pm UTC](https://forum.arduino.cc/t/i-want-to-connect-to-firebase-database-but-continously-getting-this-error/479649/12 "2021-05-05T22:43:39Z")

</div>

Closed on May 5, 2021, 10:43pm UTC


