Resolve the given hostname to an IP address
WiFi.hostByName(hostname, result)
…
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass);
delay(10000);
}
Serial.println("Connected to WiFi");
printWifiStatus();
Serial.println("\nStarting connection to server...");
IPAddress result;
int err = WiFi.hostByName(server, result) ;
if(err == 1){
Serial.print("IP address: ");
Serial.println(result);
} else {
Serial.print("Error code: ");
Serial.println(err);
}
…