Ethernet shield returns Unknown IP address: 64.0.0.16

Lately, my Arduino Ethernet shield has taken to returning an IP address of 64.0.0.16 even when using the standard Arduino Ethernet script setting the IP address as 192.168.1.177. I have no clue as to why this is happening. Any ideas?

I have no clue as to why this is happening. Any ideas?

Must be something in your code or your network. We can't see either one.

In addition to PaulS, do you have any other SPI hardware connected? Maybe a SD card in the shield's slot?

When the problem first arose, I took it all back to basics without success.

I just kept copying the standard code off this site using "Get Code" :

There are no other sensors or anything else connected. It has an SD card but I get the same result if the card is in or out and if the additional code is added or not:

pinMode(4, OUTPUT);
digitalWrite(4, HIGH);.

I have tried it with and without the for loop:

for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
int sensorReading = analogRead(analogChannel);
client.print("analog input ");
client.print(analogChannel);
client.print(" is ");
client.print(sensorReading);
client.println("
");
}

That is I have tested every combination - card in and out, pin mode setting in and out and for loop in and out

This is what I have coded "IPAddress ip(192, 168, 1, 177);" as per the website.

This is what I get "server is at 64.0.0.16" on the serial monitor.

I am no expert but I have been able to work out every issue I've come across since picking up an Arduino. But this one has me stumped.

Does your ethernet shield have a w5100 IC on it? Some have w5200, w5500, or enc28j60 controllers.

This is what I have coded "IPAddress ip(192, 168, 1, 177);" as per the website.

This is what I get "server is at 64.0.0.16" on the serial monitor.

So, the client has one address and the server has another. Why is that a problem? It is what I would expect.

My mistake Paul. I thought when you coded:

IPAddress ip(192, 168, 1, 177);
EthernetServer server(80);

then

Serial.print("server is at ");
Serial.println(Ethernet.localIP());

you'd get "server is at 192.168.1.177" not "server is at 64.0.0.16"

Anyway, that's what I am getting now. I reset the router to factory settings, reloaded Arduino 1.6.5 and it now seems to work. I get server at 192.168.1.177 and if I put that IP address in the search bar, I can read the web page. Thanks for taking the time.

Perhaps now you can see why we ask you to post your code. It was not clear that you were running the Arduino as a server.