firebase.setstring()不起作用(ESP8266 WiFi模块)
我是一个初学者,我试图使用ESP8266 WiFi模块从Firebase发送和接收数据,但是它似乎不起作用,也没有返回任何错误,请解决此问题,
这是我的代码:
#include <SoftwareSerial.h>
#include <FirebaseArduino.h>
#include <ArduinoJson.h>
#include <ESP8266HTTPClient.h>
// Set these to run example.
#define FIREBASE_HOST "esp8266-d2343-default-rtdb.firebaseio.com"
#define FIREBASE_AUTH "THE_API_KEY_OF_MY_DATABASE"
#define WIFI_SSID "Lenovo Tab 3211"
#define WIFI_PASSWORD "MY_WIFI_PASSWORD"
void setup()
{
Serial.begin(9600);
delay(1000);
pinMode(led, OUTPUT);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to ");
Serial.print(WIFI_SSID);
while (WiFi.status() != WL_CONNECTED)
{
Serial.print(".");
delay(500);
}
Serial.println();
Serial.print("Connected to ");
Serial.println(WIFI_SSID);
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Firebase.setString("LED_STATUS", "OFF");
}
void loop(){
Serial.println(Firebase.getString("LED_STATUS))l
}
不是一个问题,如果 void loop()代码中有任何错误,我只是将其键入一个例子,但是请让我知道,如果您在代码中找到其他任何内容,
我也已将FirebaseFingerprint更新到此:
cf:6c:f8:33:a3:fb:42:4a:49:0a:e7:72:72:24:53:1a:11:a2:a2:c1:34:0d // 2022-april
我没有找到比这个更新的东西
I'm a beginner and I was trying to send and receive data from firebase by using the esp8266 wifi module, but it didn't seem to work, nor did it return any error, please solve this issue
This is my code :
#include <SoftwareSerial.h>
#include <FirebaseArduino.h>
#include <ArduinoJson.h>
#include <ESP8266HTTPClient.h>
// Set these to run example.
#define FIREBASE_HOST "esp8266-d2343-default-rtdb.firebaseio.com"
#define FIREBASE_AUTH "THE_API_KEY_OF_MY_DATABASE"
#define WIFI_SSID "Lenovo Tab 3211"
#define WIFI_PASSWORD "MY_WIFI_PASSWORD"
void setup()
{
Serial.begin(9600);
delay(1000);
pinMode(led, OUTPUT);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to ");
Serial.print(WIFI_SSID);
while (WiFi.status() != WL_CONNECTED)
{
Serial.print(".");
delay(500);
}
Serial.println();
Serial.print("Connected to ");
Serial.println(WIFI_SSID);
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Firebase.setString("LED_STATUS", "OFF");
}
void loop(){
Serial.println(Firebase.getString("LED_STATUS))l
}
It's not a problem if there's anything wrong in the void loop() code, I just typed it as an example,but please let me know if you find anything else in the code
I have also update the FirebaseFingerPrint to this :
CF:6C:F8:33:A3:FB:42:4A:49:0A:E7:72:24:53:1A:11:A2:C1:34:0D // 2022-APRIL
I didn't find anything newer than this one
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
FirebaseFingerprint
刚刚更新到以下内容:5A:80:FB:80:F8:CD:DF:B4:C0:22:15:C6:42:DF:88:9A:9A:F3:C9:39:39:75 < /em>
因此,我只需要在
firebasehttpclient.h
文件中更改它,然后开始工作The
FirebaseFingerPrint
just updated to this :5A:80:FB:80:F8:CD:DF:B4:C0:22:15:C6:42:DF:88:9A:F3:C9:39:75
So, I just needed to change it in the
FirebaseHttpClient.h
file and it started to work