I have tried most of the other examples and I can always connect, but then I can't get any of the other functionality to work (client, server, etc.). I've updated the firmware but get the same result. Any ideas how I can debug this? Is it something with my home network settings?
Looks like you have either a missing DNS or gateway in your setup.
WiFi.gatewayIP() gives you the IP of the gateway, which should be the same as the router's IP in most setups.
You might also split up the client.connect() call into
IPAddress remote_addr;
if (WiFi.hostByName(server, remote_addr)){
if (client.connect(remote_addr, 80)) {
// rest of the code
}
} else {
Serial.println("Couldn't resolve hostname");
}
I had the exact same issue and after three days looking for a solution I was starting to run in circles... until I noticed a comment on a post in the forums. Try to downgrade your IDE from 1.0.5 to 1.0.3. It fixed the issues with the WiFi Shield on the Arduino UNO for me. Hope this helps!
Pylon: Tried your suggestions and had no luck. I also tried hard coding the IP for google to confirm it wasn't a DNS problem and used WiFi.gatewayIP() to confirm that I had the correct gateway.
I then tried to use WiFi.Config to manually set my IP, DNS, and gateway. I could connect to WiFi, but it wouldn't use the IP I put into WiFI.Config and instead was still being assigned an IP from my DHCP range.
I will try downgrading my IDE as Chr1s suggested when I'm home later tonight to see if that solves the problem.