M5 Atom Echo Voice Assistant with Bluetooth Proxy

I setup my new M5 Atom Echo as a voice assistant following this post:

and thought it might be nice if the device also worked as a bluetooth proxy, since it will be sitting idle most of the time anyway. However, when I added bluetooth_proxy: to my yaml and installed, I just get a boot loop with the following error:

[00:42:33]assert failed: s_prepare_reserved_regions memory_layout_utils.c:100 (reserved[i + 1].start > reserved[i].start)
[00:42:33]
[00:42:33]
[00:42:33]Backtrace: 0x4008337e:0x3ffe3390 0x40091ff9:0x3ffe33b0 0x400980b5:0x3ffe33d0 0x40140d82:0x3ffe34f0 0x401409a2:0x3ffe3850 0x4013df67:0x3ffe3c00 0x40082ced:0x3ffe3c40 0x4007959c:0x3ffe3c80 |<-CORRUPTED
WARNING Found stack trace! Trying to decode it
WARNING Decoded 0x4008337e: panic_abort at /data/cache/platformio/packages/framework-espidf/components/esp_system/panic.c:408
WARNING Decoded 0x40091ff9: esp_system_abort at /data/cache/platformio/packages/framework-espidf/components/esp_system/esp_system.c:137
WARNING Decoded 0x400980b5: __assert_func at /data/cache/platformio/packages/framework-espidf/components/newlib/assert.c:85
WARNING Decoded 0x40140d82: s_prepare_reserved_regions at /data/cache/platformio/packages/framework-espidf/components/heap/port/memory_layout_utils.c:100
 (inlined by) soc_get_available_memory_regions at /data/cache/platformio/packages/framework-espidf/components/heap/port/memory_layout_utils.c:123
WARNING Decoded 0x401409a2: heap_caps_init at /data/cache/platformio/packages/framework-espidf/components/heap/heap_caps_init.c:65
WARNING Decoded 0x4013df67: do_core_init at /data/cache/platformio/packages/framework-espidf/components/esp_system/startup.c:253 (discriminator 3)
 (inlined by) start_cpu0_default at /data/cache/platformio/packages/framework-espidf/components/esp_system/startup.c:441 (discriminator 3)
WARNING Decoded 0x40082ced: call_start_cpu0 at /data/cache/platformio/packages/framework-espidf/components/esp_system/port/cpu_start.c:6

When I remove the proxy from the yaml, it works properly again. Is this just too much for this board to handle?
Before flashing, there was no indication that anything might be wrong, the yaml validation passed, and it proceded to compile.

I don’t know exactly what you have in your YAML, but I have a device that acts as a media player (so should be similar in some regards, while actually a little simpler) and adding BT Proxy was not possible in my case either. Can’t remember if I got a compile error or it just crashed on startup.

This is my config:

Did you try to have a clean build?

Yeah, with just my I2S speaker I had issues so I assume it isn’t possible. As I understand it, BT Proxy is quite resource intensive for an ESP and I assume audio is as well.

Cleaning the build files, and redoing the install seemed to work, thanks!

1 Like

Do you get good performance on both the audio with wakeword and the bluetooth proxy?
I’m looking into doing the same. Would you mind sharing your current configuration?

same here. Could someone share their configuration?

substitutions:
  name: "m5stack-atom-echo"
  friendly_name: M5Stack Atom Echo
packages:
  m5stack.atom-echo-voice-assistant: github://esphome/firmware/voice-assistant/m5stack-atom-echo.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}

logger:
api:
  encryption:
    key: <key>
ota:
  password: <pass>

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

esp32_ble_tracker:
  scan_parameters:
    active: true

bluetooth_proxy:
  active: true
2 Likes

Had also some issues when enabling the ble proxy. resetting and testing again now.

does anyone have a working config?

I’m having trouble with the amount of available flash, although in my opinion the Atom Echo has 4MB of flash, ESPHome always says that there is not enough flash.

I think there are a couple issues.

  1. The recently added OTA Update seems to use quite a bit of flash, so removing the http_request portions from that commit allowed me to complete the flash. I am still learning ESPHome, and don’t know how to do this sort of override from a package, so I just copied the whole yaml, and removed those portions, instead of importing the package like in my config a couple posts above. Happy to learn the “right” way to do this.

  2. Even once I got it to flash, it still didn’t work. I realized BLE Improv was causing the device to bootloop. Specific sections that needed to be removed:

(under wifi:)

  on_connect:
    - delay: 5s # Gives time for improv results to be transmitted
    - ble.disable:
  on_disconnect:
    - ble.enable:

and

esp32_improv:
  authorizer: none