Best Way to Serve HTML/Javascript

dlaroche
Posts: 3
Joined: Sun Aug 20, 2023 11:36 pm

Best Way to Serve HTML/Javascript

Postby dlaroche » 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? 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

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Best Way to Serve HTML/Javascript

Postby MicroController » Tue Jan 02, 2024 11:06 pm

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.

Who is online

Users browsing this forum: No registered users and 116 guests