firebasearduinoesp8266

ArduinoJson.h: No such file or directory (Arduino)


I have a problem include libraries FirebaseArduino There was an error. fatal error: ArduinoJson.h: No such file or directory How should I solve this problem?

This is my code

#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>

#define FIREBASE_HOST "example.firebaseio.com"
#define FIREBASE_AUTH "token_or_secret"
#define WIFI_SSID "SSID"
#define WIFI_PASSWORD "PASSWORD"
void setup() {
  erial.begin(9600);

  // 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);
}

void loop() {
  Frirebase.setInt("Count", count++);
  delay(1000);
}


Solution

  • When you encounter a "No such file or directory" error it usually means you need to install the library that contains the missing file (in this case ArduinoJson.h).

    Ideally the documentation for the code you are trying to compile will have instructions for installing dependencies. Sometimes the author did not make the effort to write this documentation and you'll need to go searching for the missing library.

    Many Arduino libraries are in the Library Manager index, which makes them quite easy to install:

    Library Manager installation

    1. (In the Arduino IDE) Sketch > Include Library > Manage Libraries.
    2. Wait for the download to finish.
    3. In the "Filter your search..." box, type your search query, in this case "ArduinoJson" would be appropriate.
    4. Scroll through the search results to find something that looks correct (in this case "ArduinoJson by Benoit Blanchon"), then click on it.
    5. Click "Install".
    6. Wait for installation to finish.
    7. Click "Close".

    If you don't find the library you need in Library Manager you'll need to spend some time with your favorite search engine. Once you find the library and download it you'll need to install it.

    .ZIP Installation

    (In the Arduino IDE) Sketch > Include Library > Add .ZIP Library Select the downloaded file (must be a .zip). Click "Open".

    The above installation instructions require the .zip file to have a specific folder structure. In some cases the library author has not been kind enough to provide the correct folder structure. If you get a "Zip doesn't contain a library" error message then you will need to do a manual installation of the library.

    Manual Installation

    1. Unzip the downloaded file
    2. Browse through the unzipped folder until you find the library folder. This will either have a library.properties file and/or a .h file.
    3. Copy the library folder to {Sketchbook folder}/libraries. You can find the sketchbook folder in the Arduino IDE at File > Properties > Sketchbook location. You will need to restart the Arduino IDE before the examples sketches for manually installed libraries will appear under the File > Examples menu.