Unable to update OTA on bare ESP12e

I have built a temperature sensor using a esp12e which is attached to one of the white breakout boards. I am able to compile the firmware with esphome, and I am able to flash the compiled binary to the device using a serial connection, however when I try to update OTA, it always fails.

There error from the log is below:

Retrieving maximum program size /data/mabel/.pioenvs/mabel/firmware.elf
Checking size /data/mabel/.pioenvs/mabel/firmware.elf
Memory Usage → Redirecting...
DATA: [==== ] 41.1% (used 33704 bytes from 81920 bytes)
PROGRAM: [==== ] 35.9% (used 375240 bytes from 1044464 bytes)
========================= [SUCCESS] Took 12.91 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of mabel.local
INFO → 10.1.1.143
INFO Uploading /data/mabel/.pioenvs/mabel/firmware.bin (379392 bytes)
Uploading: [= ] 2%
ERROR Error sending data: [Errno 104] Connection reset by peer

If I take the compiled binary and try to upload it via the web interface I get the following:

Update Failed: ERROR[2]: Flash Erase Failed

Am I doing something wrong? I have no problem with any of my other devices, (Brilliant Smart plug, wemos D1, nodemcu, sonoff) but these bare modules appear to be an issue!

Have you tried setting a static IP for the device?

Is there enough room on the device to upload your new binary?

I havent tried a static IP, will try that and see if it makes a difference.

With regards to space, I would hope so, the only thing in the code, is a webserver and the code for the ds18b20. The nodemcu, has the same module on it, with alomst identical code, and it works without problems.

May you try without web server ? as stated in documentation web server takes a lot of place in memory ! Did you try a different flash mode ? here I always use in all my sketches:

board_flash_mode: dout

I can certainly try without webserver, however the same code works on a nodemcu, which has the same esp module on it!

I am also using the flashmode you have suggested to no avail.

I just removed the web server from the code, and reflashed using serial. I then tried to upload OTA, and the same issue occurs.

Am I missing something with how these devices need to be configured / wired?

What is a bare esp12e?
I have little experience yet but I can see that when you upload via serial the thing auto detects flash size.
When you do OTA I guess that won’t be the case
There are modules with 1Mb and 4Mb
Do you have the problem with many modules or only one? How many you have?
What is your config in esp home as module type?

When I say bare esp12e, I mean simply that, just the esp12 module, with the minimal required supporting components. Here is an image I found on ebay, which shows what I have: https://www.upgradeindustries.com/media/ebay/Photos/esp-breakout/esp_breakout_with_esp12_wm.jpg

After comparing the schematic of a wemos d1, and this breakout board, the only difference I can ascertain is that this breakout does not pull gpio2 up. Could it be as simple as that? I will add a pullup tonight and test, but other than that I am running out of ideas as to what I am doing wrong!

I have several of those without the white board which I downloaded esphome via serial once and the via ota many times.
The pull up / down “fixed” configures the Chile for startup only i.e. once it boots you can pull up / down other io no problem. So if you are in the middle of an OTA this could not be the problem.
How is your esphome device configured? I setup mine as

  platform: ESP8266
  board: nodemcu

This is what I am currently using:

platform: ESP8266
board: nodemcuv2
board_flash_mode: dout

I just found this in the github: https://github.com/esphome/issues/issues/69

Sounds like I am not alone!

Try nodemcu instead of nodemcuv2

thanks worked for me

Hi, how did you make it work?
Since awhile I’m not be able to update by ota, returning the following error [ERROR Error sending data: [Errno 104] Connection reset by peer]. I can log it and get it in my network, which means it is online.
Same error for D1 mini, nodeMCU and esp32.

Try compiling with wemos d1 mini lite, it works for me.

esp8266:
  board: d1_mini_lite