Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By tahitibob353
#40973 Hi
I use the arduino IDE and the ESP8266-01 module.
The ESP module is powered by a dedicated 5V power supply and a ld1117v33.
I noticed that the embedded web server does not respond to all incoming requests, or the requests do not end correctly.
Sometimes, the requests are processed correctly.
It is randomly.
The module is not very reliable.
Did you experience such of behaviour ?

I only modified the webserver sample code :
Code: Select all#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

ESP8266WebServer server(80);

char htmlcontent[5000] = {0};
int htmllength = 0;

void espadon ( void ) {
    Serial.println("start ...");
    htmllength += snprintf( htmlcontent + htmllength , sizeof( htmlcontent ) , "<html><head></head><body><h1>blabla</h1><table>" );
    int i = 0;
    for( uint8_t pin = 0 ; pin < 20 ; pin++ ) {
        i = pin ;
        htmllength += snprintf( htmlcontent + htmllength , sizeof( htmlcontent ) , "<tr><td>%d</td><td>%d</td>" , pin , i );
        htmllength += snprintf( htmlcontent + htmllength , sizeof( htmlcontent ) , "<td><a href=\"/rdigitalwrite/%d/1\">on</a></td>" , pin );
        htmllength += snprintf( htmlcontent + htmllength , sizeof( htmlcontent ) , "<td><a href=\"/rdigitalwrite/%d/0\">off</a></td></tr>" , pin );
    }
    htmllength += snprintf( htmlcontent + htmllength , sizeof( htmlcontent ) , "</table></body></html>" );
    Serial.println("before server.send");
    server.send( 200 , "text/html", htmlcontent);
    Serial.println("after server.send");
    htmllength = 0;
    memset( htmlcontent , 0 , sizeof( htmlcontent ) );
    Serial.println("end ...");
}

void setup(void){
  Serial.begin(9600);
  Serial.println("Setup ...");
  server.on("/test", espadon );
  server.begin();
  Serial.println("HTTP server started");
}
void loop(void){
  server.handleClient();
}


Thanks for your help.

David.