Setup Arduino Mega 2560 and Ethernet Shield R3

I have seen a lot of topics that is relevant to this one. However, I can’t find any info on how to connect the Mega2560 with the Ethernet Shield R3. I checked this link (http://mcukits.com/2009/04/06/arduino-ethernet-shield-mega-hack) but I think the info here is incompatible with the boards I have.

I would like if someone has some info on how to connect these two together, to share please with me.

Much appreciated!

The ethernet shield R3 has some extra pins but should connect fine. There are two pins on each side of the ethernet shield R3 towards the usb/ethernet connector. Insure they do not interfere with the Mega by bending them slightly away from the board if necessary.

The SPI data lines are on the ICSP connector on the bottom of the shield. Insure it is lined up and connected correctly onto the ICSP pins, and all should work ok. I use a Mega2560 with the ethernet shield R2.

Maybe happens to know which pins exactly those are? Also, do I need to change anything on the Ethernet library?

Thanks

The pic is here: http://arduino.cc/en/Main/ArduinoEthernetShield The R3 has two extra pins on each side compared to the "standard" ethernet shield pic below that. The top extra pins are labelled scl and sda, and the bottom pins are labelled ioref and no label.

No mods to the library. The w5100 slave select is still D10.

Thanks for the clarification.

I excluded the pins you suggested from connecting with the Mega board, and I tried the following examples (from Arduino IDE 1.0.4):

DHCPAddressPrinter - that works and gives me the local IP

and

WebClient (with my MAC address) - that it doesn't work (connection failed).

I tried a few more examples and all failed to give me a connection. Is there possibly something wrong with this configuration?

I use my own code. It is in the playground. There is a GET and POST method examples there. You must either use dhcp or insure your static network settings are correct. http://playground.arduino.cc/Code/WebClient You might need to use a bit from one and a bit from the other. You can use dhcp for either if you want.

Do you have a uSD card in the shield's slot?

Ok, here are the results:

The first code (GET) does not work (failed). The second example (POST), works, spits out HTML data, however in the beginning of each connection is shows the following, and I am concerned with the “HTTP/1.1 404 Not Found”:

Starting ethernet…10.0.1.15
Ready
connecting…connected
HTTP/1.1 404 Not Found
Date: Fri, 04 Oct 2013 12:59:57 GMT
Content-Type: text/html
Content-Length: 9489
Connection: close
Server: Apache
X-Frame-Options: SAMEORIGIN
Vary: Accept-Encoding

Also, another strange issue is that when I try the following code example from zoomcat, it works fine, although I have no clue why!!!

I am not using any SD card.

//zoomkat 9-22-12
//simple client test
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
char serverName[] = "web.comporium.net"; // zoomkat's test web page server
EthernetClient client;

void setup(){
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    while(true);
  }
  Serial.begin(9600); 
  Serial.println("Better client test 9/22/12"); // so I can keep track of what is loaded
  Serial.println("Send an e in serial monitor to test"); // what to do to test
}

void loop(){
  // check for serial input
  if (Serial.available() > 0) //if something in serial buffer
  {
    byte inChar; // sets inChar as a byte
    inChar = Serial.read(); //gets byte from buffer
    if(inChar == 'e') // checks to see byte is an e
    {
      sendGET(); // call sendGET function below when byte is an e
    }
  }  
} 

void sendGET() //client function to send/receive GET request data.
{
  if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
    Serial.println("connected");
    client.println("GET /~shb/arduino.txt HTTP/1.0"); //download text
    client.println("Host: web.comporium.net");
    client.println(); //end of get request
  } 
  else {
    Serial.println("connection failed"); //error message if no client connect
    Serial.println();
  }

  while(client.connected() && !client.available()) delay(1); //waits for data
  while (client.connected() || client.available()) { //connected or data available
    char c = client.read(); //gets byte from ethernet buffer
    Serial.print(c); //prints byte to serial monitor 
  }

  Serial.println();
  Serial.println("disconnecting.");
  Serial.println("==================");
  Serial.println();
  client.stop(); //stop client
}