Pages: [1]   Go Down
Author Topic: Problem getting EthernetShield working  (Read 666 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I'm new to the Arduinos and have problems getting the Ethernet SHield working.
HW: Mega 2560, new Ethernetshield with W5100 (Connector left, reset button and regulator left, SD right, LEDs up right)
As far as I understand, I only have to use eg. the FILE->Examples->ETHERNET->DhcpAdressPrinter.

When I do that, no connection to the Router, Power is on.
Ethernetcable plug in: Link, 100M, Fulld light up. every some seconds LINK goes off while RX light on, TX stays off.
So, looks like there is connection. But no message on the SERIAL Monitor, and not visible in the network (checked with nmap), No IP is given out.

Do I have to configure something?
Any other idea but : give it back, you are to stupid?

Any help apprechiated,
Ingo
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 115
Posts: 5386
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

dhcp depends on a dhcp server to issue an address. It will take a couple minutes to timeout, but it should timeout.

Try this. You don't even have to change the ip. This is designed to test the SPI connection to the w5100. If it displays 192.168.2.2, the SPI connection to the w5100 is working.
Code:
#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,2,2);

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

  // disable SD card if one in the slot
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  Serial.println("Starting w5100");
  Ethernet.begin(mac,ip);

  Serial.println(Ethernet.localIP());
}

void loop() {
}
« Last Edit: December 08, 2012, 08:56:44 pm by SurferTim » Logged

0
Offline Offline
Tesla Member
***
Karma: 118
Posts: 8956
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Spell check!  smiley
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 115
Posts: 5386
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My apology for any typos.  smiley-roll
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First of all,Thanks for reply. I used your code (SurferTim), but I get:

Starting w5100
0.0.0.0

as answer. Does that mean, there ist an SPI error? No SPI Bus-connection? if so, I will have to look with an oscilloscope.

To clarify, when I use the above described EthernetSHield, do I only have to stick it to the mega2560 or do I have to make any more connections or something else?

When I read on the net, it looks like: stick the two PCB together, use the samplecode, it works. I sit like that, or do I have to do something else?

Ingo

P.S. I use an open source version of English and German. I am allowed to modify, as long as I publish it. smiley-wink

Logged

0
Offline Offline
Tesla Member
***
Karma: 118
Posts: 8956
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Check the pin alignment between the mega and ethernet shield. I recently got a mega and a new ethernet shield and noticed one has to be careful to make sure the pins go in the correct holes.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

O.K., that's it. I checked both PCBs, connection from Mega to Connectors and W5100 to Connectors. Everything o.K.
Then sticked both together an check Connection between them. MOSI Pin no connection. It was the Header on the Ethernetshield. I have to bend the Pin on the Mega a little bit, so it sticks skew (not upright??) in the Connector.
Cool, i can get ethernet with a controller smiley
That's what I dreamed of years ago (beside others)
Thanks for the help,
Ingo
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You made my day.

I had exactly the same problem and wasted  smiley-cry a couple of hours on this until I found your solution.

Thanks a lot !!

Muetze303
Logged

Pages: [1]   Go Up
Jump to: