Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am getting exception 29 every time I make request to HTTP using GET function. I am requesting HTTP every 20-30ms but using Millis I am only reading request at 100ms in order to avoid any overflow or incomplete close connection, but still I am getting an exception after reading some 100 request. What should I do now?

Here is my code and my Exception Decoder result as well

#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>

#define RED_LED     12

WiFiServer server(80);

const char* ssid = "Led_Downlight1";
char GetString[100];
unsigned int long RedValue;
unsigned long previousMillis = 0;        
const long interval = 100;         

void setup()
{

  Serial.begin(115200); //Start communication between the ESP8266-12E and the monitor window
  Serial.println();
  Serial.print("Configuring access point...");

  WiFi.mode(WIFI_AP);
  WiFi.disconnect();
  delay(100);
  WiFi.softAP(ssid);
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.print("SoftAP IP: ");
  Serial.println(WiFi.softAPIP());

  server.begin();
  Serial.println("Server started");
}

void loop()
{

  WiFiClient client = server.available();
  if (!client)
  {
    return;
  }

  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis >= interval)
  {

  Serial.println("Somebody has connected :)");

  previousMillis = currentMillis;
  String incoming = client.readStringUntil('\r');
  Serial.println(incoming);
  client.flush();
  incoming.toCharArray(GetString, 100);    

  char *get = strtok(GetString, " ");
  char *request = strtok(NULL, " ");
  char *rtype = strtok(NULL, " ");

  if (request != NULL)
  {
    char *part = strtok(request, "/");
    bool seenSTA = false;
    bool seenRGBW = false;

    while (part)
    {
      if (!strcmp(part, "RGBW"))
      {
        seenRGBW = true; 
      }

      else if (seenRGBW)
      {
        if (!strncmp(part, "R=", 2))
        {          
          RedValue  = atoi(part + 2);
          analogWrite(RED_LED, RedValue);
          Serial.print("\n");
          Serial.print("Red:");
          Serial.print(RedValue);

          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println(""); //  do not forget this one
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
          client.println("Red value: ");
          client.println(RedValue);
          client.println("<br><br>");
          client.println("</html>");

          Serial.println("Client disonnected");
        }
      }
      part = strtok(NULL, "/");
    }
  }
 }
}

enter image description here enter image description here

share|improve this question
    
You have raised this same question as an issue with the authors of the ESP8266 core. If they can't answer it what hope do we have? – Majenko Sep 9 at 22:57
    
I hope somebody can come up with the solution – Embedded Geek Sep 10 at 5:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.