1

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

  • 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 '16 at 22:57
  • 1
    I hope somebody can come up with the solution – Embedded Geek Sep 10 '16 at 5:39
  • I copy-paste @Majenko's comment as the answer. Please, acept it to close your question. – user31481 Oct 28 '17 at 20:04
  • 1
    I get exception 29 when trying to do http.GET, but only when I'm using code that has another large object in memory. Looks like we're running out of memory to do the http.GET(). Now I'm looking for resources to look into that more deeply! – girnigoe Aug 8 '18 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.