Huge "simple-webserver" example

Hi.
Is it normal that simple-webserver uses 91% of flash?
Thanks

Retrieving maximum program size .pio/build/esp32doit-devkit-v1/firmware.elf
Checking size .pio/build/esp32doit-devkit-v1/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  12.1% (used 39788 bytes from 327680 bytes)
Flash: [========= ]  91.4% (used 1198645 bytes from 1310720 bytes)
Building .pio/build/esp32doit-devkit-v1/firmware.bin
esptool.py v3.1
Merged 1 ELF section

Hi jflopez,

total flash size of ESP32 is 4MB.

In your project, the partition where you are flashing your binary is ~1.3MB. Husarnet takes about 450kB. The quite big chunk is also used by AsyncTCP library used in the project and ESP Async WebServer (that are not necessary for Husarnet to work, but are well written, so it’s good to base your project on them)

You can gain extra flash by reducing spiffs partition in partitions_custom.csv file. Not all projects need it - https://randomnerdtutorials.com/install-esp32-filesystem-uploader-arduino-ide/
image

If you do not need OTA, then available flash for your app can be 2x larger right away.

I hope it helps.

Best,
Dominik

Ok, thanks.
Then, the answer is YES, it is normal that

#include "Arduino.h"
#include <WiFi.h>
#include <Husarnet.h>
#include <WebServer.h>

and a “hello world” web page make the binary ~1.1MB

I will work around partitions.

Thanks again.

1 Like