Go Down

Topic: Wifi Shield Connects, but no functionality (Read 745 times) previous topic - next topic

drwalker

Just hooked up a Wifi Shield (R3) to an UNO (R3) and did't have much luck with any of the sample code.  I can connect to my network and see:

Attempting to connect to SSID: MyNetwork
Connected to wifi
SSID: MyNetwork
IP Address: 192.168.0.199
signal strength (RSSI):-27 dBm

But then, when attempting to contact a server (www.google.com) I get:

Starting connection to server...

disconnecting from server.

This is just the example code from: http://arduino.cc/en/Tutorial/WiFiWebClient

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?

pylon

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

Code: [Select]
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");
}

Chr1s

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!

drwalker

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.

Thanks for the help.

ƎR

i think we have the same problem, have you solved?
Riccardo Ertolupi of the Vicenza Thunders Team: http://www.VicenzaThunders.com

ƎR

i've just tried and using the 1.0.3 version the problem is solved :D
Riccardo Ertolupi of the Vicenza Thunders Team: http://www.VicenzaThunders.com

ƎR

anyway i just discovered that you have to upgrade the firmware of the wifi shield if you want to use it with the 1.0.5 IDE... do you agree?
Riccardo Ertolupi of the Vicenza Thunders Team: http://www.VicenzaThunders.com

Go Up