red W5100 board - how to confirm working? is router the issue?

i have Mega 2560 + W5100 mini boards,

pins:

10 - SS
50 - MI
51 - MO
52 - CK

V+ - 5V
G - GND

i run the Ethernet example WebServer from 1.6.5 IDE and get:

server is at 255.0.8.0

in serial?

do i need to change anything in my router? it is NETGEAR CG3100D-2

i have tried different Mega, a different W5100 and two Cat5 cables.

the PWR LED is solid on the W5100
LINK LED occasional flashes
SPD is solid
FDX is solid
COL is not lit
Rx flashes often
Tx does not flash at all

i followed the instructions here:

https://arduino-info.wikispaces.com/ethernet

but don't get the webpage at 192.168.1.177 to appear.

when i reset the Mega, it shows a new server IP each time:

server is at 255.0.8.0
server is at 128.80.1.0
server is at 136.0.1.64
server is at 0.32.0.0
server is at 0.40.143.0

also - I am using USB only connection to the Mega,

or must I use external power supply?

I have a 12VDC @ 2A one I could use, would that be sufficient?

Are you on a local network that you are trying this on? (behind a home router for example). If so, and you are using DCHP to get an address, none of those are valid. You should be seeing either 10.something or 192.168.?.? as an assigned address. You may well have an issue of not enough power to handle that hardware, but those are not valid addresses. If it was connecting to DHCP and getting different addresses, typically, only the last octet would change (you would get something like 192.168.2.23, 192.168.2.24 etc. where only the last octet is changing (assuming a netmask of 255.255.255.0 which is more or less standard in local home type networks). Whatever address you get via DHCP should be very similar, only changing the last octet.

thank you for your reply!

gpsmikey:
Are you on a local network that you are trying this on? (behind a home router for example).

yes

If so, and you are using DCHP to get an address, none of those are valid.

yes, I was expecting a 192.168.1.XX to show up as my network is 192.168.1.XX

You may well have an issue of not enough power to handle that hardware, but those are not valid addresses.

thanks for confirming.

Whatever address you get via DHCP should be very similar, only changing the last octet.

I am pretty sure DHCP is enabled!

so is this something in my hardware or my router or my code I could try to troubleshoot this?

Additionally - I tried quite a few of zoomkat's test codes, but still cant get a connection... I did one that showed:

TICK 
TICK
TICK

but still could not connect...

are my Arduino Mega pins correct?

Client test code you can unmodified try to see if you can get a response from the server.

//zoomkat 3-1-13
//simple client checkip test
//for use with IDE 1.0.1 or later
//with DNS, DHCP, and Host
//open serial monitor and send an e to test
//for use with W5100 based ethernet shields

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

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

char serverName[] = "checkip.dyndns.com"; // 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 ip test 3/1/13"); // 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 / HTTP/1.1"); //download text
    client.println("Host: checkip.dyndns.com");
    client.println("Connection: close");  //close 1.1 persistent connection  
    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

}

zoomkat:
Client test code you can unmodified try to see if you can get a response from the server.

thanks I tried this yesterday and got:

"connection failed"

zoomkat:
Client test code you can unmodified try to see if you can get a response from the server.

i ran that test code you posted tonight, but got nothing in the serial output (nothing at all).

but when i re-ran your old test code i tried earlier i got:

Better client test 12/01/11
Send an e in serial monitor to test
connection failed


disconnecting.
==================

the attached screenshot shows the devices my router can see - the 128.0.0.0 one is new.

does that mean anything?

arduino001.png

If you are using a "switch" instead of a "router", you may have problems. Below is how my router shows the connected ethernet shield.

im using a Netgear CG3100-2BPAUS 4-port device.

pretty sure it is a router isnt it? it is routering lots of my devices!!!

i cant find the "attached Devices" part of the router menu (like your picture), but this is what it looks like in another section (attached)

so could the router be the problem?? is is blessed with my providers custom firmware...

i just have no idea why it is not working with this W5100

i have no problem with multiple ESP8266 devices via wifi - i just wanted to try Ethernet because it might be faster or less drop outs!!! (i have a big house)

it has been 4 days of trying to get this w5100 + Mega 2650 combo to do anything.

i have tried two different Mega's, two different W5100 modules and 3 different ethernet cables.

the cables work fine when plugged into my laptop. so i am pretty sure the LAN is working.

why cant i get the W5100 to do anything useful!

this is my LAN IP section (attached)

this is OK isnt it?

am i missing something REALLY fundamental and basic here?

lanipsection.jpg

Yes, that indicates your local network is going to be 192.168.0.? where 192.168.0 is the network portion of the address and the last octet will be the host address on that network. It shows that DHCP is enabled and handing out addresses in the range of 192.168.0.2 up to 192.168.0.254 (255 is the broadcast address). One thing you might consider is changing the range DCHP is handing out - I have mine set to only hand addresses up to 200 - above that I use for static addresses for my Linux local server on my network, network printers and other things I want to use with static IP addresses (I have to keep track of what IP addresses I assign myself up there). This doesn't affect what you are doing right now, but something to think about if you want to be able to experiment with static IP addresses on your network (easier to hit a fixed target than a moving one :slight_smile: )

thanks, but do you have any other ideas as to why i cannot connect?

is it anything to do with my Windows 10 settings?

Not off hand - not sure why windows 10 is even part of the equation at this point. Your board is trying to get an IP address via DHCP from your router. That does not involve windows at all. Your board is for some reason not getting the address and other information from the router. Hopefully one of the others here with more experience can give you a simple test program to get some more information. You might want to consider installing the (I think it is still free) Wireshark application on your PC. That lets you snoop on the network and see what is going back and forth. I have forgotten the exact details of the handshake, but basically, your board comes up and says here I am, can I have an IP address. The DHCP server then "offers" and address (in case there are multiple DHCP servers on the network) which the requesting board then acknowledges and accepts.

thanks Mikey appreciate your description - from that, i am leaning towards the router as the issue here... perhaps hobbled by my provider firmware?

Wareemba:
thanks Mikey appreciate your description - from that, i am leaning towards the router as the issue here... perhaps hobbled by my provider firmware?

If other machines on your network can get an address, then your board should be able to as well (unless you have reached the limit of how many addresses it will hand out). As for being "hobbled by your provider" that is why I had the go around with Comcast with their new cable modem. They wanted to set it up for my network and wifi. I had to argue with them a bit to get them to put the cable modem in "pass-through" mode and let me handle my network with my router and wifi that I can configure my way. Every now and then, they load new firmware on the cable modem box and I have to have that fight with them again (in it's normal mode, it wants to hand out a 10.something address which is another one like the 192.168.?.? and is unroutable if you have two routers in series basically. One thing I have my wifi configured with that probably does not apply here, but worth mentioning is I have mine (in the router) configured to only associate with known MAC addresses (I have to add the MAC address to a table in the router). This is in addition to encryption. Cuts down (doesn't eliminate it though) on "drive by" snooping - they can't even associate much less bang on the encryption unless they spoof the MAC address. Easier to go to the next block in their snooping :slight_smile:

welp, problem solved. i used the ICSP header for the connections, not pins 51,52&53.

really don't know why it took me so damn long to do this!

feel a bit dumb now...

thanks for your support, it helped me keep trying and keep reading...

cheers :slight_smile:

PS - scared to play with router settings, too many people will kill me if it fails!