Mega2560 can't find Ethernet shield V1

I get this message "Failed to configure Ethernet using DHCP
Ethernet shield was not found. Sorry, can't run without hardware. :frowning:
"
It looks like others have this problem, too. Should I buy Ethernet Shield V2 or what.
RJ49 connector has yellow and green led on. RX led flashes regularly and 100M, Link, and FullD leds are always on.
Edit: It looks like Mega has SPI on the end of the board and the Ethernet shield is so short it has no pins there. Is that the reason for troubles.

It very much looks like the Ethernet shield is too short for Mega2560. It works with Duemilanove.

No
Ethernet SHOULD get its SPI via the 6-pin ICSP cluster, thereby making it compatible with both Uno and Mega. IF your your shield has that cluster, you need to look elsewhere for the problem. It may have something to do with the library or your code, which is currently a secret.

I see no way in that shield to connect to the 6 pin connector. But the SPI bus is connected to 11-14 pins.

I have a Mega connected with an ethernet shield on this project.

You havent shown your code so I wonder if this could be the problem:

Note: Arduino communicates with both the W5100 and SD card on the Ethernet shield using the SPI bus (through the ICSP header). This is on digital pins 10, 11, 12, and 13 on the Uno and pins 50, 51, and 52 on the Mega. On both boards, pin 10 is used to select the W5100 and pin 4 for the SD card. These pins cannot be used for general I/O. On the Mega, the hardware SS pin, 53, is not used to select either the W5100 or the SD card, but it must be kept as an output or the SPI interface won't work.

There is nothing special in my code. Edit: SPI is used via those 10-14 pins. Address for the browser is 192.168.1.177 and not 192, 168, 1, 177
Later I will add some code for serial bus. But this code tells the difference between Mega and smaller boards, and Eth shield V1 and V2.

/*
  Web Server

 A simple web server that shows the value of the analog input pins.
 using an Arduino Wiznet Ethernet shield.

 Circuit:
 * Ethernet shield attached to pins 10, 11, 12, 13
 * Analog inputs attached to pins A0 through A5 (optional)

 created 18 Dec 2009
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe
 modified 02 Sept 2015
 by Arturo Guadalupi
 
 */

#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
};
IPAddress ip(192, 168, 1, 177);

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);

void setup() {
  // You can use Ethernet.init(pin) to configure the CS pin
  //Ethernet.init(10);  // Most Arduino shields
  //Ethernet.init(5);   // MKR ETH shield
  //Ethernet.init(0);   // Teensy 2.0
  //Ethernet.init(20);  // Teensy++ 2.0
  //Ethernet.init(15);  // ESP8266 with Adafruit Featherwing Ethernet
  //Ethernet.init(33);  // ESP32 with Adafruit Featherwing Ethernet

  // 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
  }
  Serial.println("Ethernet WebServer Example");

  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);

  // Check for Ethernet hardware present
  if (Ethernet.hardwareStatus() == EthernetNoHardware) {
    Serial.println("Ethernet shield was not found.  Sorry, can't run without hardware. :(");
    while (true) {
      delay(1); // do nothing, no point running without Ethernet hardware
    }
  }
  if (Ethernet.linkStatus() == LinkOFF) {
    Serial.println("Ethernet cable is not connected.");
  }

  // start the server
  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(c);
        // 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
//             client.println("<br >");
            client.print("yufgygyunput ");
           
            client.println("<br />");
       
          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");
  }
}

johnerrington In your link you have used Mega and Ethernet shield V1. Then you have to wire the SPI bus yourself, or use a smaller AVR board like I did. I would prefer Mega2560, so I'll probably buy an EthV2 shield. This is mentioned also in Eth shield V2 page in compatibility part. I didn't notice it at first my self and besides I have Version 1. Noticing that compatibility issue would have saved one evenings work for me.

If this is true, I guess your board is very old and made for Uno only. My board has no version on it, is about twelve years old, and those pins are just pass-through. This has been common practice ever since I have had an Arduino.

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