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 -> http://bit.ly/pio-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 -> 10.0.1.127
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)
Nothing fancy and nothing advanced and keep in mind that the code used to download.
I tried a couple of things.
I did remove everything below the ota: line - still I get error message
I tried another ESP01 and do get the same error message.
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)
I rebooted my Raspberry Pi where I run HassIO but I doesn’t change anything.
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.
Checking size /data/plugstripgosund6_pcall/.pioenvs/plugstripgosund6_pcall/firmware.elf
RAM: [===== ] 48.1% (used 39408 bytes from 81920 bytes)
Flash: [==== ] 42.7% (used 436740 bytes from 1023984 bytes)
Creating BIN file "/data/plugstripgosund6_pcall/.pioenvs/plugstripgosund6_pcall/firmware.bin" using "/root/.platformio/packages/framework-arduinoespressif8266/bootloaders/eboot/eboot.elf" and "/data/plugstripgosund6_pcall/.pioenvs/plugstripgosund6_pcall/firmware.elf"
======================== [SUCCESS] Took 122.55 seconds ========================
INFO Successfully compiled program.
INFO Resolving IP address of plugstripgosund6_pcall.local
INFO ->
INFO Uploading /data/plugstripgosund6_pcall/.pioenvs/plugstripgosund6_pcall/firmware.bin (440896 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)
What about math here? 436’740 +440’896 < 1’023’894
Hi Guys, I had same issue. With black esp01 with 1MB @belowe was right.
You need to change board to esp01_1m, generate BIN file or reflash ESP thru USB.
Because your old FW allocate memory like 512K.
After reflashing with 1MB version OTA starts working (after first reset).
This script will compile to around 300KB. Once this script is uploaded in flash, a script with upto 700KB can be uploaded through OTA to a 1MB flash!
Upload this script first. Then restart the controller and choose “ESP01S-EMPTY-OTA” as the port and upload the new updated script that you wish to upload!
IMPORTANT: Firewall must be turned OFF during OTA uploads.
Thank you for this solution. I’ve got both 512k and 1M ESP01’s, and for some odd reason only the 512k size will work on a breadboard with the ESPHome firmware. The 1M ones will not, even though the program and wiring is the same. So this is a good way around not being able to do the OTA when updating the 512k modules. FYI - The 1M modules will work when in the programmer, just not on the breadboard.
I ran into the same issue.
The problem is that I cannot reprogram the eps8266-01 using USB anymore for some reason. (Tried many options and configs)
I can connect to the device using epshome, but when I reprogram it using OTA I get this error
INFO Successfully compiled program.
INFO Resolving IP address of temperatuur-regeling.local
INFO -> 192.168.0.74
INFO Uploading /data/temperatuur-regeling/.pioenvs/temperatuur-regeling/firmware.bin (333280 bytes)
INFO Compressed to 239139 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)
My esp YAML is like this:
esphome:
name: temperatuur-regeling
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
#api:
# encryption:
# key: "kgkghhjgjhgjghj="
ota:
password: "gkgkgkgkgkgjkkg"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
# ap:
# ssid: "Temperatuur-Regeling"
# password: "kjhkjkhkkg"
#captive_portal:
# Stuff to control this relay:
Well, your config is literally minimal. if that cannot fit then something is really wrong.
That said, each time I run into this issue that I cannot upload firmware over OTA, I use ESPHome Flasher to do it via serial port. It nails it every time as it first erases memory, and clears space, and then writes new firmware.
If that does not work for you either, then maybe that boards is done.