FirebaseExtended / firebase-arduino

Arduino samples for Firebase.
Apache License 2.0
943 stars 494 forks source link

ESP8266 D1 mini pro not connecting to firebase! #478

Open SmartTVVN opened 4 years ago

SmartTVVN commented 4 years ago

hello everyone, my code cannot connect to firebase. i used library : "https://github.com/FirebaseExtended/firebase-arduino" i tried to change fingerprint:

"B6 F5 80 C8 B1 DA 61 C1 07 9D 80 42 D8 A9 1F AF 9F C8 96 7D"

"6F D0 9A 52 C0 E9 E4 CD A0 D3 02 A4 B7 A1 92 38 2D CA 2F 26"

"E2 34 53 7A 1E D9 7D B8 C5 02 36 0D B2 77 9E 5E 0F 32 71 17"

but still same, cannot connect to firabase.

Everyone's who can help me how to fix this issue. thanks !

This my code:

include

include

define FIREBASE_HOST "**.firebaseio.com"

define FIREBASE_AUTH "2MxjeR1XV*****tlvMWXTfdOv"

define WIFI_SSID "****"

define WIFI_PASSWORD "**"

String fireStatus = ""; int led = 14; void setup() { Serial.begin(9600); delay(1000); pinMode(LED_BUILTIN, OUTPUT); pinMode(led, OUTPUT); WiFi.begin(WIFI_SSID, WIFI_PASSWORD); Serial.print("waitting..."); Serial.print(WIFI_SSID); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.println(); Serial.print("connect to "); Serial.println(WIFI_SSID); Serial.print("IP : "); Serial.println(WiFi.localIP()); Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); Firebase.setString("LED_STATUS", "OFF"); } void loop() { Firebase.setString("STATUS","TEST 11"); fireStatus = Firebase.getString("LED_11"); if (fireStatus == "ON" || fireStatus == "on") {
Serial.println("LED SANG"); digitalWrite(LED_BUILTIN, LOW); digitalWrite(led, HIGH); } else if (fireStatus == "OFF" || fireStatus == "off") {
Serial.println("LED TAT"); digitalWrite(LED_BUILTIN, HIGH); digitalWrite(led, LOW); } else { Serial.println("Cannot conect"); } }

adityamangal1998 commented 4 years ago

I am getting same issue ,my code with d1 mini was woking properly but from 24-feb or 25-feb,it is not connected with firebase.

tinoschroeter commented 4 years ago

google has changed there certificate in february

this Line will fix it:

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

~Arduino/libraries/firebase-arduino-master/src/FirebaseHttpClient.h

adityamangal1998 commented 4 years ago

Now It is working ,Thanks @tinoschroeter

SmartTVVN commented 4 years ago

thanks @tinoschroeter, it mean kFirebaseFingerprint is not static, sometimes change ?

tinoschroeter commented 4 years ago

@SmartTVVN yes, this will change after google set up a new certificate for this host... now its valid until: Feb 18 19:36:06 2021 GMT

you can check this by using openssl (HOSTNAME is your project name) echo | openssl s_client -showcerts -servername HOSTNAME.firebaseio.com -connect HOSTNAME.firebaseio.com:443 2>/dev/null | openssl x509 -inform pem -noout -text

or find the fingerprint: openssl s_client -connect HOSTNAME.firebaseio.com:443 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin

SmartTVVN commented 4 years ago

@tinoschroeter thanks

bbeletti commented 3 years ago

@SmartTVVN yes, this will change after google set up a new certificate for this host... now its valid until: Feb 18 19:36:06 2021 GMT

you can check this by using openssl (HOSTNAME is your project name) echo | openssl s_client -showcerts -servername HOSTNAME.firebaseio.com -connect HOSTNAME.firebaseio.com:443 2>/dev/null | openssl x509 -inform pem -noout -text

or find the fingerprint: openssl s_client -connect HOSTNAME.firebaseio.com:443 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin

Hello, the password has already changed, I do not understand the process to obtain the new password and I cannot find it anywhere

bbeletti commented 3 years ago

https://www.grc.com/fingerprints.htm