webserver do not respond

Hi,
I'm using Arduino Uno for the first time with Ethernet Shield (W5100 chip).
I connect it via RJ45 patch cable to my Netgear DNG3500 router, I've used Webserver sketch from examples, I modified IP address using 192.168.0.177 within my local network range and uploaded it.
I tested that network data are correct becouse if I ping it answer correctly in less than 1ms.
When I go to my web browser and connect to 192.168.0.177 non page was found :frowning:

I tried to use IE8, Firefox and Chrome web browser... unsuccesfully.
I tried to change my router, I used a simple switch, I used a different PC, I changed data cable... but unsuccesfully.
I tried to use IDE 1.0 and IDE 0023... but unsuccesfully.

Only one time it works... for few seconds.

Anyone can help me?

When I go to my web browser and connect to 192.168.0.177 non page was found

That would indicate a problem with the code running on the Arduino. And that code looks like?

The code is the sample in Tools > Ethernet > Webserver ...what is wrong???

/*
Web Server

A simple web server that shows the value of the analog input pins.
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 4 Sep 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:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,0,177);

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

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

void loop()
{
// listen for incoming clients
EthernetClient 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("
");
}
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();
}
}

Hi,

I have exactly the same problem. I bought the arduino Ethernet on Sunday, yesterday I tried the webserver example and was working perfectly, today was also working, but suddenly it does not work anymore....

the code is the webserver example code.

Thanks in advance!

Does anybody know? I wouldn't like to give it back or buy a new one... :frowning:

What exactly is the error? Is it "error 404 page not found" or "cannot connect to server"?

You must ensure that the reset pin is not connected to the Arduino board (best to bend the pin side) and then it goes.

When I go to 192.168.1.177 it says "waiting", it takes a lot of time and at the end it tells me that cannot connect.

In mi case it is the Arduino Ethernet (I don have the shield, it is everything integrated).

It is so strange... it was working perfectly and suddenly does not work.... :frowning:

@levas:
Are you certain about the ip address you entered in the web server code?
What is the ip of the computer you are attempting to connect with?
Can you ping the ethernet shield ip address from the computer?

Are you certain about the ip address you entered in the web server code?

Yes, it is the same that appears in the ethernet web server example.

What is the ip of the computer you are attempting to connect with?

192.168.1.35

Can you ping the ethernet shield ip address from the computer?

Yes, indeed the leds Tx and Rx are blinking in the ping. Also when I go to chrome and type the IP address Tx and Rx blink once.
Before this error happened, I could also connect from my mobile phone via WIFI and now it is not possible, remains waiting and waiting....

Guys! Now it works!

What I have done is to install the program in another computer (laptop windows), upload again the webserver example... and works!

In the other computer I was working with Linux..... Linux (Ubuntu 11) seems to be the reason, but in the first tests was working perfectly. Strange....

Thanks a lot for the help!

Glad to hear that. I do not believe it is Ubuntu tho. I am using a Mega with V11.10, and it is working great with the ethernet shield.

I did have some trouble with the shield before I disabled the microSD card reader SPI interface on the shield. It would interfere with the w5100 IC on occasion.

Guys

I have the same problem :frowning: but it is not solved yet. I inserted a SD card in the slot. That is when the problem started. My serial output showed ip as 0.0.0.0 and later when i removed the SD card, it is showing the ip from the code. But still i am not able to connect to the webserver.

How to disable the SD card?

Move high to Pin 4????

Post your code. The below is a fix.

  Serial.begin(9600);

  // disable w5100 while setting up SD
  pinMode(10,OUTPUT);
  digitalWrite(10,HIGH);
  Serial.print("Starting SD..");
  if(!SD.begin(4)) Serial.println("failed");
  else Serial.println("ok");

  Ethernet.begin(mac, ip, gateway, gateway, subnet);
  server.begin();
  Serial.println("Ready");

I am facing the same problem with the same code and can't change my machine[laptop]
Code is :
#include <Ethernet.h>
#include <SPI.h>
byte mac[] = {0xDE ,0xAD ,0xBE,0xEF ,0xFE,0xED};
IPAddress ip(192,168,1,177);

EthernetServer server(80);

void setup()
{
Serial.begin(9600);
while (!Serial) ;
Ethernet.begin(mac,ip);
server.begin();
Serial.print("server is at :");
Serial.println(Ethernet.localIP());
pinMode(4, OUTPUT);
digitalWrite(4, HIGH);
}

void loop()
{
EthernetClient client = server.available();
if(client)
{
Serial.println("new client");
boolean clib = true;
while(client.connected())
{
if(client.available())
{
char c = client.read();
Serial.write(c);
if ( c=='\n' && clib)
{
client.println(F("HTTP/1.0 200 OK"));
client.println(F("Content-Type: text/html"));
client.println(F("Connection: close"));
client.println(F("Refresh: 5"));
client.println();
client.println(F(""));
client.println(F(""));
int sensorReading = analogRead(0);
client.print(F("sensor reading is "));
client.print(sensorReading);
client.println(F("
"));
client.println(F(""));
break;

}
if ( c == '\n' )
clib = true;
else if ( c == '\r')
clib = false;

}
}

delay(1);
client.stop();
Serial.println("client disconected");
Ethernet.maintain();
}
}

serial port says :

client disconected
new client
GET / HTTP/1.1
Host: 192.168.1.177
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8

each time I try to start the web server by entering the ip address it hangs

void setup()
{
  Serial.begin(9600);
  while (!Serial) ;
  Ethernet.begin(mac,ip);
  server.begin();
  Serial.print("server is at :");
  Serial.println(Ethernet.localIP());
  pinMode(4, OUTPUT);
digitalWrite(4, HIGH);
}

Pin 10 is not defined to be an OUTPUT. If this is on a Uno or other 328 based Arduino, it must be. On a Mega, it is pin 53 that must be set as OUTPUT.