Ethernet Shield W5100 don't working

Greetings!
I’ve recently got Etherned Shield W5100 which I immediately attached to Arduino Mega.
I’ve tried out various sketches but when I try to connect to the server’s IP, I get this error:
ERR_CONNECTION_REFUSED (my PC and ethernet are working in the same local network), and my router
is Dlink-Dir 300. On the Ethernet pay a 511 resistor is solder next to the LAN socket.


Instead 510 resistor. I suppose that this might cause the problem? Or does the Dlink
router itself cause the issue? Also the 6th contact ISC closes on the case of the SD card.
I am wauting for your help in launching the pay. Sorry for my bad english.

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

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

EthernetServer server(80);

void setup() {
 // Open serial communications and wait for port to open:
 Serial.begin(9600);
 
// start the Ethernet connection and the server:
 Ethernet.begin(mac, ip);
 server.begin();
 Serial.print("server is at ");
 Serial.println(Ethernet.localIP());
}

void loop() {
 // listen for incoming clients
 EthernetClient client = server.available();
 if (client) {
 Serial.println("new client");
 // an http request ends with a blank line
 boolean currentLineIsBlank = true;
 while (client.connected()) {
 if (client.available()) {
 char c = client.read();
 Serial.write©;
 // 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("Connection: close"); // the connection will be closed after completion of the response
 client.println("Refresh: 5"); // refresh the page automatically every 5 sec
 client.println();
 client.println("<!DOCTYPE HTML>");
 client.println("<html>");
 // output the value of each analog input pin
 for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
 int sensorReading = analogRead(analogChannel);
 client.print("analog input ");
 client.print(analogChannel);
 client.print(" is ");
 client.print(sensorReading);
 client.println("
");
 }
 client.println("</html>");
 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();
 Serial.println("client disconnected");
 }
}

I have a W5100 shield and it is 511.

It works.

ieee488, I don't know what magic you have going on, but it is a serious problem: http://forum.arduino.cc/index.php?topic=385960.0

Koepel: ieee488, I don't know what magic you have going on, but it is a serious problem: http://forum.arduino.cc/index.php?topic=385960.0

I don't know. It works for me. I tried just the WebServer example sketch. Have not touched it since.

Just as a follow up here, 511 resistor is wrong and comes in some chinese clones, 510 or 49R9 (51 ohm or 49,9 ohh) are fine. But some chinese manufacturers mistook the reading and used the "511" resistor block (10 times what it should be). I have one with 511 resistor. It works fine at my house (home dsl router) but doesn't work at the office at all. There are now many posts at other forums about same issues, 511 resistor MAY work fine depdnding on your router/switch but its random. 49 or 51 ohm resistors (49R9 / 510) should be fine on ANY network. Check with your provider, when you are about to purchase a clon board, that it doesn't come with the 511 resistor array

Good luck!