Old problem but not outdate Webserver sample return IP 0.0.0.0 after uploading

Hi every one.

I am a newbie.

I have one Arduino Mega 2560 Board and Ethernet Shield W5100

I try to upload Websever sample and use Serial monitor to check, IP return 0.0.0.0

I read some old topic and try some solutions but till now still get IP return 0.0.0.0

Trying number 1:

#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() {
}

Trying number 2:

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

byte mac[] = { 0x00, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

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

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

Serial.print(F("Starting ethernet..."));
if(!Ethernet.begin(mac)) Serial.println(F("failed"));
else {
Serial.println(Ethernet.localIP());
Serial.println(Ethernet.gatewayIP());
}
}

void loop() {
}

Trying number 3:

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

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,0,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() {
}

Trying number 4:

Change pin from 10 to 53

and so on...but till now result is zero.

So, today I open this topic and hope to have some experience people give procedure for all newbie like me how to solve problem for example: about hardware, sketch, libraries....

I think to understand I have a few questions as follow:

  1. IP address store in Arduino Board or Ethernet Board ?

  2. How to recognize uploading processing is proceeding ok by visible ( for example what LED is blink to show ip address has been saved correctly.)

  3. Which bus need to communicate to upload sketch: Pins 10,11,12,13 used to transfer sketch ? 6pins jumper ISCP of Arduino Board under SD card tray of Ethernet Shield is used to transceiver with SD Card?

I hope above questions help us right way to find out problem.

Thanks.

If you are getting 0.0.0.0 on the serial monitor, the SPI bus or the SPI side of the w5100 has failed. Insure the shield is inserted correctly into the Mega.

The SPI bus is the ICSP pins. All but the oldest ethernet shields have nothing conected to D11 to D13. D10 is the slave select for the w5100.

First I connect Ethernet on Mega Board with 6pins ISCP of Mega and Ethernet together, I think that position is not wrong.

But processing suspend when uploading. I read some thread posted, I think Reset pin of ISCP ( under SD card tray) may course proplem, so I unplug Ethernet Board and connect by wires. When connect Reset pin, upload processing suspend, so I dont connect this pin is ok.

Wires I connect as follow

Mega board Ethernet Board

pin 10 10
11 11
12 12
13 13

4 4

ISCP 5pins correspond with each other, except pin Reset, It Uploading done but get IP 0.0.0.0

Ang I try cutting Reset pin and plug Ethernet to Mega Board, The same suspend when uploading, may be some other pins also cause problem.

pins connected by wires above is Ok ?

No. The SPI pins are D50 to D53 on a Mega.

pin D53 correspond D10
D50 D11
D51 D12
D52 D13

?

And the newer Ethernet shields do not have the SPI bus connected to D11 to D13. The SPI lines are only on the ICSP pins.

let me try, how about pin 4 and pin 10

53 to 10 ?

4 to 4 ?

I connect as follow

pin Mega Ethernet
53 10 SS
52 CLK (ISCP) under SD Card tray
51 MISO (ISCP)
52 MOSI (ISCP)

4 4

second option plus
0 0
1 1
2 2
3 3

the same, not change
ip return 0.0.0.0

Are you certain the shield you are using is a w5100?

Mega Shield
D50 -> MISO
D51 -> MOSI
D52 -> SCLK

D10 -> D10
D4 -> D4

Right, I use Ethernet shield Wiznet W5100

last post I wrote mistake

Pin Mega Shield

D50 MISO
D51 MOSI
D52 SCLK

And I tried 2 options

D53 D10
D4 D4

Option 2
D10 D10
D4 D4

Result. the same, get back 0.0.0.0

It sounds like you have a hardware problem. Something must have failed. A common problem with the less expensive shields are solder bridges on the w5100.

I also test by connecting SCLK, MISO, MOSI on Mega and SCLK,MISO,MOSI of 6 pins Jump ISCP of Shield

another option connect SCLK(52), MISO (50), MOSI(51) on Mega and SCLK (13 ), MISO (12), MOSI (11) of Shield

Ofcourse, Pin 10 and pin 4 included.

the same.