Go Down

Topic: arduino wiznet w5100 ethernet shield problem (Read 5 times) previous topic - next topic

SurferTim

That looks like a bad ethernet shield. I bet you get the same response running that with the shield removed.

julianiii

Yes i get the same respone even the ethernet cable is unpluget.
Maybe is hardware prolem ?

SurferTim

Quote
Yes i get the same respone even the ethernet cable is unpluget.

I mean the same response with the ethernet shield unplugged, not connected to the Arduino. Like on your bench a good distance away.

julianiii

Yes with ethernet shiled unplugged not connected whith the Arduino.

SurferTim

And the other ethernet shield works on the same Arduino? Dead shield.

julianiii

#20
Oct 08, 2011, 08:28 pm Last Edit: Oct 08, 2011, 08:33 pm by julianiii Reason: 1
yes the other ethernet shield works on the same ardiuno with ethershild library becouse is a  enc28j60 ethernet shield .

lemming

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:

Code: [Select]

void NICreset()
{
  //Serial.println("NIC Reset");
  digitalWrite(ResetPin, LOW);
  delay(1000);
  digitalWrite(ResetPin, HIGH);
  delay(2000);
  Ethernet.begin(mac, ip);
  delay(2000); 
}

SurferTim

@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.


lemming

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.

gaggenau

any luck solving this poblems yet beacuse i have the same problem with a wiznet shield?

dentalan

#25
Oct 29, 2011, 11:39 am Last Edit: Oct 29, 2011, 11:42 am by dentalan Reason: 1
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?



SurferTim

#26
Oct 29, 2011, 12:44 pm Last Edit: Oct 29, 2011, 12:55 pm by SurferTim Reason: 1
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.
Code: [Select]
#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.

zoomkat

Some simple server test code you can try with the shield and a browser to see if the board is damaged.

Code: [Select]

// 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("<br />");
                   
          client.print("page refresh number ");
          client.println(x);
          client.println("<br />");
          client.println("<br />");
         
          client.print("Zoomkat's arduino analog input values:");
          client.println("<br />");
          client.println("<br />");
         
          // 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("<br />");
            }
           break;
          client.println("</BODY>");
          client.println("</HTML>");
         }
        }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
  }
}

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

draythomp

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:
Quote
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.
Trying to keep my house under control http://www.desert-home.com/

lemming

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.

Go Up