-->
Page 1 of 2

WiFiManager serving files from filesystem example

PostPosted: Mon Feb 05, 2018 5:35 pm
by renegade
Hi everyone. I am usng this WiFi Manager library : https://github.com/tzapu/WiFiManager/

It's good, but I would vastly prefer to serve my html, css & js from the flash memory.

Can somebody offer an example sketch which serves the in memory pages, from the filesystem instead of the ones in memory?

I have read and tried changing the server to a SPIFFS server(https://github.com/r-downing/SPIFFSReadServer) rather than a ESP8266WebServer, but the result is never stable. Please offer an example of how this can be done.

My current effort is attached to this post.

Please help!

Re: WiFiManager serving files from filesystem example

PostPosted: Mon Feb 05, 2018 7:27 pm
by rudy
https://github.com/gmag11/FSBrowserNG

or for a simpler one look in the example files for ESP8266WebServer - FSBrowser
https://github.com/esp8266/Arduino/tree ... /FSBrowser

I hope you are taking into account the limited number of simultaneous connections the ESP8266 can handle. Browsers will fire off as many requests as it can and that will make the ESP choke. If you have more than a few files to serve then you need to consider how to prevent the browser from calling all of them at once.

Re: WiFiManager serving files from filesystem example

PostPosted: Tue Feb 06, 2018 4:00 am
by renegade
Hi Rudy, ahhh! This may be the problem. How would you advise doing them one at a time? I have the html, 2 css files and a js.

A guess that would likely result in 3 browser requests in very quick succession. I will also need to somehow mash the WiFiManager together with this FSBrowser library by the looks of things. Sound right?

Re: WiFiManager serving files from filesystem example

PostPosted: Tue Feb 06, 2018 4:12 am
by Pablo2048
You can also use AsyncWebServer ( https://github.com/me-no-dev/ESPAsyncWebServer ), use this with serveStatic example... CSS files can be joined (actually html+css+js can be joined). IMHO AsyncWebServer can handle upto 5 connections (limit of ESP SDK/Core).