No such file or directory- Arduino Uno WiFi Rev 2

Hi, I'm very new to Arduino and am doing a project using one. I need to push data from sensors up to firebase. To start off, I am trying to assign a float to a varaible but I keep getting an error.

In file included from C:\Users\Karl_\Documents\Arduino\sketch_mar01d\sketch_mar01d.ino:4:0:
C:\Users\Karl_\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:20:10: fatal error: string: No such file or directory
 #include <string>
          ^~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Arduino Uno WiFi Rev2.

My Code is :

#include <WiFiNINA.h>
#include <FirebaseArduino.h>


#define FIREBASE_HOST "___________.firebaseio.com"
#define FIREBASE_AUTH "__________________________"
#define WIFI_SSID "__________"
#define WIFI_PASSWORD "______________"

void setup() {
  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);
  
}
void loop(){
  Firebase.setFloat("number", 44.3);
  }

`Thank you for reading!

From the library's readme:

https://github.com/FirebaseExtended/firebase-arduino#readme

Arduino library that show how to call the Firebase API from the ESP8266 Arduino core.

This library can only be used with the Arduino boards that use an ESP8266 microcontroller. Your Uno WiFi Rev2 uses the ATmega4809 microcontroller instead. This is the cause of the error.

I see there is another FireBase library that claims compatibility with the Uno WiFi Rev2:

You can install it using the Arduino IDE Library Manager:

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus.

  2. Wait for the update to finish.

  3. In the "Filter your search" field, type Firebase Arduino based on WiFiNINA

  4. Press Enter.

  5. Scroll down through the list of libraries until you see "Firebase Arduino based on WiFiNINA by Mobizt". Click on it.

  6. Click the Install button.

  7. You may now get a dialog asking:

    Would you like to install also all the missing dependencies?

    If so, click the Install all button.

  8. Wait for the installation to finish.

  9. Click the Close button.

You will now find example sketches that demonstrate the usage of the library under the File > Examples > Firebase Arduino based on WiFiNINA menu in the Arduino IDE.

Hi, Thank you for your help!

I have done that now and it seems to work to some extent!!
I am now trying to push a double to my firebase. The code snippet is below.

String path = "/test";

Serial.print("Push double... ");

  if (Firebase.pushDouble(fbdo, path + "/push/double", 1234.56789))
  {
    Serial.println("ok");
    Serial.println("path: " + fbdo.dataPath());
    Serial.print("push name: ");
    Serial.println(fbdo.pushName());
  }
  else
  {
    Serial.println("error, " + fbdo.errorReason());
  }

  Serial.println();

Does anyone know if I need to make the path that I have specified above or will it automatically create it?

When I run the code, it connects to wifi, okay but I get an error, not found, 404 Not Found when I try sending a double with the code above.
Would be grateful for any assistance

I have similar issue, see my post “Missing avr-glibc”. The megaavr framework the Rev 2 uses doesn’t include the C standard library headers (like <string.h>) or is missing a compiler directive or something. I’ve seen similar posts on Atmel Studio blogs where people are targeting the Rev 2. If someone has a solution that’d be great because none of my apps that reference the cstdlib files will compile for the Rev 2, but do just fine on avr/samd boards.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.