arduino wiznet w5100 ethernet shield problem

Hi guys i'm new in this. I have a ardiuno duemilanove and an ethernet shield w5100.
I can't get it work with my ardiuno . I can't ping the device i try to many times .
Help me.

This is the code i'm using.
/*
Web Server

A simple web server that shows the value of the analog input pins.
using an Arduino Wiznet Ethernet shield.

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

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1, 177 };

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
Server server(80);

void setup()
{
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);
server.begin();
}

void loop()
{
// listen for incoming clients
Client client = server.available();
if (client) {
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
// if you've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so you can send a reply
if (c == '\n' && currentLineIsBlank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();

// output the value of each analog input pin
for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
client.print("analog input ");
client.print(analogChannel);
client.print(" is ");
client.print(analogRead(analogChannel));
client.println("
");
}
break;
}
if (c == '\n') {
// you're starting a new line
currentLineIsBlank = true;
}
else if (c != '\r') {
// you've gotten a character on the current line
currentLineIsBlank = false;
}
}
}
// give the web browser time to receive the data
delay(1);
// close the connection:
client.stop();
}
}

What is the ip and subnet of the computer that you are using for the ping attempt?

IP:192.168.1.184
Subnet mask: 255.255.255.0

I have both my pc and ardiuno in the same range

i also have enc28j60 ethernet shield and works perfect. Maybe is library problem with w5100. I use ardiuno 0022 software

Simple server code. If the arduino is connected to a router, then it may need to be specified as the gateway.

//zoomkat 12-18-10
//routerbot code
//for use with IDE 0021
//open serial monitor to see what the arduino receives
//use the \ slash to escape the " in the html 
//address will look like http://192.168.1.102:84/ when submited
//for use with W5100 based ethernet shields

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

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
Server server(84); //server port

String readString; 

//////////////////////

void setup(){

  pinMode(4, OUTPUT); //pin selected to control
  //start Ethernet
  Ethernet.begin(mac, ip, gateway, subnet);
  server.begin();

  //enable serial data print 
  Serial.begin(9600); 
  Serial.println("servertest1"); // so I can keep track of what is loaded
}

void loop(){
  // Create a client connection
  Client client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();

        //read char by char HTTP request
        if (readString.length() < 100) {

          //store characters to string 
          readString += c; 
          //Serial.print(c);
        } 

        //if HTTP request has ended
        if (c == '\n') {

          ///////////////
          Serial.println(readString);

          //now output HTML data header

          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();

          client.println("<HTML>");
          client.println("<HEAD>");
          client.println("<TITLE>Arduino GET test page</TITLE>");
          client.println("</HEAD>");
          client.println("<BODY>");

          client.println("<H1>HTML form GET example</H1>");

          client.println("<FORM ACTION=\"http://192.168.1.102:84\" method=get >");

          client.println("Pin 4 \"on\" or \"off\": <INPUT TYPE=TEXT NAME=\"LED\" VALUE=\"\" SIZE=\"25\" MAXLENGTH=\"50\">
");

          client.println("<INPUT TYPE=SUBMIT NAME=\"submit\" VALUE=\"Change Pin 4!\">");

          client.println("</FORM>");

          client.println("
");

          client.println("</BODY>");
          client.println("</HTML>");

          delay(1);
          //stopping client
          client.stop();

          /////////////////////
          if(readString.indexOf("on") >0)//checks for on
          {
            digitalWrite(4, HIGH);    // set pin 4 high
            Serial.println("Led On");
          }
          if(readString.indexOf("off") >0)//checks for off
          {
            digitalWrite(4, LOW);    // set pin 4 low
            Serial.println("Led Off");
          }
          //clearing string for next read
          readString="";

        }
      }
    }
  }
}

I try it but without success. I cant get it ping.
??

You probably need to detail your lan setup. If you try code that is not changed to match your lan, it probably won't work.

what can i try else?? :cold_sweat:

You can try this. Compile and upload. Open the serial window and wait for "Tick Tick Tick".
Wait a few seconds, then try to ping 192.168.1.2

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

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x59, 0x66 };  
byte ip[] = { 192, 168, 1, 2 };    
byte gateway[] = { 192, 168, 1, 1 };
byte subnet[] = { 255, 255, 255, 0 };

void setup()
{
  Serial.begin(9600);
  Ethernet.begin(mac, ip, gateway, subnet);
  delay(1000);
}

void loop()
{
  Serial.println("Tick");
  delay(1000);
}

Then try to ping 192.168.1.1, just as a test. Does it respond?

Same problem.??

OK, tick is working, so it is not locking up. That is a good thing.

What is the router ip address for your localnet? Can you ping the router from the computer?
Is your router IP 192.168.1.157?

im in a domain network
yes i can ping router
router ip : 192.168.1.157 / 192.168.1.134

Your subnet is 255.255.255.0 on that network?
Have you tried a cable change?
Are both the computer and Arduino connected to the same port on the router? Like a switch? Or different ports?

yes my subnet is 255.255.255.0
yes i changed the cable and the pc, i even connected to the same switch. but is the same problem

i use the same configuration for enc28j60 ethernet shield and works fine

Let's see if the Arduino is actually talking to the shield. Compile and upload the following code. Open the serial window.
The first line of the serial responses should be the ip address you assigned to the shield.

#include <SPI.h>
#include <Ethernet.h>
#include <utility/w5100.h>

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x59, 0x66 };  
byte ip[] = { 192, 168, 1, 7 };    
byte gateway[] = { 192, 168, 1, 157 };
byte subnet[] = { 255, 255, 255, 0 };

byte ipBuf[4];
char outBuf[18];

void setup()
{
  Serial.begin(9600);
  Ethernet.begin(mac, ip, gateway, subnet);
  delay(1000);
  W5100.getIPAddress(ipBuf);
  sprintf(outBuf,"%u.%u.%u.%u\r\n",ipBuf[0],ipBuf[1],ipBuf[2],ipBuf[3]);
  Serial.write(outBuf);
}

void loop()
{
  Serial.println("Tick");
  delay(1000);
}

No i dont get the ip from theserial responses

That looks like a bad ethernet shield. I bet you get the same response running that with the shield removed.

Yes i get the same respone even the ethernet cable is unpluget.
Maybe is hardware prolem ?

Yes i get the same respone even the ethernet cable is unpluget.

I mean the same response with the ethernet shield unplugged, not connected to the Arduino. Like on your bench a good distance away.

Yes with ethernet shiled unplugged not connected whith the Arduino.

And the other ethernet shield works on the same Arduino? Dead shield.