Are you using IDE v1.0.5? Have you upgraded the firmware in your shield? Try this sketch to check your shield and firmware.
The firmware version should show 1.1.0. I set the serial baud to 9600, but I use 115200 here.
#include <WiFi.h>
// change to your WPA2 settings
char ssid[] = "mynetwork"; // the name of your network
char pass[] = "mypassphrase"; // your network password
int status = WL_IDLE_STATUS; // the Wifi radio's status
void setup() {
Serial.begin(9600);
// disable SD SPI
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println(F("WiFi shield not present"));
// don't continue:
while(true);
}
// check firmware version
Serial.print(F("Firmware version: "));
Serial.println(WiFi.firmwareVersion());
// attempt to connect to Wifi network:
while ( status != WL_CONNECTED) {
Serial.print(F("Attempting to connect to SSID: "));
Serial.println(ssid);
status = WiFi.begin(ssid,pass);
// wait 10 seconds for connection:
delay(10000);
}
// you're connected now, so print out the data:
Serial.print(F("You're connected to the network"));
printCurrentNet();
printWifiData();
}
void loop() {
}
void printCurrentNet() {
// print the SSID of the network you're attached to:
Serial.print(F("SSID: "));
Serial.println(WiFi.SSID());
// print the MAC address of the router you're attached to:
byte bssid[6];
WiFi.BSSID(bssid);
Serial.print(F("BSSID: "));
Serial.print(bssid[5],HEX);
Serial.print(F(":"));
Serial.print(bssid[4],HEX);
Serial.print(F(":"));
Serial.print(bssid[3],HEX);
Serial.print(F(":"));
Serial.print(bssid[2],HEX);
Serial.print(F(":"));
Serial.print(bssid[1],HEX);
Serial.print(F(":"));
Serial.println(bssid[0],HEX);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print(F("signal strength (RSSI):"));
Serial.println(rssi);
// print the encryption type:
byte encryption = WiFi.encryptionType();
Serial.print(F("Encryption Type:"));
Serial.println(encryption,HEX);
}
void printWifiData() {
// print your WiFi shield's IP address:
IPAddress ip = WiFi.localIP();
Serial.print(F("IP Address: "));
Serial.println(ip);
Serial.println(ip);
// print your MAC address:
byte mac[6];
WiFi.macAddress(mac);
Serial.print(F("MAC address: "));
Serial.print(mac[5],HEX);
Serial.print(F(":"));
Serial.print(mac[4],HEX);
Serial.print(F(":"));
Serial.print(mac[3],HEX);
Serial.print(F(":"));
Serial.print(mac[2],HEX);
Serial.print(F(":"));
Serial.print(mac[1],HEX);
Serial.print(F(":"));
Serial.println(mac[0],HEX);
// print your subnet mask:
IPAddress subnet = WiFi.subnetMask();
Serial.print(F("NetMask: "));
Serial.println(subnet);
// print your gateway address:
IPAddress gateway = WiFi.gatewayIP();
Serial.print(F("Gateway: "));
Serial.println(gateway);
}