yes the other ethernet shield works on the same ardiuno with ethershild library becouse is a enc28j60 ethernet shield .
Like you I thought that I had a dead W5100 until I put some delays in the setup.
It also helped by performing a reset after powerup, just prior to the ethernet.begin .
I use the following to initialize the unit and also reset it if there is a hang:
void NICreset()
{
//Serial.println("NIC Reset");
digitalWrite(ResetPin, LOW);
delay(1000);
digitalWrite(ResetPin, HIGH);
delay(2000);
Ethernet.begin(mac, ip);
delay(2000);
}
@lemming: That is good advice. All my new test code includes a delay(1000) to give the ethernet shield time to talk to the localnet router. Maybe delay(2000) would be better.
However, in this case, the Ethernet.begin(mac,ip) settings are not being received by the shield. It is not assigned any of the IP info. Everything on the shield is still set to zero after the initialization, including the mac address.
In your photo it looks like there is an SD card slot as well as the W5100 on the shield.
Is your slave select pin running to the SD card reader or the w5100?
Check your documentation for the shield to make sure you are talking to the correct device.
any luck solving this poblems yet beacuse i have the same problem with a wiznet shield?
Same problem to me.
I tried all these steps described in this thread and I get the IP 0.0.0.0
I am almost sure that the shield is bricked. This happened after I used simultaneusly the ethernet shield and an LCD screen. I think I did not take in mind that I should not use for the LCD, the pins that are used by the shield. That was a stupid thing to do. Anyway, is there an easy way to repair it or just the easyiest thing to do is throw it away?
The link led seems to flash. Does this means that it gets disconnected or is it normal?
Also there is a led called COLL. It does not light up at all. Is this normal?
There is one thing missing from the test code I posted that caused me problems. If you have an ethernet shield with an SD card reader (SD card in it or not), you must set pin 4 to OUTPUT and HIGH to insure there is not a data collision on the SPI bus. This code has that change.
#include <SPI.h>
#include <Ethernet.h>
#include <utility/w5100.h>
// change ip, gateway, and subnet to your network settings
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x59, 0x66 };
byte ip[] = { 192, 168, 0, 2 };
byte gateway[] = { 192, 168, 0, 1 };
byte subnet[] = { 255, 255, 255, 0 };
byte ipBuf[4];
char outBuf[18];
void setup()
{
// new code
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
Serial.begin(9600);
Ethernet.begin(mac, ip, gateway, subnet);
delay(1000);
W5100.getIPAddress(ipBuf);
sprintf(outBuf,"%u.%u.%u.%u\r\n",ipBuf[0],ipBuf[1],ipBuf[2],ipBuf[3]);
Serial.write(outBuf);
}
void loop()
{
Serial.println("Tick");
delay(1000);
}
Also, try powering down the whole thing and power it up again. The reset button and Ethernet.begin() do not do a good job resetting the ethernet shield. Turning the power off is the only guaranteed way to reset the shield.
Otherwise, it is probably a bad ethernet shield.
Some simple server test code you can try with the shield and a browser to see if the board is damaged.
// for W5100 ethernet shield
// the IP address will be dependent on your local network/router
// port 80 is default for HTTP, but can be changed as needed
// use IP address like http://192.168.1.102:84/ in your brouser
// or http://zoomkat.no-ip.com:84 with dynamic IP service
// use the \ slash to escape the " in the html
#include <SPI.h>
#include <Ethernet.h>
int x=0;
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 102 };
Server server(84);
void setup()
{
// start the server
Ethernet.begin(mac, ip);
server.begin();
}
void loop()
{
// listen for incoming clients
Client client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
char c = client.read();
// see if HTTP request has ended with blank line
if (c == '\n') {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
//meta-refresh page every 2 seconds
x=x+1;
client.println("<HTML>");
client.print("<HEAD>");
client.print("<meta http-equiv=\"refresh\" content=\"2\">");
client.print("<TITLE />Zoomkat's meta-refresh test</title>");
client.print("</head>");
client.println("<BODY>");
client.print("Zoomkat's meta-refresh test");
client.println("
");
client.print("page refresh number ");
client.println(x);
client.println("
");
client.println("
");
client.print("Zoomkat's arduino analog input values:");
client.println("
");
client.println("
");
// output the value of each analog input pin
for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
client.print("analog input ");
client.print(analogChannel);
client.print(" is ");
client.print(analogRead(analogChannel));
client.println("
");
}
break;
client.println("</BODY>");
client.println("</HTML>");
}
}
}
// give the web browser time to receive the data
delay(1);
// close the connection:
client.stop();
}
}
There is a problem I have encountered many times that you folks may be having. When the arduino-shield combination is first powered on or just reset sometimes the Rx led goes solid on and the link light blinks rapidly. This can go on for a long time. During this period, the board won't respond to a ping and it can't communicate. Usually, it will correct itself, but on some occasions, I have waited several minutes (yes minutes) for this to go away and given up and hit the reset. Usually, hitting the reset, corrects the problem quickly.
lemming, you did a toggle on some pin in this code:
void NICreset()
{
//Serial.println("NIC Reset");
digitalWrite(ResetPin, LOW);
delay(1000);
digitalWrite(ResetPin, HIGH);
delay(2000);
Ethernet.begin(mac, ip);
delay(2000);
}
What pin is that? I do something similar, but I modified my ethernet board to support it. What are you doing.
A bit late responding to this but just to answer the question for those that follow as someone has just PM'ed me for an answer:
'Resetpin' in my code just refers to an arduino pin (set as an output) that you connect to the reset pin on the wiznet module. I use the WIZ811MJ board which has the reset pin on pin2 of the J2 connector while the arduino W5100 based ethernet board will have its own pin number for reset. Basically whichever pin on your etherent board is connected to pin 59 of the W5100 chip.
To quote the datasheet:
This pin is active low input to
initialize or re-initialize W5100.
By asserting this pin low for at least 2us,
all internal registers will be re-initialized
to their default states.
I go for a bit of overkill to be sure.
Hi guys!
I was having a similar problem with my setup. I mounted a weather station using an arduino Leonardo and a W5100 ethernet shield, and had severe problems with hangs. I tried several solutions, without success, in the last days.
Mine used to work as expected at boot time more then 90% of tries. At boot time. A incertain amount of time later, it hangs and only worked again after a power down cycle. Neither reseting, neither unglugging the ethernet cable, neither uploading the sketch again solved the problem.
I tried several different codes that I found around in foruns, tried to use the watchdog - none of then worked.
What worked is
(...)
client.println("-->"); // last line of page output
lastServed = millis();
break;
}
if (c == '\n') {
// we're starting a new line
current_line_is_blank = true;
}
else if (c != '\r') {
current_line_is_blank = false;
}
}
}
client.flush();
delay(2);
client.stop();
delay (2);
while (client.connected()) {
client.stop();
delay (2);
}
That's the code I found here in arduino forum. I wish to thank you all for the help.
After I implemented that, I tried hard to hang the arduino web server by requesting many many times in short intervall of time, without success, because it was what caused the previous hangs. Before that, frequently only two barely simultaneous requests was enought to hang it.
Now, neither getting the finger tired of clicking the link, neither holding F5 (navigators refresh key) down, neither using a linux to request hundreds of times in a single second was sufficient to get a hang.
I hope these words help someone else.
Thank you all again thousands of times.