Ethernet Sheild Failing? Do I need a new one?

Hello,

I am using an Arduino Uno R3 with an Ethernet Shield 2. I have used the Arduino recently on its own with no problem (uploading simple sketches, etc.). I have a power supply and the USB plugged into the Arduino and the Shield's Ethernet plug's lights display. Everything looks fine.

While trying to set up a simple web server (the one in Programming Arduino Getting Started With Sketches) I noticed that I received no response. Nil. Nada. Nothing.

I began troubleshooting and found some threads on this forum for troubleshooting. From one of the threads, I uploaded the following test sketch to my Arduino:

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

byte mac[] = {0x90,0xA2,0xDA,0x10,0x03,0x22};
IPAddress ip(192,168,2,2);

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

  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  Ethernet.begin(mac,ip);

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

void loop() {
  // put your main code here, to run repeatedly:

}

This gave me the unfortunate result of 0.216.216.216. The universal test sketch "DHCPAddressPrinter" returns NOTHING on the serial monitor. I waited for 5 minutes and nothing whatsoever displayed.

It seems like almost anything involving Ethernet.begin() results in no response. Poke poke. Is it dead? Since it at least responds, i.e., when it printed the bizarre IP above, I'm guessing that I set up the mac address correctly. Everything else on the Arduino seems to function fine. In case this makes any difference, I'm running the Arduino IDE v1.6.5 on Win7.

Is my Ethernet shield a goner? Do I need to get a new one? Or is there anything else I can try?

Thank you!

You probably need to use a different ethernet library. Your shield probably has a W5500 ethernet IC on it. Is this the shield?

Thanks for the response!

Yes, that is the shield, non-POE version.

I did see a reference to an Ethernet_v2.h (or something similar) library somewhere. Do I maybe need to switch to that?

You have a choice. You can download and import a new library, or use the IDE from arduino.org. Note that is arduino.org, not arduino.cc.

If you want to use a different library with your IDE, then this library should work for you. You must check the Ethernet.h file and insure you have selected the correct define for the w5500.

Thank you again! And thanks for the education! I was not aware of Arduino.org versis Arduino.cc. For some reason that hasn't come up in the books I've read so far. Perhaps I need to read more books?

In any case, I will probably try both options out of curiosity. It sounds like one of these should work.

I'll post back what I find out.

Thank you again, I appreciate it!

The first option, uploading the WIZ_Ethernet library seems to have worked perfectly. The test script I posted before now returns 192.168.2.2 and the DhcpAddressPrinter displays an actual IP address. I then tried the "Simple Server" example and now see what I'm supposed to see.

In between tries, I also disconnected and reconnected the Ethernet Shield. Before, it was making a low whirring noise, but when I reconnected it the noise stopped. I wonder if I also had some kind of shaky connection before?

In either case, the Ethernet Shield seems okay now. Thanks for your help!