Arduino IDE 为 Firebase 找到了多个库
Arduino IDE Multiple Libraries were found for Firebase
我正在尝试建立 NodeMCU v3 与 Google Firebase 的连接。但是我遇到了多个库错误。我已经确定草图文件夹中没有库。我只使用添加 .ZIP 选项安装它们。
这是我的代码:
#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
// Set these to run example.
#define FIREBASE_HOST "example.firebaseio.com"
#define FIREBASE_AUTH "token_or_secret"
//Change line with your WiFi router name and password
#define WIFI_SSID "SSID"
#define WIFI_PASSWORD "PASSWORD"
void setup() {
Serial.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);
}
int n = 0;
void loop() {
// set value
Firebase.setFloat("number", 42.0);
// handle error
if (Firebase.failed()) {
Serial.print("setting /number failed:");
Serial.println(Firebase.error());
return;
}
delay(1000);
// update value
Firebase.setFloat("number", 43.0);
// handle error
if (Firebase.failed()) {
Serial.print("setting /number failed:");
Serial.println(Firebase.error());
return;
}
delay(1000);
// get value
Serial.print("number: ");
Serial.println(Firebase.getFloat("number"));
delay(1000);
// remove value
Firebase.remove("number");
delay(1000);
// set string value
Firebase.setString("message", "hello world");
// handle error
if (Firebase.failed()) {
Serial.print("setting /message failed:");
Serial.println(Firebase.error());
return;
}
delay(1000);
// set bool value
Firebase.setBool("truth", false);
// handle error
if (Firebase.failed()) {
Serial.print("setting /truth failed:");
Serial.println(Firebase.error());
return;
}
delay(1000);
// append a new value to /logs
String name = Firebase.pushInt("logs", n++);
// handle error
if (Firebase.failed()) {
Serial.print("pushing /logs failed:");
Serial.println(Firebase.error());
return;
}
Serial.print("pushed: /logs/");
Serial.println(name);
delay(1000);
}
根据 IDE 的错误日志是:
In file included from C:\Users\Raffay Sajjad\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:30:0,
from C:\Users\Raffay Sajjad\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22,
from C:\Users\Raffay Sajjad\Documents\Arduino\WiFi_Connection\WiFi_Connection.ino:2:
C:\Users\Raffay Sajjad\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseObject.h:109:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
std::shared_ptr<StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>> buffer_;
^
In file included from C:\Users\Raffay Sajjad\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22:0,
from C:\Users\Raffay Sajjad\Documents\Arduino\WiFi_Connection\WiFi_Connection.ino:2:
C:\Users\Raffay Sajjad\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:86:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
std::shared_ptr<StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>> buffer_;
^
Multiple libraries were found for "ESP8266WiFi.h"
Used: C:\Users\Raffay
Multiple libraries were found for "FirebaseArduino.h"
Used: C:\Users\Raffay
Multiple libraries were found for "ArduinoJson.h"
Used: C:\Users\Raffay
Multiple libraries were found for "ESP8266HTTPClient.h"
Used: C:\Users\Raffay
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
任何人都可以对此提供见解吗?
检查您使用的是哪个 arduino json 版本。如果您使用的是版本 6,请使用 arduino ide 中的库管理器将其回滚到版本 5,这就是 firebase 客户端正在寻找的版本。
它不是因为发现了多个库而出错,因为 Arduino 只是要为你挑选一个它是由于与 arduino json 和 firebase 客户端库的版本不匹配而出错的
我正在尝试建立 NodeMCU v3 与 Google Firebase 的连接。但是我遇到了多个库错误。我已经确定草图文件夹中没有库。我只使用添加 .ZIP 选项安装它们。
这是我的代码:
#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
// Set these to run example.
#define FIREBASE_HOST "example.firebaseio.com"
#define FIREBASE_AUTH "token_or_secret"
//Change line with your WiFi router name and password
#define WIFI_SSID "SSID"
#define WIFI_PASSWORD "PASSWORD"
void setup() {
Serial.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);
}
int n = 0;
void loop() {
// set value
Firebase.setFloat("number", 42.0);
// handle error
if (Firebase.failed()) {
Serial.print("setting /number failed:");
Serial.println(Firebase.error());
return;
}
delay(1000);
// update value
Firebase.setFloat("number", 43.0);
// handle error
if (Firebase.failed()) {
Serial.print("setting /number failed:");
Serial.println(Firebase.error());
return;
}
delay(1000);
// get value
Serial.print("number: ");
Serial.println(Firebase.getFloat("number"));
delay(1000);
// remove value
Firebase.remove("number");
delay(1000);
// set string value
Firebase.setString("message", "hello world");
// handle error
if (Firebase.failed()) {
Serial.print("setting /message failed:");
Serial.println(Firebase.error());
return;
}
delay(1000);
// set bool value
Firebase.setBool("truth", false);
// handle error
if (Firebase.failed()) {
Serial.print("setting /truth failed:");
Serial.println(Firebase.error());
return;
}
delay(1000);
// append a new value to /logs
String name = Firebase.pushInt("logs", n++);
// handle error
if (Firebase.failed()) {
Serial.print("pushing /logs failed:");
Serial.println(Firebase.error());
return;
}
Serial.print("pushed: /logs/");
Serial.println(name);
delay(1000);
}
根据 IDE 的错误日志是:
In file included from C:\Users\Raffay Sajjad\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:30:0,
from C:\Users\Raffay Sajjad\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22,
from C:\Users\Raffay Sajjad\Documents\Arduino\WiFi_Connection\WiFi_Connection.ino:2:
C:\Users\Raffay Sajjad\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseObject.h:109:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
std::shared_ptr<StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>> buffer_;
^
In file included from C:\Users\Raffay Sajjad\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22:0,
from C:\Users\Raffay Sajjad\Documents\Arduino\WiFi_Connection\WiFi_Connection.ino:2:
C:\Users\Raffay Sajjad\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:86:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
std::shared_ptr<StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>> buffer_;
^
Multiple libraries were found for "ESP8266WiFi.h"
Used: C:\Users\Raffay
Multiple libraries were found for "FirebaseArduino.h"
Used: C:\Users\Raffay
Multiple libraries were found for "ArduinoJson.h"
Used: C:\Users\Raffay
Multiple libraries were found for "ESP8266HTTPClient.h"
Used: C:\Users\Raffay
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
任何人都可以对此提供见解吗?
检查您使用的是哪个 arduino json 版本。如果您使用的是版本 6,请使用 arduino ide 中的库管理器将其回滚到版本 5,这就是 firebase 客户端正在寻找的版本。
它不是因为发现了多个库而出错,因为 Arduino 只是要为你挑选一个它是由于与 arduino json 和 firebase 客户端库的版本不匹配而出错的