Arduino Ethernet shield doesn't gain IP

Hi there

Yesterday, I bought an Arduino Ethernet Shield with W5200 chip.

http://www.elecrow.com/wiki/index.php?title=Ehternet_Shield

It comes with its own ethernet library that extends the standard ethernet library that is shipped with the IDE. However, using their own library made no difference than using the standard one, both don't work.

I've tried to search for a MAC address stuck on the packet but I haven't find one. So, I assume it is one of the old shields that we give them a random MAC address.

My local network IP address is 192.168.1.0, when I give the shield the IP 192.168.1.177 (which is a unique address), still no thing happens. The only thing that happens that the Serial Monitor display "Server is at 0.0.0.0", only.

When I write the IP in the browser, just it doesn't exist

I'm using the WebServer example, however, it doesn't seem to be working

Any help ?

This is from the page you posted the link to above.

If you can't run the the Ethernet. please connect the PWDN pin to GND and have a try again.

Look at the component diagram on that page to find that pin.

Well, that schematic is different from the real board. There is no pins on the shield.

I've just noticed that the shield I have has a W5100 chip but the local seller's website just posted that the shield is provided with W5200 chip !

It is just the same as the one in this link

Then use the standard ethernet library. If you are not using IDE v1.0.5, I recommend getting that version.

Then compile and upload this test code. Don’t change anything. Insure the ethernet shield is firmly seated into the Arduino, especially the ICSP pins. If it does not show 192.168.2.2 on the serial monitor, you have a problem with the SPI bus or the w5100.

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

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,2,2);

void setup() {
  Serial.begin(9600);

  // disable SD card if one in the slot
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  Serial.println("Starting w5100");
  Ethernet.begin(mac,ip);

  Serial.println(Ethernet.localIP());
}

void loop() {
}

Starting w5100
0.0.0.0

:~

I used a multimeter's buzzer to check if all the ICSP connection are good, one pin is not properly connected.

Can I connect the SPI lines externly from pins 50,51 and 52 (Arduino Mega) ?

The newer ethernet shields use only the ICSP pins for the SPI data bus. D11-D13 aren't connected to anything on the ethernet shield. If you jumper the SPI lines from the Mega, it must be to the ICSP pins on the ethernet shield.

Ok, after properly attaching the ICSP pins, it worked :sweat_smile:

Thank you a lot

Although it gained its IP address, the browser is unable to connect to it !

The browser identified the shield only when I changed the default gatway of the local network between the PC and the shield to the IP address of the shield … but I don’t understand why ?

the picture is attached

Capture.JPG

You need to have a server sketch uploaded to connect to it with a web browser. Here are two server sketches. Insure you are using the correct network settings.
http://playground.arduino.cc/Code/WebServerST
The second one at the bottom of that page is the easiest.

Here is a client sketch if you want to try it also.
http://playground.arduino.cc/Code/WebClient