Hello
First of all thanks to Rui & Sara for this great project
My goal is to build an Webserver and connect to external SQl database to query some data.
Basically I´m using “wi-fi manager for webserver” project
My problem i´m getting error”[ 2774][E][WiFiGeneric.cpp:1360] hostByName(): DNS Failed for xxxx.com
[HTTP] GET… failed, error: connection refused
If i run the standalone code bellow it´s connect to sql database without any problem
HTTPClient http;
http.begin(queryString); //HTTP
int httpCode = http.GET();
// httpCode will be negative on error
if(httpCode > 0) {
// file found at server
if(httpCode == HTTP_CODE_OK) {
String payload = http.getString();
Serial.println(payload);
} else {
// HTTP header has been send and Server response header has been handled
Serial.printf(“[HTTP] GET… code: %d\n”, httpCode);
}
} else {
Serial.printf(“[HTTP] GET… failed, error: %s\n”, http.errorToString(httpCode).c_str());
}
http.end();
when i put the same code inside my project i got error
[ 2774][E][WiFiGeneric.cpp:1360] hostByName(): DNS Failed for xxxx.com)
I think it´s some imcompatibility with other libraries.
Does anybody have any experience with this error?
Best regards
João Rodrigues
Hi.
I’m not familiar with that issue.
However, I found this discussion that seems similar to yours.
https://stackoverflow.com/questions/68508224/getting-ewifigeneric-cpp739-hostbyname-dns-failed-when-performing-post-r
They provide some solutions. See if it applies to your case scenario.
Regards,
Sara