I've been busy with it most of the day, and i've made serious headway. Some question remains.
I was using the http updater in a project similar to the one i was developing, and there it works, in my current project it didn't seem to work. I couldn't figure out what the difference really was.
The OTA through the IDE works without issue. I can even show a progress bar on the ledstrips i'm controlling. http update seems more sensitive to available RAM memory, which was an issue before, but seems resolved.
I thought again this was the issue, but the free heap space actually shows more space on the current project. They both control ledstrips, and really the code is almost the same and directly from the httpUpdater example.
Anyway through the use of some output i determined that the upload actually does work (i even can tell from the new page information, so basically it does actually work, and also the function that is supposed to send the corfirmation page gets executed, but the infomation does not arrive back at the browser, probably because the connection has timed out.
The post update function
void handlePostUpdate(bool eth) {
String adminpass = AdminPW();
char password[adminpass.length() + 1];
adminpass.toCharArray(password, adminpass.length() + 1);
if (!serverAuthenticate("admin", password, eth))
return serverRequestAuthentication(eth);
if (Update.hasError()) {
updaterColor = 0xFF; // sets the color for the bar. it was set to 0xFF0000 but changing it will confirm an error
ShowEndBar(); // turns on all leds and then dims them a little a few moments after.
StreamString str;
Update.printError(str);
str;
String s = "";
s += FPSTR(pageheader);
s += FPSTR(htmlhead);
s += FPSTR(bodystyle);
s += F("<h1>Update Error </h1>");
s += str;
s += FPSTR(htmlclose);
serverSend(s, eth);
#if !defined(ARDUINO_ARCH_ESP32)
delay(500);
server.client().stop();
ESP.restart();
#endif
}
else {
ShowEndBar(); // here it is executed in the original color (red) which is what actually happens
String s = "";
s += FPSTR(pageheader);
s += FPSTR(htmlhead);
s += FPSTR(bodystyle);
s += F("<META http-equiv='refresh' content='20;URL=/'>Update Success ! Rebooting...\n");
s += (htmlclose);
#if defined(ARDUINO_ARCH_ESP32)
if (!eth) wifiServer.client().setNoDelay(true);
serverSend(s, eth);
if (eth) {
delay(1000);
ethernetServer.client().stop();
}
else {
delay(100);
wifiServer.client().stop();
}
#else
server.client().setNoDelay(true);
serverSend(s, eth); // here the page is sent, but it is rather late, it's a big sketch.
delay(100);
server.client().stop();
#endif
ESP.restart();
}
}
So the question i have is. Can i somehow tell the browser to leave the connection open ?
Or is there something else that is going wrong ?
If anyone needs more info on the sketch let me know. I think this is the relevant part, this is where it goes wrong and all still works until that time.