Ethernet shield link wont stay active with Netgear router

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
edenist
 
Posts: 5
Joined: Thu Sep 01, 2011 11:12 pm

Ethernet shield link wont stay active with Netgear router

Post by edenist »

Hi everyone,

I have a new ethernet shield for my Arduino Duemilanove [Atmega 328 version] and it does not appear to work when plugged in to my router.
I have been trying to get the sample Ethernet sketches to run, all of which work perfectly when I plug the ethernet shield directly into a computer. However when I plug it into my router, the link doesn't appear to stay active. The 100M light flashes on and off periodically with the port connection light on the router. Some times it stays on for a few minutes, and the rx light remains on for this entire time. But normally it flashes every few seconds and wont maintain the link.

Below is the code I am running, which runs perfectly when connected directly to a computer.

Is there something weird going on in how my router identifies devices?

Any help would be greatly appreciated, as I will be needing internet access which will of course require me to connect it to the router.

Cheers,
Ed

***EDIT*** Will also add that the router is a netgear DG834G v4. And the mac address in the code there I have taken from the sticker which was on the bottom of my ethernet shield

Code: Select all

/*
 Chat  Server
 
 A simple server that distributes any incoming messages to all
 connected clients.  To use telnet to  your device's IP address and type.
 You can see the client's input in the serial monitor as well.
 Using an Arduino Wiznet Ethernet shield. 
 
 Circuit:
 * Ethernet shield attached to pins 10, 11, 12, 13
 * Analog inputs attached to pins A0 through A5 (optional)
 
 created 18 Dec 2009
 by David A. Mellis
 modified 10 August 2010
 by Tom Igoe
 
 */

#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.
// gateway and subnet are optional:
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x88, 0x06 };
byte ip[] = { 192,168,1, 17 };
byte gateway[] = { 192,168,1, 1 };
byte subnet[] = { 255, 255, 255, 0 };

// telnet defaults to port 23
Server server(23);
boolean gotAMessage = false; // whether or not you got a message from the client yet

void setup() {
  // initialize the ethernet device
  Ethernet.begin(mac, ip, gateway, subnet);
  // start listening for clients
  server.begin();
  // open the serial port
  Serial.begin(9600);
  Serial.print("Arduino Chat Server \n\nInitialised...\n\n");
}

void loop() {
  // wait for a new client:
  Client client = server.available();
  
  // when the client sends the first byte, say hello:
  if (client) {
    if (!gotAMessage) {
      Serial.println("We have a new client");
      client.println("Hello, client!"); 
      gotAMessage = true;
    }
    
    // read the bytes incoming from the client:
    char thisChar = client.read();
    // echo the bytes back to the client:
    server.write(thisChar);
    // echo the bytes to the server as well:
    Serial.print(thisChar);
  }
}

edenist
 
Posts: 5
Joined: Thu Sep 01, 2011 11:12 pm

Re: Ethernet shield link wont stay active with Netgear router

Post by edenist »

So I dug up an old switch I use sometimes if I need more ports on my router, this is just a "dumb" switched hub which plugs into my router which then takes care of addressing.

Plugging the shield into this switch, it now works perfectly and appears on the router, and can be accessed on my network.
It seems there is something very low level in the router in how it deals with the physical connection.....

Though I guess it's not really "problem solved" on my end, I guess it certainly is as far as the ethernet shield goes. Probably just going to have to accept the quirk of the router...... Have been wanting upgrade to gigabit anyway, guess now I have yet another reason to, lol :p

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Ethernet shield link wont stay active with Netgear router

Post by adafruit_support_bill »

Have you tried using different cables and/or plugging into different ports on the router?

edenist
 
Posts: 5
Joined: Thu Sep 01, 2011 11:12 pm

Re: Ethernet shield link wont stay active with Netgear router

Post by edenist »

Yes I have tried multiple cables on all ports of the router. The link will stay active for a second then drop out on all of them.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”