Ethernet dosn't connect :-(

Can somebody give i a clue why it can’t connect to a server?
best regards

This is my output, and futher down is my code:
connection failed


#include <SPI.h>
#include <Ethernet.h>

// Array to hold the number a SMS is retreived from
char senderNumber[20];
byte mac = { 0x90, 0xA2, 0xDA, 0x0F, 0x38, 0xBC }; //define the ethershields mac address.
//Ethernet options

// if you don’t want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(74,125,232,128); // numeric IP for Google (no DNS)
char server = “”; // name address for Google (using DNS)

// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192,168,0,177);

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup()
// initialize serial communications and wait for port to open:
// connection state
boolean notConnected = true;

if (Ethernet.begin(mac) == 0) {
Serial.println(“Failed to configure Ethernet using DHCP”);
// no point in carrying on, so do nothing forevermore:
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip);

// give the Ethernet shield a second to initialize:

void recivestr(){
Serial.println(client.connect(server, 80));
if (client.connect(“”, 80)) {
// Make a HTTP request:
client.println(“GET /index.php”); //GET /search?q=arduino HTTP/1.1
client.println(“Connection: close”);
else {
// kf you didn’t get a connection to the server:
Serial.println(“connection failed”);

void loop()



Simple test code to see if you can connect to the server.

//zoomkat 9-22-12
//simple client test
//for use with IDE 1.0.1
//with DNS, DHCP, and Host
//open serial monitor and send an e to test
//for use with W5100 based ethernet shields
//remove SD card if inserted

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address

char serverName[] = ""; // zoomkat's test web page server
EthernetClient client;


void setup(){

  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:

  Serial.println("Better client test 9/22/12"); // so I can keep track of what is loaded
  Serial.println("Send an e in serial monitor to test"); // what to do to test

void loop(){
  // check for serial input
  if (Serial.available() > 0) //if something in serial buffer
    byte inChar; // sets inChar as a byte
    inChar =; //gets byte from buffer
    if(inChar == 'e') // checks to see byte is an e
      sendGET(); // call sendGET function below when byte is an e


void sendGET() //client function to send/receive GET request data.
  if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
    client.println("GET /~shb/arduino.txt HTTP/1.1"); //download text
    client.println("Connection: close");  //close 1.1 persistent connection  
    client.println(); //end of get request
  else {
    Serial.println("connection failed"); //error message if no client connect

  while(client.connected() && !client.available()) delay(1); //waits for data
  while (client.connected() || client.available()) { //connected or data available
    char c =; //gets byte from ethernet buffer
    Serial.print(c); //prints byte to serial monitor 

  client.stop(); //stop client


I suggest you don't hard-code the local IP address in your sketch, and instead let your sketch assign it by DHCP. Firstly, your hard-coded value may be wrong, secondly DHCP will also tell you where your local DNS server is and without that you probably won't be able to resolve domain names. Since you're identify the server by its domain name, that would prevent your sketch from working.

char server[] = "";    // name address for Google (using DNS)

Bullshit. That is no where near google's name.