Ethernet Shield troubles

I use BoArduino for my Arduino work because I prefer breadboards. I do however have a WickedProto Shield adapter for the odd occasion I want to play with "standard" Arduino shields, and it has always worked great in the past. Last weekend I picked up an Ethernet Shield from Radio Shack (want to support their new Arduino efforts) and I'm having zero luck getting it going.

Running the DHCP Chat Server example sketch in Arduino 1.0, the serial monitor shows it waiting indefinitely for a DHCP address (network is tested and valid). If I comment out the DHCP initialization and use static parameters, Ethernet.localIP() always returns 0.0.0.0.

Any ideas?

ethtest2.ino (1.95 KB)

Below is some ethernet test code that you can try. Youmay need to change the assigned lan ip to match your setup.

//zoomkat 12-08-11
//simple client test
//for use with IDE 1.0
//open serial monitor and send an e to test
//for use with W5100 based ethernet shields

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

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // ip in lan assigned to arduino
//byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
//byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
byte myserver[] = { 208, 104, 2, 86 }; // zoomkat web page server IP address
//Client client(myserver, 80);  // connect to web server using port 80
EthernetClient client;
//////////////////////

void setup(){

  Ethernet.begin(mac, ip);
  //Ethernet.begin(mac, ip, gateway, subnet);
  Serial.begin(9600); 
  Serial.println("Better client test 12/01/11"); // 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(myserver, 80)) {  //starts client connection, checks for connection
    Serial.println("connected");
    client.println("GET /~shb/arduino.txt HTTP/1.0"); //download text
    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

}

Better client test 12/01/11
Send an e in serial monitor to test
connection failed

disconnecting.

Which is as expected as Ethernet.begin is failing to initiate the shield. This is why Ethernet.localIP is returning 0.0.0.0 in my code. Now the question is, is this because the Ethernet Shield is somehow incompatible with BoArduino or is this shield defective...

Don't know if this is significant but the W5100 chip gets pretty warm on my Ethernet Shield.

The w5100 does run on the hot side, apparently normal.

No other ideas, I take it...

I've now tested this thing on multiple networks and even tried crossover cables direct to my laptop. Even sniffed the traffic and absolutely nothing comes out of the Ethernet Shield when attempting DHCP so I'm thinking its a bum unit. Guess I'll swap it out at RS.

Even sniffed the traffic and absolutely nothing comes out of the Ethernet Shield when attempting DHCP so I'm thinking its a bum unit.

Is your UNO recognized when it is plugged into a router? When I run the code my netgear router provides the IP and I can see the wiznet in the connected devices.

I'm not using an UNO, but no the Ethernet Shield is never seen by the network and does not appear in the ARP table. Using code which would initiate a DHCP request hangs at Ethernet.begin(mac) indefinitely. Statically assigned IP via Ethernet.begin(mac, ip, gateway, subnet) does complete but Ethernet.localIP() always returns 0.0.0.0 and the Shield still never appears in ARP.

I use BoArduino for my Arduino work because I prefer breadboards. I do however have a WickedProto Shield adapter for the odd occasion I want to play with "standard" Arduino shields, and it has always worked great in the past.

After rereading the above, I suspect that is where your problem is and not the ethernet shield from RS.

As Arduino is Open Source Hardware, that would be unfortunate, if true.

As Arduino is Open Source Hardware, that would be unfortunate, if true.

If it is true, and I would tend to agree that it possibly is, all that it means is that the problem is with your "Arduino", not with the Rat Shack shield.

You would then need to look more closely at your hardware.

While I'm new to this forum, and it's easy to assume the newbie doesn't know much, I can assure you this isn't my first time around the workbench. Even won some design awards many moons ago in Nuts and Volts...

I was hoping someone had some advice on validating proper Ethernet Shield operation at the SPI level as the Arduino Ethernet library, even in 1.0, does a very poor job of providing feedback on what's happening inside the w5100. This may be beyond the scope of the regulars here though, I'm guessing. I'll pop over to adafruit's board and see if anyone there has messed with the 'duino Ethernet Shield.

Thanks for trying.

This may be beyond the scope of the regulars here though, I'm guessing.

Actually not. SurferTim has delved into the mysteries of the ethernet shield as much as anyone, and uncovered and corrected a few insidious bugs.

Just to close out this thread - SurferTim did indeed point out the key fact I kept overlooking:

Arduino communicates with both the W5100 and SD card using the SPI bus (through the ICSP header).

Running jumpers from pin 11 on the protoboard to ICSP pin 4, 12 to ICSP 1 and pin 13 to ICSP 3 has the board working as expected.

So, anyone using arduino clones that don't have an ICSP header should note the Ethernet Shield does not have the standard SPI pins (11-13) wired.

...and the Mega owners should take note also. Since pins 11-13 are not wired, they are available for general use without interfering with the ethernet shield. The Mega does not use those pins for SPI. :slight_smile:

I've now tested this thing on multiple networks and even tried crossover cables direct to my laptop. Even sniffed the traffic and absolutely nothing comes out of the Ethernet Shield when attempting DHCP so I'm thinking its a bum unit. Guess I'll swap it out at RS.

So is the ethernet shield going back to radio shack? The below may explain the 0.0.0.0 issue using the 1.0 IDE.

zoomkat:
So is the ethernet shield going back to radio shack? The below may explain the 0.0.0.0 issue using the 1.0 IDE.

Arduino Ethernet Shield (W5100) Cannot Access Outside Network - #21 by system - Networking, Protocols, and Devices - Arduino Forum

Nope. Works fine now that I grokked that the Ethernet Shield isn't really a shield at all and uses the ICSP connector for SPI communication.

Ethernet Shield isn't really a shield at all and uses the ICSP connector for SPI communication

Well , it totally had me fooled. Glad you busted radioshack on their scam!

zoomkat:

Ethernet Shield isn't really a shield at all and uses the ICSP connector for SPI communication

Well , it totally had me fooled. Glad you busted radioshack on their scam!

RadioShack.com Official Site - America's Technology Store

Did I miss something? The Radio Shack ethernet shield works just like the Arduino ethernet shield. Both use the ICSP connector. Any shield that wants to use the SPI and maintain compatibility with the Mega series must use that.

SurferTim:
Did I miss something?

Just zoomkat's failed attempt at humor. Thanks again for the help SurferTim.