Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Connection with firebase 2/27/2020 #476

Closed
Hasan-75 opened this issue Feb 27, 2020 · 36 comments
Closed

Connection with firebase 2/27/2020 #476

Hasan-75 opened this issue Feb 27, 2020 · 36 comments

Comments

@Hasan-75
Copy link

Unable to connect my ESP8266 to firebase realtime database. But till yesterday the system was working fine

@bonz82
Copy link

bonz82 commented Feb 27, 2020

I have the same problem

@johnSU17
Copy link

Me,too.

@ucar19
Copy link

ucar19 commented Feb 27, 2020

I have same problem too. What happen could be?

@hugolimachaves
Copy link

hugolimachaves commented Feb 27, 2020

Be aware that Firebase's fingerprint has changed again...
Acordding to https://www.grc.com/fingerprints.htm, the current fingerprint is: 03:D6:42:23:03:D1:0C:06:73:F7:E2:BD:29:47:13:C3:22:71:37:1B
More details about this issue, please reffer to: #437

@ucar19
Copy link

ucar19 commented Feb 27, 2020

@hugolimachaves thank you. It works

@danilomna
Copy link

Hi,
Please clarify something to me, what happens with all products on fields that are using this library with old fingerprint?

@ucar19
Copy link

ucar19 commented Feb 29, 2020

@danilomna They can't connect your firebase account. You must update them.

@danilomna
Copy link

@ucar19 then this is a terrible issue for a commercial IoT device. Let's say that have thousands and thousands sold and installed in customers house, would be a nightmare.
How to workaround this and fix it for good?

@ucar19
Copy link

ucar19 commented Feb 29, 2020

@danilomna You had to set update system (OTA). After set you can update when you need.

@Hasan-75
Copy link
Author

Be aware that Firebase's fingerprint has changed again...
Acordding to https://www.grc.com/fingerprints.htm, the current fingerprint is: 03:D6:42:23:03:D1:0C:06:73:F7:E2:BD:29:47:13:C3:22:71:37:1B
More details about this issue, please reffer to: #437

Works. Thanks a lot

@Decezaris
Copy link

Guys, who wants to get the right fingerprint, you need to go in this website [https://www.grc.com/fingerprints.htm] and type the url database from your (or any) project (it is the same code for all).

@danilomna
Copy link

Guys, who wants to get the right fingerprint, you need to go in this website [https://www.grc.com/fingerprints.htm] and type the url database from your (or any) project (it is the same code for all).

@Decezaris that was I´m afraid off, so doesn´t matter the project url fingerprint is always same code to any project. That is pretty bad to IoT devices in field that were programmed with previous fingerprint and will stop working.
Are there any way to not use the fingerprint while working with firebase realtime database??

@danilomna
Copy link

@danilomna They can't connect your firebase account. You must update them.

@ucar19, that would be a lot of work, and anyway will cause IoT devices stop working for a while.
Are there any way to not use the fingerprint while working with firebase realtime database??

@danilomna
Copy link

Guys,

Problems solved!!! Forget about firebase fingetprint changes forever!!!

Use this and only this library avaliable on arduino library manager: Firebase ESP8266 Client.

An amazing project from @mobizt

https://github.com/mobizt/Firebase-ESP8266

@HusseinSR
Copy link

HusseinSR commented Feb 29, 2020

Guys,

Problems solved!!! Forget about firebase fingetprint changes forever!!!

Use this and only this library avaliable on arduino library manager: Firebase ESP8266 Client.

An amazing project from @mobizt

https://github.com/mobizt/Firebase-ESP8266

but the fingerprint still in firebase-arduino-master library

@danilomna
Copy link

Guys,
Problems solved!!! Forget about firebase fingetprint changes forever!!!
Use this and only this library avaliable on arduino library manager: Firebase ESP8266 Client.
An amazing project from @mobizt
https://github.com/mobizt/Firebase-ESP8266

but the fingerprint still in firebase-arduino-master library

Hi, I asked @mobizt about this here:

https://github.com/mobizt/Firebase-ESP8266/issues/88#issuecomment-592960574

And you can see it confirmed is not fingerprint dependent that for him is unacceptable, because this he designed this library, take a look there.

@HusseinSR
Copy link

Guys,
Problems solved!!! Forget about firebase fingetprint changes forever!!!
Use this and only this library avaliable on arduino library manager: Firebase ESP8266 Client.
An amazing project from @mobizt
https://github.com/mobizt/Firebase-ESP8266

but the fingerprint still in firebase-arduino-master library

Hi, I asked @mobizt about this here:

mobizt/Firebase-ESP8266#88 (comment)

And you can see it confirmed is not fingerprint dependent that for him is unacceptable, because this he designed this library, take a look there.

many thanks for your clarify, it mean that fire base not stop work with this library even using firebase-arduino library?

@mobizt
Copy link

mobizt commented Mar 1, 2020

@HusseinSR
This is not a Firebase problem. The problem is the HTTP client library which this library used for server connection.

It uses a hard-coded fingerprint to compare with server (Firebase) fingerprint before sending any request if they do not match, the connection was canceled.

The fingerprint is the unique identifier of the server's certificate. If the SSL certificate of the server (Firebase for this case) has been renewed or replaced due to expired, the fingerprint of that certificate will be changed too.

Read this issue.

@danilomna
Copy link

@HusseinSR
This is not a Firebase problem. The problem is the HTTP client library which this library used for server connection.

It uses a hard-coded fingerprint to compare with server (Firebase) fingerprint before sending any request if they do not match, the connection was canceled.

The fingerprint is the unique identifier of the server's certificate. If the SSL certificate of the server (Firebase for this case) has been renewed or replaced due to expired, the fingerprint of that certificate will be changed too.

Read this issue.

@mobizt what everybody wants to heard from you is you confirming using your library "Firebase ESP8266 Client" in the IoT device it will not stop working anymore when fingerprint change in future. Could you kindly confirm that?

@mobizt
Copy link

mobizt commented Mar 1, 2020

@danilomna

My library works in different approaches to communicate with Firebase.
The fingerprint is not related to my library in any way because my library doesn't use a fingerprint to work.

The fingerprint is not secure and not recommended.
I don't want to promote my library here unless to explain fingerprint usage.

@yhua537
Copy link

yhua537 commented Mar 1, 2020

I am a bit disappointed that this library is not moving forward at all for past 12 months.

You can change in your arduino core library to disable the verification, but this is not recommended.

I did some work and attempt to improve this last year by checking the root certificate, which it is not suppose to be change frequently and you will have to past in few more parameters to reduce memory usage, I suppose (not verified) it is similar to @mobizt 's solution . Haven't got much time doing it lately but if anyone wants to test/improve from here, I am happy anyone wants it. it is not very stable as the memory would be running out from time to time. The fork is under https://github.com/yhua537/firebase-arduino. I am using this with arduino core 2.5.0, earlier version doesn't work as the memory issue.

Will check out @mobizt 's solution when I have time.

@mobizt
Copy link

mobizt commented Mar 1, 2020

@yhua537
My library was written from scratch.
It has almost different API and functions and not a solution to this library because it's not compatible.

User needs to learn before use.

@yhua537
Copy link

yhua537 commented Mar 1, 2020

@mobizt

Yes, notice that. but your approach on using root cert is very similar, but you are using axtls but mine is forcing to use BearSSL.

@mobizt
Copy link

mobizt commented Mar 1, 2020

@yhua537
No, my library supports BearSSL by default. The axTLS will use in my library if ESP8266 Arduino Core SDK v 2.4.x and lower was installed.

Don't conclude about my library If you don't test it.

@yhua537
Copy link

yhua537 commented Mar 1, 2020

@mobizt
Right, I am only guessing with 5 minute of checking your library. I will stop my guessing and will try yours when I have time. Interested to find out how you make it work with limited memory and cpu power.

Mine has all kind of problem that the current main fork has, but workable for me since June last year. Putting it out there and hoping someone can improve.

@mobizt
Copy link

mobizt commented Mar 1, 2020

@yhua537 I investigate your library and found you use token that you named refresh token instead of database secret which differs from the original one.

If you want to create the custom token for Firebase authentication, jwt is the better way. The mbedTLS (ported to ESP32) has a tool to encrypt this token.

@HusseinSR
Copy link

@HusseinSR
This is not a Firebase problem. The problem is the HTTP client library which this library used for server connection.

It uses a hard-coded fingerprint to compare with server (Firebase) fingerprint before sending any request if they do not match, the connection was canceled.

The fingerprint is the unique identifier of the server's certificate. If the SSL certificate of the server (Firebase for this case) has been renewed or replaced due to expired, the fingerprint of that certificate will be changed too.

Read this issue.

the first
i edit the file WiFiClientSecureAxTLS.cpp line 723 to
bool WiFiClientSecure::verify(const char* fp, const char* domain_name)
{
return true; //<--- here
but is not work

the second

i try to use your library in my project without change of the structure of firebase code but is get
wrong message (no matching function for call to 'FirebaseESP8266::setInt(const char [3], int)

what is code in your library to get or set value for this examble
Firebase.setInt("S1",0);
Firebase.getString("S2").toInt();
regards

@mobizt
Copy link

mobizt commented Mar 1, 2020

@HusseinSR
I already said my library API and functions are almost different.
You can read the readme doc or try the examples first.

@yhua537
Copy link

yhua537 commented Mar 1, 2020

@mobizt
yep, i am not using the database secret as that stops me from using different password for each device.

I would love to get JWT working with Json/flutter, but with my current setup with ESP8266, it is limiting me from taking on more libraries. Yes, that may kill my setup and force me to move to ESP32 in near future as I am not mentally ready to throw away my 12 ESP-01 yet.

@BaraiSimal
Copy link

Changing fingerprint worked for me

@danilomna
Copy link

Changing fingerprint worked for me

We know if changes will work, but that is not the point, we dont want to be fingerprint dependant anymore. Because this @mobizt is very interesting.

@HusseinSR
Copy link

@HusseinSR
I already said my library API and functions are almost different.
You can read the readme doc or try the examples first.

yes i understood that, but excuse me i still beginner my i build my project IOT since one year ago, and it was working with old library by read/update values by using simple structure as mention above
i try the examples but can not find some thing match to rebuild my project
can you help me by simple code for on/off led for example by Firebase
many thanks for assistance

@HusseinSR
Copy link

Changing fingerprint worked for me

We know if changes will work, but that is not the point, we dont want to be fingerprint dependant anymore. Because this @mobizt is very interesting.

can you help me by simple code for on/off led for example by new Firebase i using simple android app created by MIT inventor to do that bey old Firebase library

@mobizt
Copy link

mobizt commented Mar 1, 2020

@HusseinSR
This is the simple working example to control the LED in realtime.

For your simple needs.


//Declare the FirebaseData object for data sending and receiving operation
FirebaseData firebaseData;

void setup()
{

  if (!Firebase.setInt(firebaseData, "S1", 0)) {
    //Error?
    Serial.println(firebaseData.errorReason());
  }


  if (!Firebase.getInt(firebaseData, "S2")) {
    //Error?
    Serial.println(firebaseData.errorReason());
  }

  //read the int data from firebaseData object after call getInt
  int myInt = firebaseData.intData();

}

@HusseinSR
Copy link

@HusseinSR
This is the simple working example to control the LED in realtime.

For your simple needs.


//Declare the FirebaseData object for data sending and receiving operation
FirebaseData firebaseData;

void setup()
{

  if (!Firebase.setInt(firebaseData, "S1", 0)) {
    //Error?
    Serial.println(firebaseData.errorReason());
  }


  if (!Firebase.getInt(firebaseData, "S2")) {
    //Error?
    Serial.println(firebaseData.errorReason());
  }

  //read the int data from firebaseData object after call getInt
  int myInt = firebaseData.intData();

}

many many thanks, now it is match with my project and working ..... :) :)

@adelinasimanjuntak
Copy link

Hi, I'm using ESP8266 and have just updated my firebase fingerprint but the esp still not connecting to the firebase. Any idea? I'm very new to this. tx

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests