Pages: [1]   Go Down
Author Topic: webserver do not respond  (Read 1683 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-sad

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?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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("<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

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does anybody know? I wouldn't like to give it back or buy a new one... smiley-sad
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5856
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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




Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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....  smiley-sad
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5856
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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....

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 139
Posts: 5856
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys

I have the same problem smiley-sad 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????
Logged

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

Post your code. The below is a fix.

Code:
  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");
Logged

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

Pages: [1]   Go Up
Jump to: