Page 1 of 1

Best Way to Serve HTML/Javascript

Posted: Mon Jan 01, 2024 8:37 pm
by dlaroche
I am working on a project that involves an ESP32-C3 that utilizes wifi functionality to serve a HTML/Javascript page. However, what is the best way to store the HTML/Javascript/CSS pages on the ESP32-C3? I have read that SPIFFS can aide with this, however, I don't have an external EPROM for the filesystem to be placed on to.

Is it possible to have the HTML/Javascript/CSS pages read by the compiler, and then placed into the memory available on the ESP32-C3? If so, can you assist me with some good indicators for me to learn some more on this topic?

Thanks,
Dustin LaRoche

Re: Best Way to Serve HTML/Javascript

Posted: Tue Jan 02, 2024 11:06 pm
by MicroController
dlaroche wrote:
Mon Jan 01, 2024 8:37 pm
I am working on a project that involves an ESP32-C3 that utilizes wifi functionality to serve a HTML/Javascript page. However, what is the best way to store the HTML/Javascript/CSS pages on the ESP32-C3?
There are multiple options :)
I have read that SPIFFS can aide with this, however, I don't have an external EPROM for the filesystem to be placed on to.
You don't need external memory; a SPIFFS can happily live in a partition of the ESP's flash memory, see e.g. https://github.com/espressif/esp-idf/tr ... age/spiffs
Is it possible to have the HTML/Javascript/CSS pages read by the compiler, and then placed into the memory available on the ESP32-C3?
Yes, also possible: https://docs.espressif.com/projects/esp ... inary-data
Downside to this is that the files basically become woven into your application, which requires the whole application to be rebuilt and flashed whenever you want to update any of the data files.