FirebaseExtended / firebase-arduino

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

DNS Failed for xxxxxxxx.firebaseio.com #414

Open marius240 opened 5 years ago

marius240 commented 5 years ago

I get a very weird error,

it works if i do this:

void loop() {

  Firebase.setString("lul","lul");

}

But if i just do:

void loop() { 
  Firebase.setString("lul","lul");
   esp_sleep_enable_timer_wakeup(1000000);
   esp_deep_sleep_start();
}

i get the error(in serial monitor with debug level = debug): DNS Failed for a-green-home.firebaseio.com and then

[E][WiFiClientSecure.cpp:118] connect(): start_ssl_client: -1 [D][HTTPClient.cpp:970] connect(): failed connect to a-green-home.firebaseio.com:443 [W][HTTPClient.cpp:1262] returnError(): error(-1): connection refused [W][HTTPClient.cpp:1262] returnError(): error(-4): not connected

marius240 commented 5 years ago

did mean to close it ): still need help

marius240 commented 5 years ago

dindt*

kiralikbeyin commented 5 years ago

https://github.com/FirebaseExtended/firebase-arduino/commit/cd5681f59cabdb31c2c50c55a5abc53af78a3280

marius240 commented 5 years ago

What is that supposed to mean

kiralikbeyin commented 5 years ago

Your fingerprint is incorrect , download latest commit

  "E2 34 53 7A 1E D9 7D B8 C5 02 36 0D B2 77 9E 5E 0F 32 71 17"; // 2019
marius240 commented 5 years ago

If the fingerprint is wrong why does it work when I put it in loop?

kiralikbeyin commented 5 years ago

error(-1): connection refused is simply fingerprint error but

Try to unplug your esp usb arter ever upload Try to adı delay(1000) at the end of your setup Run your loop in

if (Firebase.available()) {
... your code
}
marius240 commented 5 years ago

Firebase.available() isnt a function,

get error: class FirebaseESP32 has no member named "available"

kiralikbeyin commented 5 years ago

This lib is for esp8266

marius240 commented 5 years ago

Rip, I'm using ioxhops for esp32

marius240 commented 5 years ago

W][HTTPClient.cpp:152] beginInternal(): unexpected protocol: https, expected http 13:31:19.746 -> [D][HTTPClient.cpp:181] beginInternal(): host: a-green-home.firebaseio.com port: 443 url: /lul.json?auth=ju3ijoii8592309efiweoi33b3 13:31:20.028 -> [I][ssl_client.cpp:121] start_ssl_client(): WARNING: Use certificates for a more secure communication! 13:31:20.028 -> [E][ssl_client.cpp:33] handle_error(): UNKNOWN ERROR CODE (004E) 13:31:20.028 -> [E][ssl_client.cpp:35] handle_error(): MbedTLS message code: -78 13:31:20.028 -> [E][WiFiClientSecure.cpp:109] connect(): start_ssl_client: -78 13:31:20.028 -> [D][HTTPClient.cpp:846] connect(): failed connect to a-green-home.firebaseio.com:443 13:31:20.028 -> [W][HTTPClient.cpp:1124] returnError(): error(-1): connection refused 13:31:20.028 -> [W][HTTPClient.cpp:1124] returnError(): error(-4): not connected

mobizt commented 5 years ago

@marius240 for ESP32 which you are using libary that uses WiFiClientSecure library.

One reason for error is low memory for MbedTLS to making SSL handshake. Check your free heap, it should be more than 50 - 100 K.

Another reason is bugs in WiFiClientSecure library.

When I create my own Firebase library for ESP32 using WiFiClientSecure library for SSL WiFi connection, it turns out that device is failed to make SSL connection after 3-5 minutes since success connection.

You can try my stable Firebase client library for ESP32 https://github.com/mobizt/Firebase-ESP32

marius240 commented 5 years ago

Does your library auto opdate fingerprints?

mobizt commented 5 years ago

@marius240 By default, my library doesn't required or used fingerprint which is the main purpose of my library which will not rely on server's fingerprint. For more secure connection, you can provide root certificate string to Firebase.begin. Usage example

marius240 commented 5 years ago

Ok cool, I'll check it out

marius240 commented 5 years ago

@mobizt i just tryed printing my free heap, and its about 104k, so im a bit confused

mobizt commented 5 years ago

It may used by libraries you included and global variables.

Do you still get connection refused error for 100k memory?

marius240 commented 5 years ago

ye,