Error de DNS ESP32 #101
Replies: 2 comments
-
The issue is not related to the server and network. The TCP session was kept alive to avoid SSL/TLS handshake every time to send new HTTP request. In your case the server session was timed out and it closes the connection. This session timed out issue also posted in https://github.com/espressif/arduino-esp32, see issue #9924. You have to manually call |
Beta Was this translation helpful? Give feedback.
-
Instead of manually stop the SSL Client, you can update the library to v1.2.16 which will limit the session timeout to avoid this |
Beta Was this translation helpful? Give feedback.
-
Hello, for projects that require constantly connecting to fire, based on my perspective, I recommend setting a static configuration of IP, subnet, and DNS.
This is good because my project consists of constantly being on fire base to upload and read data, using the examples I modified so that they work in the long term but I was warned of a DNS error in a certain time apx between 10 minutes and 60 minutes, which I did was loading a static configuration.
debug:
[674304][E][NetworkManager.cpp:130] hostByName(): DNS Failed for 'xxxxxxx-default-rtdb.firebaseio.com' with error '-54'
[679319][I][ssl_client.cpp:129] start_ssl_client(): select returned due to timeout 5000 ms for fd 48
[679329][I][NetworkClientSecure.cpp:153] connect(): Actual TLS start postponed.
[679336][E][NetworkClientSecure.cpp:159] connect(): start_ssl_client: connect failed: -1
[679344][D][HTTPClient.cpp:1083] connect(): failed connect to xxxxxxx-default-rtdb.firebaseio.com:443
[679353][W][HTTPClient.cpp:1399] returnError(): error(-1): connection refused
[679361][E][NetworkClient.cpp:315] setSocketOption(): fail on 0, errno: 9, "Bad file number"
Error en la solicitud HTTP: -1
[679369][E][NetworkClient.cpp:315] setSocketOption(): fail on 0, errno: 9, "Bad file number"
[679380][D][HTTPClient.cpp:379] disconnect(): tcp is closed
Add this to my code:
my complete example code:
Beta Was this translation helpful? Give feedback.
All reactions