由于控制台显示设置/number失败,因此无法将NodeMCU与Firebase连接:每次 [英] Unable to connect NodeMCU with Firebase as console shows setting /number failed: each time

查看:100
本文介绍了由于控制台显示设置/number失败,因此无法将NodeMCU与Firebase连接:每次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于控制台显示设置/number失败,因此无法将NodeMCU与Firebase连接:每次 在Firebase上也没有更新.

Unable to connect NodeMCU with Firebase as console shows setting /number failed: each time No updation on firebase as well.

还是应该更改云服务器?

or should I change the cloud server?

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

    // Set these to run example.
    #define FIREBASE_HOST "example.firebaseio.com"
    #define FIREBASE_AUTH "token_or_secret"
    #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);
    }

推荐答案

Firebase Arduino库具有对Firebase SSL证书指纹的引用.该指纹可能与当前指纹不匹配.

The Firebase Arduino library has a reference to a fingerprint of the Firebase SSL certificate. This fingerprint may not match the current fingerprint.

此指纹在FirebaseHttpClient.h中(通常在C:\Users\<User>\Documents\Arduino\libraries\firebase-arduino-<version>\src\FirebaseHttpClient.h中).

This fingerprint is in FirebaseHttpClient.h (typically in C:\Users\<User>\Documents\Arduino\libraries\firebase-arduino-<version>\src\FirebaseHttpClient.h).

要查找并更改当前指纹,请执行以下操作:

To find and change the current fingerprint:

  1. 转到 https://www.grc.com/fingerprints.htm
  2. 输入"test.firebaseio.com"
  3. 记录指纹(例如,当前为03:D6:42:23:03:D1:0C:06:73:F7:E2:BD:29:47:13:C3:22:71:37:1B
  4. 打开C:\Users\<User>\Documents\Arduino\libraries\firebase-arduino-<version>\src\FirebaseHttpClient.h
  5. 用指纹替换kFirebaseFingerprint的值(不带冒号)
  6. 重新编译
  1. Go to https://www.grc.com/fingerprints.htm
  2. Enter "test.firebaseio.com"
  3. Record the fingerprint (e.g. it is currently 03:D6:42:23:03:D1:0C:06:73:F7:E2:BD:29:47:13:C3:22:71:37:1B
  4. OpenC:\Users\<User>\Documents\Arduino\libraries\firebase-arduino-<version>\src\FirebaseHttpClient.h
  5. Replace value of kFirebaseFingerprint with the fingerprint (without colons)
  6. Recompile

例如以下指纹在此时间点有效:

e.g. the following fingerprint works at this point of time:

static const char kFirebaseFingerprint[] =
  "03 D6 42 23 03 D1 0C 06 73 F7 E2 BD 29 47 13 C3 22 71 37 1B";

请参见 https://github.com/FirebaseExtended/firebase-arduino/issues/328

这篇关于由于控制台显示设置/number失败,因此无法将NodeMCU与Firebase连接:每次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆