Pages: [1]   Go Down
Author Topic: Ethernet shield, can't ping  (Read 6957 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
after googling and reading quite a few threads about ethernet shield troubleshooting I ended up with no result. So:
got the ethernet shield on my Arduino Uno.
Loaded default server sketch.
 - When connecting to my switch I get steady green led and occasionally blinking orange on connector. Orange led blinks when I try to ping but ping says "Destination host unreachable".
 - When connecting through cross cable to my PC (Vista) I get steady green led and a lots of orange blinks initially, but it goes off later. Orange led stays off when I try to ping. Ping says: ping transmit failed, error code 1231. (my ipV6 is disabled in network settings, firewall disabled)

In both cases nothing comes up from shield ip in browser. I used default shield ip and MAC (I did make sure that my pc has different last number of ip)
I tried powering from usb and 6V power adaptor.

As my experience with networking is limited to switch, router and a couple of computers and I didn't use full size shields before (only RF transmitters, servos, relays etc.) I have no Idea what could be wrong.
Should I return the shield?
Thanks!
Logged


0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You probably need to post the type of ethernet shield you are using and your arduino code.
Logged

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

Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino Ethernet Shield V1.1
ENC28J60 controller
port label: HanRun HR911102A 09/44

Default Arduino 0021 example sketch.
Have tried changing IP/MAC.
Quote
#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1, 177 };

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
Server server(80);

void setup()
{
  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();
}

void loop()
{
  // listen for incoming clients
  Client client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          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("<br />");
          }
          break;
        }
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        }
        else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
  }
}
Logged


0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Arduino Ethernet Shield V1.1
ENC28J60 controller
port label: HanRun HR911102A 09/44

Are you using the appropriate librarys and code with the ENC28J60 based ethernet shield? The ENC28J60 is significantly different and more complex to program than the W5100 based shield.
Logged

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

Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Arduino Ethernet Shield V1.1
ENC28J60 controller
port label: HanRun HR911102A 09/44

Are you using the appropriate librarys and code with the ENC28J60 based ethernet shield? The ENC28J60 is significantly different and more complex to program than the W5100 based shield.
So that's the problem!
I thought they're compatible. Thanks, saved a lot of time!
Logged


Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Up and running.
Thanks again!

For someone as clumsy as me smiley
the library for ENC28J60 based shields:
http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=1&products_id=4&zenid=4f8763dd32227d54ee11ac472d5c09a4
« Last Edit: April 18, 2011, 04:21:56 am by kivig » Logged


France
Offline Offline
Sr. Member
****
Karma: 2
Posts: 380
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dont forget to set an static ip address on your pc, usually it's set as DHCP address that will not works in thta case.

So from set an adress like 192.168.1.1 to ethernet adapter on the pc.
Logged

Pages: [1]   Go Up
Jump to: