ESP32 Bluetooth Proxy Won't Complete OTA Update

I’ve setup a bluetooth proxy using an ESP32-WROOM-32 I got from Microcenter. I’ve generally had issues with the basic install using the browser-based method on the ESPHome website, but I’ve always managed to get it to show up and for the proxy to at least APPEAR to be working. I believe this since I have some bluetooth sensors in a freezer, and before using the proxy it would report “Unavailable” on a regular basis. It always appeared to coincide with bluetooth on the Pi dropping.

Now my main issue is updating the device. I attempt to do so OTA, but am met with the following even after cleaning up build files. See below, and sorry for the length as the log I dumped was from immediately after the cleanup.

INFO Reading configuration /config/esphome/esp32-bluetooth-proxy-28ea70.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp32-bluetooth-proxy-28ea70 (board: esp32dev; framework: espidf; platform: platformio/espressif32 @ 5.2.0)
--------------------------------------------------------------------------------
Library Manager: Installing esphome/Improv @ 1.2.3
INFO Installing esphome/Improv @ 1.2.3
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40402.0 (4.4.2) 
 - tool-cmake @ 3.16.9 
 - tool-ninja @ 1.10.2 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
Reading CMake configuration...
Generating assembly for certificate bundle...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- Improv @ 1.2.3
Compiling /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/src/esphome/components/api/api_connection.o
...
Compiling /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/bootloader/xtensa/xt_trax.o
Archiving /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/bootloader/esp-idf/xtensa/libxtensa.a
Linking /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/bootloader.elf
Building /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/bootloader.bin
Creating esp32 image...
Successfully created esp32 image.
Generating partitions /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/partitions.bin
Generating an empty partition /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/ota_data_initial.bin
Compiling /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/lib0fc/Improv/improv.o
Archiving /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/lib0fc/libImprov.a
Linking /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/firmware.elf
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
*** [/data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/firmware.elf] Error 1
======================== [FAILED] Took 2258.93 seconds ========================

This is my first time dealing with any type of microcontroller, so I’m learning as I go. If I need to provide any other logs please let me know…I’ll try to figure out what to grab!

Thanks in advance!

Shouldn’t be done OTA. ESPHome 2022.12.0 - 14th December 2022 — ESPHome

I tried plugging into my computer and updating over serial, but that didn’t seem to help.

INFO Reading configuration /config/esphome/esp32-bluetooth-proxy-28ea70.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp32-bluetooth-proxy-28ea70 (board: esp32dev; framework: espidf; platform: platformio/espressif32 @ 5.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40402.0 (4.4.2) 
 - tool-cmake @ 3.16.9 
 - tool-ninja @ 1.10.2 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
Reading CMake configuration...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- Improv @ 1.2.3
Linking /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/firmware.elf
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
*** [/data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/firmware.elf] Error 1
========================= [FAILED] Took 295.92 seconds =========================

I thought I should try fresh, but I just can’t seem to get the web installer to work. I don’t know if I need to hold the boot button, when or how long to hold it, etc. I’ve been holding the boot button, pressing reset while still holding the boot button, then clicking through the menus until it begins installing and says “Preparing installation.” Then I release the boot button. The problem I have is eventually the web tool reports an error:

This should be simple, and I’m sure there’s something I’m missing.

Perhaps your yaml?

I’ve not manually modified it…below is the result of the one time I’ve gotten the web tool (ESPHome Bluetooth Proxy) to work.

substitutions:
  name: esp32-bluetooth-proxy-28ea70
packages:
  esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/esp32-generic.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

I went to Github and looked at the generic esp32 yaml file. I edited my existing file with to code below.

substitutions:
  name: esp32-bluetooth-proxy-28ea70
  wifi_ap_password: ""

esphome:
  name: ${name}
  name_add_mac_suffix: False
  project:
    name: esphome.bluetooth-proxy
    version: "1.0"

esp32:
  board: esp32dev
  framework:
    type: esp-idf

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    password: ${wifi_ap_password}

api:
logger:
ota:
improv_serial:
# captive_portal:

dashboard_import:
  package_import_url: github://esphome/bluetooth-proxies/esp32-generic.yaml@main

esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: true

bluetooth_proxy:
  active: true

button:
- platform: safe_mode
  name: Safe Mode Boot
  entity_category: diagnostic

I went to install while plugged into my computer, and I ended up with a similar error to before.

Updating /config/esphome/esp32-bluetooth-proxy-28ea70.yaml
------------------------------------------------------------

INFO Reading configuration /config/esphome/esp32-bluetooth-proxy-28ea70.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp32-bluetooth-proxy-28ea70 (board: esp32dev; framework: espidf; platform: platformio/espressif32 @ 5.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40402.0 (4.4.2) 
 - tool-cmake @ 3.16.9 
 - tool-ninja @ 1.10.2 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
Reading CMake configuration...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- Improv @ 1.2.3
Compiling /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/src/esphome/components/api/api_pb2.o
...
Compiling /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/bootloader/xtensa/xt_trax.o
Archiving /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/bootloader/esp-idf/xtensa/libxtensa.a
Linking /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/bootloader.elf
Building /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/bootloader.bin
Creating esp32 image...
Successfully created esp32 image.
Generating partitions /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/partitions.bin
Generating an empty partition /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/ota_data_initial.bin
Compiling /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/lib0fc/Improv/improv.o
Archiving /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/lib0fc/libImprov.a
Linking /data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/firmware.elf
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
*** [/data/esp32-bluetooth-proxy-28ea70/.pioenvs/esp32-bluetooth-proxy-28ea70/firmware.elf] Error 1
======================== [FAILED] Took 2012.97 seconds ========================
 [ERROR] /config/esphome/esp32-bluetooth-proxy-28ea70.yaml 



======================== [SUMMARY] ========================
  - /config/esphome/esp32-bluetooth-proxy-28ea70.yaml: FAILED

Any help is greatly appreciated!