Ethernet shield wont communicate

I’m sorry if this is in another post but every time I search I get no results.

I can’t remember where I got this code:

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

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// the router's gateway address:
byte gateway[] = { 192,168,2,1 };
// the subnet:
byte subnet[] = { 255, 255, 255, 0 };

IPAddress ip(192,168,2,2);

void setup() {
  Serial.begin(9600);

  // disable SD SPI
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  // Start ethernet
  Serial.print(F("Starting ethernet..."));
  Ethernet.begin(mac, ip);
  Serial.println(Ethernet.localIP());
}

void loop() {
}

When using the serial monitoring it tells me

Starting ethernet…0.0.0.0

I remember reading in the post that if it showed this the SPI isn’t communicating and to make sure the shield is seated all the way. They are.

Now I have 3 Arduino UNO’s and 3 ethernet shields and I can’t get any of them to bring up the IDE Webserver the one that comes with the IDE and they all 3 show:

Starting ethernet…0.0.0.0

Firewall is down so I know it isn’t an issue.

When I do an ipconfig it tells me my gateway and subnet so I know those are correct. when I look in the router at the DHCP client list it doesn’t show the ip address so I know it is unique.

What could be the cause of the SPI not communicating?

Thank you

Hi,

Might be the blind leading the blind as I only tried the ethernet shield for the first time last night.

Have been able to get it working ok within my local network, though not yet proven over the web.

First two thing to check are that the mac address that comes with your Shield, should be the same as you have in that code.

Second , from the Examples run the DhcpAddressPrinter to check the shields address and enter that into the Examples, WebServer and that should run.

I then tried using this example, which details how to set up your router to communicate via the web but not yet got that working when using mobile phone.

Edit - just corrected some set up errors I made and now have full web connection with my mobile phone using the above code example/tutorial.

When you have Arduino boards version 'R3', and a shield version 'R3', the connections are okay.

Can you try DHCP mode ? So the router will supply the IP number. Just call "Ethernet.begin" without IP number.

Ethernet.begin(mac);    // without IP is DHCP mode

You use the mac address DEADBEEFFEED. I heard that some routers don't like it. I have not had any trouble with it myself, but perhaps your router has blocked it during trying to make it work.
Did your Ethernet shield come with a mac number ? or did you buy cheapy clones on Ebay ?
You can use an online mac generator. When you have more than one Arduino connected to a router, each must have its own unique mac number.

Some have very strange ethernet/internet configurations with wireless and other things, and the Arduino is not connected directly to a router. That could cause trouble, it might have to do with timing problems. Do you have something like that ?

That is my test code for the SPI bus. If it shows this, then the SPI bus between the shield and the Arduino is failing. It has nothing to do with the router or the network connection.

Starting ethernet…0.0.0.0

Check the connection between the Arduino and the shield, especially the ICSP connector. Insure the shield pins are inserted fully into the Arduino.

Also check for solder bridges on the w5100 IC.

Do the ethernet shields have any “extra” pins that do not insert into the Arduino? If you use an R3 shield with a pre-R3 Arduino, there will be two extra pins on each side.

SurferTim:
Also check for solder bridges on the w5100 IC.

Hi,

I did see mention of this in an old post that also had a close view photo.

When I checked my ethernet board (a clone) it does indeed have eight pairs of pins on the 5100 chip, 4 pairs on 2 sides, that are 'solder bridged' in exactly the same position as that old photo.

However looking at the board with a glass, on most of those 'shorted' pins, there are visible pcb tracks that also join them together.
Seems like its a deliberate thing, though no idea way ..?

There are several pins on the w5100 that should be connected. Here is the schematic.

But those should be connected with traces, not solder bridges. It would be difficult to tell if it was a "good" solder bridge, or a "bad" one.

Hi,

Thanks for that diagram, cross referenced against the board and all the 'bridged' pins are connected to ground.

If a genuine soldering production fault expect they still pass testing, so let them 'pass' as the problem is only aesthetic.
Expect thats why they get onto the Ebay market so cheaply..?

This indicates a SPI bus problem:

Starting ethernet...0.0.0.0

Don't know what else to tell you.

Expect thats why they get onto the Ebay market so cheaply..?

Carefully check to see if the Ethernet shield pins are in the correct arduino pin holes. I've miss aligned the pins in the past. You can check the ebay vendor you got the board from and see if there is negative feedback concerning bad boards. I just got a second Ethernet board from the below seller and it works just fine.

http://www.ebay.com/itm/Ethernet-Shield-W5100-Arduino-Main-Board-2009-UNO-Mega-1280-MEGA-2560-/361009941325?pt=LH_DefaultDomain_0&hash=item540dde8b4d

Thank you all for the info. I tried a lot of things and nothing worked. They are all knock of boards and something is wrong with all of them.

You get what you pay for. CHEAP is not the way to go.

I ended up going to Radio shack and getting a Seeeds ethernet shield plugged it in uploaded the sketch above as is and wa la it worked.

Good to hear your new one is working anyway.

Just a thought. Do you other ethernet shields have a w5100 IC? Some cheap ethernet shields use a ENC28J60 IC. It uses a different library.

I checked the chip on the other shields it is the enc28j60 chip. I got them to work. Thank you for that. I was about to chuck them.