Pages: 1 [2]   Go Down
Author Topic: Arduino Ethernet shield  (Read 1864 times)
0 Members and 1 Guest are viewing this topic.
Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 115
Posts: 5360
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Probably not. That is my thread. I am the user that found the solution. The obvious symptoms of that would be a lockup in a "while(client.available())" loop.

That is the 605 bug.
http://code.google.com/p/arduino/issues/detail?id=605
Logged

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

Maybe it's lockup in the following loop and is that the reason that it is not responding..?

Code:
while (client.connected()) {
      if (client.available()) {

        if(!sentHeader){
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          sentHeader = true;
        }

        char c = client.read();

        if(reading && c == ' ') reading = false;
        if(c == '?') reading = true; //found the ?, begin reading the info

        if(reading){
          readstring += c;
        }
       

        if (c == '\n' && currentLineIsBlank)  break;

        if (c == '\n') {
          currentLineIsBlank = true;
        }else if (c != '\r') {
          currentLineIsBlank = false;
        }
      }

       
         }
Logged

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

Change the if to while. That seems to work much better.
Code:
while (client.connected()) {
      while (client.available()) {
Logged

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

thank you smiley
Logged

Pages: 1 [2]   Go Up
Jump to: