Error 11 - Not Enough Memory Space

So I’ve been playing around with Wled ver 0.11.1 on an ESP32 dev board. After experimenting with the presets and reaching memory 50, I get the Error 11 message “Not enough space to save preset”. No segments were created.
The saved memories contain palettes as well as reversing and mirror effects however I thought you could potentially store up to 250 memories.
I did an OTA from ver 0.11 so has this update used up the remaining preset space or am I missing something?

I think you are at the limit with what you have.

Possibly so. Maybe the 250 presets can only be achieved with unmodified patterns. Hopefully Aircoookie can clarify this.

Hi!
You might very well be at the limit, 250 is only the theoretical max, if your filesystem is “full” (see below) before that point, it won’t let you save new presets.

Properties like mirror and reverse do not lead to presets taking up more space. If you have presets with multiple segments, that does take more space (about 200 bytes per extra segment).

Additionally, your preset file can only ever get as big as half the filesystem, as when modifying the file in the beginning (e.g. if you delete one of your first presets or change its name), the filesystem needs to create an entirely new copy of the file. It’s stupid design, but it is what it is.

You know what else is stupid design? My way of handling the file since I didn’t know about that limitation of LittleFS when I made the preset file handling code. When deleting a preset, it will just overwrite the JSON data with spaces. New presets that are smaller in size can then take up these spaces instead of making the preset file larger. Because of this design the preset file can never actually shrink, but I haven’t been able to figure out a better way yet (ideally not having spaces and shifting everything behind the deleted preset forward, thus shrinking the file)

Look in the info screen to see how big your FS is. I had a few cases where ESP32 users only had a 61kB filesystem because it somehow got corrupted. With a properly formatted filesystem, you do have 1500kB on ESP32, which should be enough to reach the 250 preset limit unless you have 16 segments in all of these preset slots.

You can also “defragment” the presets file if you deleted or edited a lot of presets. Just go to http://[WLED-IP]/edit, load the presets.json file, Ctrl+A its contents and paste them into Notepad++ or similar. Now replace every instance of two consecutive spaces ( ) with nothing, then copy it back into the edit page and save it. That might allow you to squeeze out a couple extra presets.

Hope this info helps a bit :slight_smile:

Many thanks for the detailed reply. I will experiment with some of your suggestions.

You can see from my screenshot that I do only have a 61 KB filesystem with about half of it currently occupied. It would seem that I have the same issue as some of your other ESP32 users.
The original install was from a new unused ESP32 to ver 0.11 which I then updated via OTA to 0.11.1 I then started adding presets with no deleted or edited entries until I hit the 49 preset limit.

I will try another Esp32 and install the 0.11.1 binary directly from the PC. I will also duplicate the test on a fully erased ESP8266 and see what happens.

1 Like

Completed two further flashes on two different esp32 dev boards however still only getting a 61kb filesystem size.
One 0.11.1 image was compiled by myself and the other was the latest binary from your GitHub. Both were erased and flashed using esp flasher 1.3.0
I’m definitely not seeing a 1500kb filesystem as suggested.

Did you erase the bootloader too?

No. I wasn’t aware you had to do this on each new esp32 flash. If it’s a requirement to fix this issue what is the best way of erasing the bootloader? Esp flasher writes the bootloader however not sure if it erases it and re-writes on subsequent flashes.
I’m not seeing this issue on esp8266 binaries.

I believe it could be a flasher specific problem, that’s why I only recommend esptool despite it being a command line tool.

Try if flashing this modified 0.11.0 binary helps: No WLED-AP

Thanks…I will swap over to using esptool from now on. I’ve never had any issues with home flasher until I started using esp32’s.
I will also try your modified binary on another esp32.

Happy Holidays…

Hello, is the problem is resolve with esptool ? I have the same problem. thanks

No. When your file system is full, it is full.
The only remedy is deleting presets.json file and starting from scratch or buying an ESP with larger flash size.

I bought a esp32 with larger flash size and it’s the same…I will try cancelling space in the file. Thanks

You need correct partition size for larger flash memory.
It requires you to upload partition table to flash memory using esptool.

I’ve been using an ESP32 D1 mini with 4MB flash and running out of memory for presets due to pixel art. If I go with an 8MB flash ESP32 like this one,
https://a.aliexpress.com/_mtUWq56, will I gain around 2MB (1/2 of 4MB) for presets still with 250 max?

EDIT: I checked the Filesystem size on my ESP32 D1 Minis and they showed only the 61kb of memory. I could get WLED ESP-Flasher to flash the esp32_bootloader, esp32_bootloader_v4, or the 0110_esp32_combined bins. It gave the following error, “Unexpected error: The firmware binary is invalid (magic byte=FF, should be E9)” for on all those bins. I had to install esptool through pip to write the bin. I ended up with 983kB of Filesystem now, which is an order of magnitude improvement that what I had before. Lets see how quickly, I will fill it up. Is there anything that I can do to get it closer to the 1500kB number? I did an erase_flash and then rewrote the bootloader and firmware bins and still show 983kB.