#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
ESP8266WebServer server(80);
const char gui[] PROGMEM = ... (large char string)
const char vicii[] PROGMEM = ...(larger char string)
void KeyDown(){
}
void VICIIUpdates(){
}
...
void setup(){
...
server.on ( "/",[]() {
server.send ( 200, "text/html", gui);
});
server.on ( "/VICII.js",[]() {
server.send ( 200, "text/plain", vicii);
});
server.on ( "/VICIIRefresh", VICIIRefresh);
//on turning one of the following on the esp crashes on boot
// server.on ( "/VICIIUpdates", VICIIUpdates);
// server.on ( "/KeyDown", KeyDown);
server.onNotFound(handleNotFound);
...
}
But for the fact that it crash at boot time, it maybe another issue. We need more clues.
For page count, I have an sketch that has more than 10 server.on(), so I don't think the problem is there.
WiFi.begin(ssid, password);
If I comment out this line all is fine.... except I don't have wifi off course.
The HelloWebserver example sketch of the ESP8266WebServer library runs fine every time! Maybe because it lacks the large progmem declarations.
Attached the full sketch.
(PS, on using the command 'server.send_P()' the error 'ESP8266WebServer has no member named send_P' appears.)
NardJ wrote:(PS, on using the command 'server.send_P()' the error 'ESP8266WebServer has no member named send_P' appears.)
This is because you don't have the latest sources from 'staging', the commit has been done on July 24th, https://github.com/esp8266/Arduino/comm ... 03280c5c76