Having trouble making a W5200 Ethernet Shield work

I am having trouble getting an Ethernet shield to work. I am using the following hardware:

Arduino UNO R3

W5200 Ethernet Shield, V2.2 02-28-2014, (12A14), by Sneeed Studio

I am using the following software:

Arduino IDE Ver: 1.8.16

Ethernet Lib ver:2.0.0

My sketch is as follows:

/*

Web Server Client

Arduino 1.0 Version

*/

#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, 212}; // IP Address ip (192, 168, 1, 212)

byte server[] = {209, 85, 229, 104 }; // Goggle

EthernetClient client;

void setup()

{

Serial.begin(9600); // start serial lib.

Ethernet.begin(mac, ip);

delay(1000);

Serial.println("connecting");

Serial.print("The gateway IP address is: ");

Serial.println(Ethernet.gatewayIP());

if (client.connect(server, 80)) {

Serial.println("connected");

client.println("GET /search?q=arduino HTTP/1.0"); // the http request

client.println();

}

else {

Serial.println("connection failed");

}

}

void loop()

{

if (client.available()) {

char c = client.read();

Serial.print(c); // echo all data

}

if (!client.connected()) {

Serial.println();

Serial.println("disconnecting");

client.stop();

for (;:wink:

;

}

}

The sketch verifies and compiles correctly and when uploaded to the UNO the red LED (D2) comes on when a Cat.5 cable is plugged into the Shield. The green speed LED on the Cat.5 jack comes on and the yellow activity LED is blinking.

The output on the Serial Monitor is:

connecting

The gateway IP address is: 0.0.0.0

connection failed

disconnecting

However; when I look at the Network Device Summary on my router, I don’t see the IP address (192.168.1.212).

I’ve changed the Cat.5 cable, switch port, powered the UNO via the USB as well as with external power, pushed the reset buttons (on both the UNO and the Ethernet Shield) and I changed to a second W5200 Shield.

HELP!

try first the WebClient example from the Ethernet library examples

JA
I tried the following from the Ethernet begin example with the same result I still can not see the address on my LAN

DocHill

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

// the media access control (ethernet hardware) address for the shield:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
//the IP address for the shield:
byte ip[] = { 192,168, 1, 212 };

void setup()
{
Ethernet.begin(mac, ip);
}

void loop () {}

the WebClient example has enhanced diagnostics

JA,

I tried the following Sketch and the Serial monitor returned the "Ethernet shield was not found." message.
Do I need to do anything special to attach the shield to the UNO?

DocHill

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

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

void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Ethernet.init(10); // use pin 10 for Ethernet CS
Ethernet.begin(mac, ip);

if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet shield was not found.");
}
else if (Ethernet.hardwareStatus() == EthernetW5100) {
Serial.println("W5100 Ethernet controller detected.");
}
else if (Ethernet.hardwareStatus() == EthernetW5200) {
Serial.println("W5200 Ethernet controller detected.");
}
else if (Ethernet.hardwareStatus() == EthernetW5500) {
Serial.println("W5500 Ethernet controller detected.");
}
}

void loop () {}

if you inserted SD card, remove it

No SD Card. I tried it with a Leonardo with the same results. I am going to buy a W5500 tomorrow. I tried the EthernetrV2.h from Seeed with no improvement.

DocHill

has the shield good contact? are the pins fully inserted. most important the 2x3 SPI header

Yes. Both the UNO and both the Ethernet Shields are new. Where exactly is the WebClient example you wrote of (URL?). I tried this one (https://www.arduino.cc/en/Tutorial/LibraryExamples/WebClient#code) and it had a couple issues with the verify/compile.

DocHill

in IDE Examples menu for Ethernet

JA,

I found the examples in the IDE. Thank you. I compiled it and uploaded it and got the following:

Initialize Ethernet with DHCP:
Failed to configure Ethernet using DHCP
Ethernet shield was not found.  Sorry, can't run without hardware. :(

All the pins are well seated and I have tried two different Arduinos ansd two different shields.

Same as before. I was reading some notes about the Seeed Studio W5200 and saw there is a 'bug'. could it be I have one (actually two) defective units? The 'fix' was as follows:

The Ethernet Shield V2.0 has a bug which makes Ethernet Shield V2.0 work not normally. We made this 	processing for this problem: Break the connect between the 74VHC125PW 2pin and W5200 45pin: 	WPDN.

Does this sound possible??

DocHill

Ethernet shield V1 has the same problem.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.