Unable to successfully adopt Voice Assistant on M5Stack Atom Echo via ESP Home

I’ve been trying to install the latest Voice Assistant on my Atom Echo without much luck. Below are the steps I’ve followed so I’m hoping someone can point out an obvious mistake that I’m not seeing please. :slight_smile:

My HA is running 2024.7.3 in a docker container.
ESPHome is another docker container running 2024.7.1
I’m flashing the Atom Echo via USB on MacOS using Chrome connected via https to the ESPHome web interface.

  • Install Voice Assistant onto M5Stack Atom Echo from Ready-Made Projects — ESPHome
  • Installed via USB on MacOS via Chrome
  • Asks if I want to install Voice Assistant 24.7.4.1
  • Configured wifi
  • Skip Add to home assistant because this option tries to install ESP Home Integration again which I already have
  • Close popup
  • Within ESPHome web GUI, Adopt new device (having removed the previous device card)
  • Gave it a name
  • Configuration Created. Presents encryption key and the Install button
  • Clicked Install (no option to install via USB so presuming it automatically installs wirelessly) results in the following error:
INFO Successfully compiled program.
INFO Connecting to 192.168.199.160
INFO Uploading /config/.esphome/build/m5stack-atom-echo-889484/.pioenvs/m5stack-atom-echo-889484/firmware.bin (1835616 bytes)
ERROR Error binary size: Error: The OTA partition on the ESP is too small. ESPHome needs to resize this partition, please flash over USB.
  • So I click Close
  • I proceed to install via USB by clicking on the 3-dots on the M5Stack Atom Echo card and select Install
  • Choose “Plug into this computer”
  • Select the M5Stack cu-usbserial Paired device and then Connect
  • Circular animation while it Prepares installation, then Installing
  • When finished, I look at the device logs via USB and find it in a boot loop:
[20:10:05]ets Jun  8 2016 00:22:57
[20:10:05]
[20:10:05]rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[20:10:05]configsip: 188777542, SPIWP:0xee
[20:10:05]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[20:10:05]mode:DIO, clock div:2
[20:10:05]load:0x3fff0030,len:6652
[20:10:05]ho 0 tail 12 room 4
[20:10:05]load:0x40078000,len:15052
[20:10:05]load:0x40080400,len:3836
[20:10:05]entry 0x4008069c
[20:10:05]I (57) boot: ESP-IDF 4.4.7 2nd stage bootloader
[20:10:05]I (57) boot: compile time 18:39:07
[20:10:05]I (58) boot: Multicore bootloader
[20:10:05]I (61) boot: chip revision: v1.1
[20:10:05]I (65) boot.esp32: SPI Speed      : 40MHz
[20:10:05]I (70) boot.esp32: SPI Mode       : DIO
[20:10:05]I (74) boot.esp32: SPI Flash Size : 4MB
[20:10:05]I (79) boot: Enabling RNG early entropy source...
[20:10:05]I (84) boot: Partition Table:
[20:10:05]I (88) boot: ## Label            Usage          Type ST Offset   Length
[20:10:05]I (95) boot:  0 otadata          OTA data         01 00 00009000 00002000
[20:10:05]I (103) boot:  1 phy_init         RF data          01 01 0000b000 00001000
[20:10:05]I (110) boot:  2 app0             OTA app          00 10 00010000 001c0000
[20:10:05]I (118) boot:  3 app1             OTA app          00 11 001d0000 001c0000
[20:10:06]I (125) boot:  4 nvs              WiFi data        01 02 00390000 0006d000
[20:10:06]I (133) boot: End of partition table
[20:10:06]I (137) boot: No factory image, trying OTA 0
[20:10:06]I (142) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=65898h (415896) map
[20:10:06]I (301) esp_image: segment 1: paddr=000758c0 vaddr=3ffbdb60 size=051bch ( 20924) load
[20:10:06]I (310) esp_image: segment 2: paddr=0007aa84 vaddr=40080000 size=05594h ( 21908) load
[20:10:06]I (319) esp_image: segment 3: paddr=00080020 vaddr=400d0020 size=136820h (1271840) map
[20:10:06]I (779) esp_image: segment 4: paddr=001b6848 vaddr=40085594 size=199f0h (104944) load
[20:10:06]E (823) esp_image: Image length 1835616 doesn't fit in partition length 1835008
[20:10:06]E (823) boot: OTA app partition slot 0 is not bootable
[20:10:06]E (825) esp_image: image at 0x1d0000 has invalid magic byte (nothing flashed here?)
[20:10:06]E (833) boot: OTA app partition slot 1 is not bootable
[20:10:06]E (839) boot: No bootable app partitions in the partition table
[20:10:06]ets Jun  8 2016 00:22:57
[20:10:06]
[20:10:06]rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
  • The yaml config file for this device in ESPHome is as follows:
substitutions:
  name: m5stack-atom-echo-889484
  friendly_name: M5Stack Atom Echo v2
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}
api:
  encryption:
    key: e/rP9OwLQhN7IDpTpsYszpxd7jmgk3qf0L5pSxGbQCA=

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  • As a test I attempted install via ESPHome and USB again
  • Installation finished, clicked close, look at USB logs and find it in a boot loop again.
  • Removed device from USB, plug back in, still boot loop
  • Tried installing via Ready-Made Projects — ESPHome again
  • Skip adding to home assistant
  • On ESPHome (I didn’t remove the device before reinstalling this time), I can view the logs via USB, but if I view wirelessly it shows the following error on repeat:
INFO Successfully connected to m5stack-atom-echo-889484 @ 192.168.199.160 in 0.104s
WARNING m5stack-atom-echo-889484 @ 192.168.199.160: Connection error occurred: m5stack-atom-echo-889484 @ 192.168.199.160: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.7.1).
INFO Successfully connected to m5stack-atom-echo-889484 @ 192.168.199.160 in 0.068s
WARNING m5stack-atom-echo-889484 @ 192.168.199.160: Connection error occurred: m5stack-atom-echo-889484 @ 192.168.199.160: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.7.1).
INFO Successfully connected to m5stack-atom-echo-889484 @ 192.168.199.160 in 0.113s
WARNING m5stack-atom-echo-889484 @ 192.168.199.160: Connection error occurred: m5stack-atom-echo-889484 @ 192.168.199.160: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.7.1).

Just before posting this I noticed that a new commit was added 9 hours ago (Add new adopted config for atom echo VA by jesserockz · Pull Request #244 · esphome/firmware · GitHub) which says “With the recent additions to the firmware, it got too large to OTA update”. I therefore tried a new adoption via ESPHome as I assumed it would pull the latest yaml file from GitHub via the following line, but it made no difference.

packages:
  m5stack.atom-echo-voice-assistant: github://esphome/firmware/voice-assistant/m5stack-atom-echo.yaml@main

Was my assumption correct or do I need to manually copy the yaml file contents to my own yaml file?
Ultimately, what am I doing wrong?

Hi @jarrah

I don’t think you’ve done anything wrong. It just doesn’t work.

I used the instructions here and got it working.

Thank you for your help, it was certainly worth a try but I still ended up in a boot loop (tried a couple of times with the suggested yaml)

Found the following issue that has the same boot loop problem: M5 Stack Atom Echo VA firmware does not install locally since a79c9fa - image too big. · Issue #227 · esphome/firmware · GitHub

The OP (HarvsG) created the PR that Asher in your link refers to.

Unfortunately I suspect a problem with my Atom Echo because even their yaml config results in a boot loop for me: (M5 Stack Atom Echo VA firmware does not install locally since a79c9fa - image too big. · Issue #227 · esphome/firmware · GitHub)

Plug the esp device into the computer running esphome.

I’ve managed to solve my problem by ensuring I “Clean build files” (found within the 3-dot menu for the device card) before attempting to install new changes to the yaml file.

I used the configuration found in the following post (same link as above), which hopefully will only be temporary until the fix is pushed to the main GitHub package file for Atom Echos.

What I didn’t originally realise is that there are two versions of the firmware for Atom Echos. I was wanting to try the new on-device wake word but all the Voice Assistant guides (here and here) use the standard package defined here:

packages:
  m5stack.atom-echo-voice-assistant: github://esphome/firmware/voice-assistant/m5stack-atom-echo.yaml@main

(source: firmware/voice-assistant/m5stack-atom-echo.yaml at 023267c64a6fad0bc7f7bbde5ae111cef0aba91a · esphome/firmware · GitHub)

If you want to use the new wake-word method announced a couple of weeks ago, you temporarily need this package (until this PR is merged):

packages:
  m5stack.atom-echo-wake-word-voice-assistant: github://HarvsG/firmware/wake-word-voice-assistant/m5stack-atom-echo.yaml@patch-3

(As noted in this issue, don’t Adopt the device until the above mentioned PR is merged)