-->
Page 1 of 1

Exception 29 while sending values from HTTP GET to esp12f

PostPosted: Sun Jul 10, 2016 12:23 pm
by anujmattoo
I am working on HTTP GET Request. I have created ESP wifi as web server. It creates a access point with IP address : 192.168.4.1 When my android app is connected to web server, it sends values every 50ms on 192.168.4.1/R"VALUE". Value is integer type (0~1023). Example :- 192.168.4.1/R546

However, it is working fine when I send values every 1s, but esp crashes, when IP is hit every 5ms second. I have captured the crash detail on serial monitor. Attaching the file and code as well. Kindly help.

Code: Select all#include <ESP8266WiFi.h>
#include <EEPROM.h>
#include <ESP8266WebServer.h>

#define RED_LED     12

WiFiServer server(80); //Initialize the server on Port 80

char myTestUrl[100];

void setup()
{

  EEPROM.begin(512);
  Serial.begin(9600); //Start communication between the ESP8266-12E and the monitor window

  WiFi.mode(WIFI_AP); //Our ESP8266-12E is an AccessPoint
  WiFi.softAP("LED_Downlight1", "12345678"); // Provide the (SSID, password); .
  server.begin(); // Start the HTTP Server

  IPAddress HTTPS_ServerIP = WiFi.softAPIP(); // Obtain the IP of the Server
  Serial.print("Server IP is: "); // Print the IP to the monitor window
  Serial.println(HTTPS_ServerIP);
}


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

  String request = client.readStringUntil('\r');
  //Serial.print(request);

  request.toCharArray(myTestUrl, 100);

  char *Red = strstr(myTestUrl, "/R");
  if (Red)
  {
    int RedValue  = atoi(Red + 2);
    analogWrite(RED_LED, RedValue);
    Serial.print("Red: ");
    Serial.print(" ");
    Serial.print(RedValue);
    Serial.print("\n");

    int SetRedValue = (RedValue / 4);
    EEPROM.write(0, SetRedValue);

    EEPROM.commit();

    Serial.print("Red Memory Write :");
    Serial.print(" ");
    Serial.print(SetRedValue);
    Serial.print("\n \n");

  }
}

Re: Exception 29 while sending values from HTTP GET to esp12

PostPosted: Sun Jul 10, 2016 5:05 pm
by martinayotte
You should install EspExceptionDecoder from https://github.com/me-no-dev/EspExceptionDecoder to get more meaningful stacktrace.

Re: Exception 29 while sending values from HTTP GET to esp12

PostPosted: Mon Jul 11, 2016 2:01 am
by Me-no-dev

Re: Exception 29 while sending values from HTTP GET to esp12

PostPosted: Mon Jul 11, 2016 2:38 am
by Pablo2048
Maybe it is problem with TCP state FIN WAIT. If you send request each 5ms, the TCP is unable to close and free previously allocated socket and has to create a new one - so after few requests there is not enough memory for new socket. Try to use websocket if you want to send values faster than 1 sec...