Ethernet shield - can't connect at all - ARP

I'm trying my new Ethernet shield, but I can't connect at all.

I'm using the Webserver example of the Arduino 0013 environment, and when I try to connect from a local machine, I see in wireshark that the arp broadcast ("who has this IP") is not answered. This is confirmed by:

$ ip neigh
192.168.0.77 dev eth1 FAILED
[... other machines ...]

Of course, under these conditions the browser doesn't get any answer when trying to connect to http://192.168.0.77/. The yellow lamp on the Ethernet shield blinks three times (for the three arp requests), but that's all. Trying the first time after resetting or trying several times makes no difference.

What's going on? Is there a bug in the ethernet library? Or am I missing something?

This is my code, straight from the example of the 0013 environment:

#include <Ethernet.h>
// Ethernet MAC-Address and IP parameters
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = {192, 168, 0, 77};
byte gateway[] = {192, 168, 0, 1};
byte netmask[] = {255, 255, 255, 0};
// Webserver on port 80
Server server = Server(80);

void setup() {
//Set up Ethernet
Ethernet.begin(mac, ip); //, gateway, netmask);
// start listening for clients
server.begin();
}

void loop() {
Client client = server.available();
if (client) {
// an http request ends with a blank line
boolean current_line_is_blank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
// if we've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so we can send a reply
if (c == '\n' && current_line_is_blank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();

// output the value of each analog input pin
for (int i = 0; i < 6; i++) {
client.print("analog input ");
client.print(i);
client.print(" is ");
client.print(analogRead(i));
client.println("
");
}
break;
}
if (c == '\n') {
// we're starting a new line
current_line_is_blank = true;
} else if (c != '\r') {
// we've gotten a character on the current line
current_line_is_blank = false;
}
}
}
// give the web browser time to receive the data
delay(1);
client.stop();
}
}

Ok, maybe I know why.

I'm using this http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=1&products_id=4
board, which works with Microchip's ENC28J60 SPI ethernet controller.

This may not be the same one the standard library requires. This supplier delivers a library "with" the product (via weblinks), so I'll try that one out. Supposedly this will solve the problem.

These things were not immediately obvious to me because the Arduino library page speaks of "The" ethernet shield, which suggests that there is only one type. Or maybe I just missed some information.

Yes, that will be the issue. There is the official Arduino Ethernet shield. And other Ethernet shields that are for the Arduino--the word order is important. :slight_smile:

The official Ethernet library only supports boards based on the same WizNET chip as the official Arduino Ethernet shield.

--Phil.