Bad Ethernet Shield? Cannot Get IP Address Loaded

I have a Mega 2560 R3, with this Ethernet shield on top:

https://www.amazon.com/gp/product/B00HG82V1A

I’m trying this basic code:

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

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,0,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() {
}

And get this in the Serial Monitor:

Starting w5100
0.0.0.0

I’ve looked over the Ethernet shield, and there doesn’t appear to be any bad solder joints. The 6 center ICSP pins appear to be fully engaged as well.

When I plug an Ethernet cable into the jack, the link light illuminates, full duplex illuminates, etc … the TX/RX lights flash, etc …

It appears everything is working, but I can’t get an IP Address to take.

Is there something unique I need to do for the Mega 2560R3 board? Or maybe I received a defective board?

You might use the forum search function to search for "ethernet mega" to see if there are things unique to the mega.

zoomkat:
You might use the forum search function to search for "ethernet mega" to see if there are things unique to the mega.

Ya, I did that, but didn't find anything of help.

I understand there are different revisions of Ethernet shields though. This one is W5100, so the Ethernet.h library should work.

But then I read comments about earlier boards needing pins bent/redirected, but I'm not sure if that applies to my setup.

I figured it out. one of the ICSP female pins, inside the Shield's connector, is apparently shorter than the others. When I checked for continuity between the solder points on the Mega and the shield (with the shield installed), one of them was bad. I simply cut a small piece of solid core jumper wire and put it into the female end, and then reconnected.

Continuity is now good, and it's working as expected.