Internet shield diagnostic tools?

I've gotten some internet shields to work, but not others. I've tried setting the enable pins high and low (pins 10, or 52 on mega) I've used different mac numbers for these boards, and different IP addresses with my linksys router (typically 192.168.1.120 or 92.168.1.121 which are unused on my router) I've tried the different examples in the library. I've tried Ethernet.begin(mac, ip), and Ehternet.begin(mac). Is there issues with having more than one arduino internet board running at the same time, with different IP's and mac's? Besides not connecting or there other diagnostic tools to determine if the shield is indeed fried.

Is it common for these things to malfunction? I've got the shields with the wiznet chip on them, and have tried them with UNO R3 and mega boards. These internet shields are mega compatible.

Help

I would think Ethernet issues would be with code, hardware setup, network settings, or network connectivity. Below is some basic client code that might be useful for trouble shooting.

//zoomkat 9-22-12
//simple client test
//for use with IDE 1.0.1
//with DNS, DHCP, and Host
//open serial monitor and send an e to test
//for use with W5100 based ethernet shields
//remove SD card if inserted

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

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address

char serverName[] = "web.comporium.net"; // zoomkat's test web page server
EthernetClient client;

//////////////////////

void setup(){

  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:
    while(true);
  }

  Serial.begin(9600); 
  Serial.println("Better client test 9/22/12"); // so I can keep track of what is loaded
  Serial.println("Send an e in serial monitor to test"); // what to do to test
}

void loop(){
  // check for serial input
  if (Serial.available() > 0) //if something in serial buffer
  {
    byte inChar; // sets inChar as a byte
    inChar = Serial.read(); //gets byte from buffer
    if(inChar == 'e') // checks to see byte is an e
    {
      sendGET(); // call sendGET function below when byte is an e
    }
  }  
} 

//////////////////////////

void sendGET() //client function to send/receive GET request data.
{
  if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
    Serial.println("connected");
    client.println("GET /~shb/arduino.txt HTTP/1.1"); //download text
    client.println("Host: web.comporium.net");
    client.println(); //end of get request
  } 
  else {
    Serial.println("connection failed"); //error message if no client connect
    Serial.println();
  }

  while(client.connected() && !client.available()) delay(1); //waits for data
  while (client.connected() || client.available()) { //connected or data available
    char c = client.read(); //gets byte from ethernet buffer
    Serial.print(c); //prints byte to serial monitor 
  }

  Serial.println();
  Serial.println("disconnecting.");
  Serial.println("==================");
  Serial.println();
  client.stop(); //stop client

}

Thanks, I'll try it. The shield does work as an EthernetClient, but not as a EthernetServer. but now I'm off to rake some leaves.

but now I'm off to rake some leaves.

You are a bit off, if you are raking leaves. :slight_smile:

bjkellett:
I've gotten some internet shields to work, but not others.

What I can recomment to debug network (especcially basic connectivity-) issues is installing WireShark and use a direct-cable-connection that is configured with a static-ip running so you can easily trace what the shield actually does.

Another think you might check - especially when using cheap Ethernet-shields from china: The mega-compatible ones connect via the ISP-connector and often the connetor barely connects to the Arduinos pins because it's just not long enaugh. I recently spent several hours with a shield that worked with my mega2560 but partly refused to work on the UNO (it could connect as a client, but every call to Client.connect() returned false because of the MISO pin not being connected, so the WIZ5100-chip got its config and connected, but the Arduino never got to know...).

  • Norbert

Yep, good call. Faulty ICSP pin connections! Just a little too short, or the other pins are alittle too long. And yes they are the cheap China shields.