Error: ESP does not have enough space to store OTA file

Hi all!

I have a problem starting from today, all my ESPHome devices coult not be updated with the new 2025.3.1 Esp version…
Till now, everything was ok, all the updates were done successfully, but with this update, I get this error “Error: ESP does not have enough space to store OTA file”, anyone knows what is this about?

Thanks!

No experience, but could be that the compiled code with new version is slightly bigger…
What board you actually have and what board you have defined on your yaml?

It seems that finished file is larger than esp can cope with. Try clean build files if it helps.

This issue appear to all my Athom Human Presence devices

esp8266:
  board: esp8285

I have removed the web_server and seems that now it have space to update :smiley:

Generally good idea, if you don’t need it…

1 Like

This is concerning. If new versions of ESPHome are less efficient (take up more space) than the old ones that’s sort of a built-in obsolescence.

I have a number of 8266 devices, and they run great. I’d rather not replace them all. I’d also rather not remove the web server component. It’s a very handy check on how things are working, especially when developing or updating the firmware.

Is this change (taking up more space) documented somewhere? Is there some specific component which was re-written to be less efficient?

I have quite some of these old 8266’s installed, too. However, recently i only use esp32 for new projects, since they are not that much more expensive, while giving way more options (later when/if i need it). But old ones are working, so why waste them, i agree.

Regarding web server: it is a warning on esphome docs about web server eating a lot of resources, so it’s really not recommended unless really needed, since it can affect normal functioning of other things.

Are you sure it is less efficient, or is it just doing more things that you maybe don’t need?

I remember a time when the amount of resources an esp8266 has would have been considered a LOT for any computer. Now, because expectations have increased (there was no networking back then) what is considered a very minimal system has many orders of magnitude more everything.

This really is just an example/variant of: Parkinson's law - Wikipedia

I remember when this happened on Tasmota (many years ago). They created the minimal config to deal with it, but my configs were typically too complicated for even that to work. This is why I moved to the esp32. It has a lot more room for growth.

Your have several choices, which is right for you will depend on what’s most important to you. I generally just use USB/serial flash on esp8266. It works. If I need/want OTA, I use an esp32 and esphome.

OP has a board with 1MB flash, if yours are with 4MB you likely don’t have problems.
It’s kind of normal that some component improvements are asking a bit more memory. But for example web server and ota components let you choose the version to use.

You don’t need to update them with every EspHome version. If they work, leave them.

3 Likes

Well, if nothing I’m doing has changed, same YAML, same equipment, same functionality, and the new version uses more memory, then I’d call that less efficient. Why load things into memory I don’t need?

Yes, I know. It’s the way of the world. Developers develop on the latest and greatest hardware, and drag the users along with them when the code they develop doesn’t work on older or less robust devices. Some of us old-timers still remember when efficient coding was something to be proud of. Don’t worry, we’ll be gone soon enough.

Looks like I’m in luck. Specs say 4MB Flash, so…

I’m going to give it a try anyway. I’ve gotten over that urge to always be on the bleeding edge, but I still don’t like getting too far behind. That usually just means more work later.

When you are the developer of ALL the code you need, you get to decide exactly what you need and include only that.

There are very few (if any for real world projects) developers who get to do that, because everyone depends on something that someone else created. For each of those somethings there are many people saying, “this is great, but it would be even better if it only did this”. So, while you likely couldn’t care less about whatever caused the increase, there was likely someone somewhere that desperately needed it.

I have a mix of esp8266 devices, some are actually esp8265, which only have 1MB flash, so OTA is mostly out for them. I like having a web server on my devices even though I generally don’t use it.

I rarely update my esp devices, because once they are working they usually stay working. My network is secure enough that I don’t feel the need to update all my esp devices every month. I do update them on occasion and it can be a pain. This is the reason I started buying/using esp32 based devices. They have more resources to last longer. I am still using a SonOff TH16 that I first installed almost a decade ago and have no plans on upgrading the HW, since it is still doing what I intended it to do.

Yeah, I thought about treating my esp devices as one-off appliances. Develop once and never touch them again. Probably makes more sense than continually updating.

That said, and back to the OP topic, I (finally) noticed that the output of the compile command (I use the ESPHome CLI) has this information:

   RAM:   [====      ]  41.7% (used 34168 bytes from 81920 bytes)
   Flash: [====      ]  44.0% (used 450989 bytes from 1023984 bytes)

Nice! One less thing I have to worry about when I obsessively update! Except the number doesn’t match the specs on the NodeMCU boards I bought. But at least I know where I stand.

Why to update if you have working setup and you don’t need some new features? I have boards with 2022 version…

What you have on your board configuration?
I see frequently people here using 4MB boards with ESP01_1M on yaml.

How come? I have quite some esp8266 boards, pretty much all of them have “only” 1MB of flash, but they are all still OTA updateable. But generally i don’t have web server on those.
I also don’t update if there’s no need. It’s a good idea to read changelog of each update to see if affects any of your devices and update only if it does.

which spec?

The ESP8266 has a maximum of 1MB program space. It doesn’t matter how much flash space you have. An individual program can be no bigger then 1MB.

This spec shows the filesystem sizes that are possible for different flash sizes:
https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html#flash-layout

You will notice on the larger flash sizes that there is 2MB that is not file system (for the OTA option). That is 1MB for the running program and another 1MB for a second OTA updatable program.

It is possible to be a little creative and store data in the file system, but if you need more program space (for instructions, not just data) you will need to be very creative, or just use an esp32 or other chip with more space/capability.

I use Tasmota and it hasn’t fit in 512KB with all the sensors I use in a long time. I could choose to make a smaller binary, but then it wouldn’t have all the features I consider necessary.

esphome makes you including EVERYTHING you want, so it is easier to create a smaller binary. Tasmota has somewhat the opposite model. It includes support for many things by default and the sensors package includes code for MANY sensors. It is possible to remove any that you don’t need, but not necessarily easy. I never found it worth the trouble, since most of my sensors are in accessible locations. The one that is somewhat hard to access gets infrequent updates.

Your choices might be different, probably because they reflect different requirements.

I’m learning a LOT about ESP devices. Thanks!

What I loosely called “specs” was really just the listing on Amazon for the last 8266s I bought. We all know how accurate those can be.

The good news is the few ESP8266 devices I use all took the update, apparently with room to spare. That means I get to keep the web server installed on them.

Isn’t it that tasmota allows this update sequence if direct update fails:

  • install minimal firmware
  • install standard (wanted) update

If i remember correctly from back when i used it…