- Fri Feb 19, 2016 12:55 pm
#41474
I've been playing with an Adafruit Huzzah for just over a month or so, and was in a similar situation as you- here are my observations so far: (I'm nowhere near an expert on any of this)
From what I know, you have a couple of options on how to serve up files to a web client from the esp webserver. You could use a string to serve up the most basic pieces of a webpage.
Then, when you exhaust that, another way (this is how I started) would be to use progmem to store the html/css/js, but this can have issues when things start to get large just like when using strings. Also, images pose a challenge.
The last way (and I would argue, probably the preferred way) is to use SPIFFS to store the html/css/js/images, and use FS.h to get them and stream them to the client. Note, I've still got to experiment here, but I think you can also serve up gzipped files which I would think would allow for some really large pages to get served...
I started out with string to do a "hello world", then moved to using progmem, but started running into random E:M reset stability issues (likely because I was running out of stack/heap), and have just yesterday I switched over to using SPIFFS, and things are much more stable now for me.