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.
#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");
}
}