WiFi.hostByName resolves to 255.255.255.255 when should return error #7945
-
Hi. I'm having issues with WiFi.hostByName. The function used internally is dns_gethostbyname. Can someone else makes some test to figure out is this is an actual issue or is something particularly of my own code. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
if (!ip)
Serial.println("address not found"); Unfortunately v2.7.4 (latest release) |
Beta Was this translation helpful? Give feedback.
255.255.255.255
isINADDR_NONE
.In current git version, the resulting IP can be tested with
.isSet()
which tests if IP address is neither0.0.0.0
or255.255.255.255
.The
bool()
operator uses::isSet()
so you can do that:Unfortunately v2.7.4 (latest release)
::isSet()
does not check forNONE
.v3.0 of this core will be out soon, in the meantime you can use git master, or the "stage" version if you are using PlatformIO, or an unofficial snapshot release for the arduino IDE board manager.