To connect to my WiFi I must use this code:
Serial.println(WiFi.status());
WiFi.begin(ssid, password);
while (WiFi.status() != WL_DISCONNECTED)
{
delay(200);
Serial.print(".");
}
Not that WL_DISCONNECTED is used rather than WL_CONNECTED.
The Serial.print before the WiFi.begin shows 3 which I understand to be WL_CONNECTED.
What's going on??