ESP does not have enough space to store OTA file

Tags: #<Tag:0x00007f7c5def7f50>

I’ve spend some time debugging an issue with an AM2302 temperature and humidity sensor connected to an ESP01.
Without having done anything to my code I suddenly started getting this error message when trying to download code:

Memory Usage ->
DATA: [==== ] 39.6% (used 32424 bytes from 81920 bytes)
PROGRAM: [======= ] 65.3% (used 326480 bytes from 499696 bytes)
========================= [SUCCESS] Took 9.83 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of raindance_esp1_temp3.local
INFO Uploading /data/raindance_esp1_temp3/.pioenvs/raindance_esp1_temp3/firmware.bin (330624 bytes)
ERROR Error binary size: Error: ESP does not have enough space to store OTA file. Please try flashing a minimal firmware (remove everything except ota)

Here is the code:

  name: raindance_esp1_temp2
  platform: ESP8266
  board: esp01

  ssid: !secret wifi_ssid
  password: !secret wifi_password

# Enable logging

# Enable Home Assistant API


  - platform: dht
    pin: GPIO2
    model: AUTO_DETECT
    update_interval: 10s
      name: "Temperature"
        - sliding_window_moving_average:
            window_size: 15
            send_every: 15
            send_first_at: 15
      name: "Humidity"
        - sliding_window_moving_average:
            window_size: 15
            send_every: 15
            send_first_at: 15

Nothing fancy and nothing advanced and keep in mind that the code used to download.
I tried a couple of things.

  1. I did remove everything below the ota: line - still I get error message
  2. I tried another ESP01 and do get the same error message.
  3. I tried to download the code over a serial port but the download appear to hang after compilation but before download starts. (I use the serial port to initialize the ESP01 the first time and that works OK)
  4. I rebooted my Raspberry Pi where I run HassIO but I doesn’t change anything.

I am running 0.97

Any suggestions?


So I thought I wanted to give an update in case anyone else should run into similar issues.

As mentioned in my post I did try several things including rebooting HassIO. I did phrase this as rebooting my Raspberry Pi but perhaps this is technically not true - I don’t know exactly what Restarting HassIo does so…
Eventually I power cycled my Raspberry Pi and while it didn’t solve the issue it did appear to address item 3 in my list of things that I had tried meaning I now were able to download the code via USB without experiencing any problems.
And after successfully having downloaded the code over USB I could subsequently download the same code OTA.

1 Like

I wonder if there was an incompatibility related to OTA between the version that was on the device and the version you’re trying to flash.

Just figured this one out. So the ESP-01 comes in two flavors. 512k of flash and 1M of flash. You have selected the 512k version with

board: esp01

If this is correct, you’re out of luck for flashing OTA. If, like me, you actually have the 1M version change your board to:

board: esp01_1m

Reflash over usb and then OTA should work

1 Like

This also solves my problem (ERROR Uploading YAML via OTA: [Errno 104])

Today I figured that I have the 512K version of the ESP-01 (blue one) :man_facepalming: