Updating the esp32-s3-box is failing

Every time I try to use ESPHome or the build-in HA update mechanism to update my esp32-s3-box after an ESPHome update, the esp-s3-box update fails. I’m guessing based on metrics during the update my 2GB HA Yellow is running out of RAM; but that’s just a guess.

Anyone have any experience or advice here?

1 Like

Where are your logs?

Great question. The logs from the device update specifically are:

INFO ESPHome 2024.3.0
INFO Reading configuration /config/esphome/esp32-s3-box-fd12c4.yaml...
INFO Updating https://github.com/esphome/firmware.git@main
INFO Updating https://github.com/esphome/esphome.git@pull/5230/head
WARNING GPIO0 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO45 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
INFO Updating https://github.com/espressif/[email protected]
INFO Updating submodules (components/esp-sr, components/esp-adf-libs) for https://github.com/espressif/[email protected]
INFO Updating https://github.com/espressif/[email protected]
INFO Updating https://github.com/espressif/esp-tflite-micro@None
INFO Compiling app...
Processing esp32-s3-box-fd12c4 (board: esp32s3box; framework: espidf; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash
 - framework-espidf @ 3.40406.240122 (4.4.6) 
 - tool-cmake @ 3.16.9 
 - tool-ninja @ 1.10.2 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
Dependency Graph
|-- Improv @ 1.2.3
|-- noise-c @ 0.1.4
Compiling .pioenvs/esp32-s3-box-fd12c4/src/esphome/components/esp_adf/speaker/esp_adf_speaker.o
Compiling .pioenvs/esp32-s3-box-fd12c4/src/esphome/components/improv_serial/improv_serial_component.o
Compiling .pioenvs/esp32-s3-box-fd12c4/src/esphome/components/ledc/ledc_output.o
Compiling .pioenvs/esp32-s3-box-fd12c4/src/esphome/components/light/addressable_light.o

…and just end.

Odd

I have seen failed with compiling on 512mb and 1G boards. Maybe now even 2G boards aren’t enough.

You could try on a PC with a decent amount of ram, although I am not entirely convinced that is the problem.

1 Like

Maybe this is a RTFM situation, and if so I apologize, but is there a relatively easy way to remotely update a ESP home device from a non Home Assistant machine? I have many machines with +8/16 GB of RAM that would probably be a better fit than the 2GB Home Assistant Yellow base station.

Came here to post on this same issue, with a very similar log that just stops in the middle of compiling.

Out of curiosity: How much RAM does your Home Assistant have to work with?

I’m running the HA Yellow, 2 GB

I assume you haven’t found the ESPHome installation page yet? :slight_smile:

Here you go:

https://esphome.io/guides/installing_esphome

This is a normal installation of Python (on whatever platform you like) and then ESPHome installed via pip. :slight_smile: Simple as that! :+1:

The dashboard is not part of the standard install, so you need to install this via pip as well. See here for the installation guide:

Have fun! :slight_smile:

1 Like

Well this is awesome, this option totally escaped me as I have been happily using the Home Assistant Add-on.

I’m still of the strong suspicion that I will need/want to upgrade my Home Assistant Yellow to an 8GB CM4 board, but maybe I can put that off for a while. Thanks, this gives me a starting point!

1 Like

This approach is supporting my theory that the Home Assistant voice assistant needs > 2 GB RAM to update/compile. Thanks again for the tip!

1 Like

Great it works! :+1:

I wouldn’t change the Yellow right now, you should first investigate a little further. :wink: I have some voice assistants running with ESPHome, they compile fine with 2GB RAM on a Pi4 (just tested, not my real installation).

The problem seems to be more related to the use of CPU power, than RAM. ESPHome can work with less RAM, but it pushes the CPU to its limits. This is only for a few seconds, but it’s sometimes enough to let the CPU freeze.

Would you mind posting your YAML for that device, so we can take a look and maybe find some things to optimize? :slight_smile:

But for the future, it wouldn’t be a bad idea to set some money aside to get something better. I personally am a big fan of these little PCs that could run Proxmox and HA-OS in a VM. I have a pre-owned pre-loved Lenovo ThinkCentre and am really happy with it! :slight_smile:

1 Like

It’s fairly standard, I believe, right directly from the initial setup/tutorial:

substitutions:
  name: esp32-s3-box-fd12c4
  friendly_name: ESP32 S3 Box
packages:
  esphome.voice-assistant: github://esphome/firmware/wake-word-voice-assistant/esp32-s3-box.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}
api:
  encryption:
    key: <<REDACTED>>


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

I’m running a bunch of other add-ons which all compete for that 2GB. I suspect 8GB would be a better amount of headroom for the system as a whole.

Ah, the standard script, I see! :slight_smile:

Just for reference, this is the direct link to the file you’re installing, so you can see, what really happens in your configuration:

But that is a file, that’s not that easy for ESPHome. If you compare it with the config for the small M5Stack Atoms, it’s huge. :rofl: It has more than double the lines (sure, line numbers doesn’t mean anything), and there is a lot more to compile, starting with the pictures and so on.

8GB are nice, but really not necessary. I’d go with 4GB, because these really are just peaks. HA in general (HA-OS) takes whatever RAM you throw at it, give it 8GB and it uses 8GB. :smiley:

As I said, it’s not a RAM question, more a CPU power question. I’m quite sure, 4GB are more than enough, but if you could up your CPU, that would make a difference.

As I said, these mini-PCs are quite nice, or if you want to go higher, look for a NUC. Both variants are relatively cheap to get on eBay as a pre-loved device. :wink:

1 Like

I just wanted to mention that I had to increase the RAM of the HA VM from 4GB to 6GB for the build to work and not get massively stuck. I am using esphome as an add-on in HA. My guess is that you need free 4GB when building this. Also, try a VM/machine restart before the build. It might help to run the build with a clean slate.

1 Like

What I (temporarily) wound up doing: I installed esphome via pip/venv into an /espaway directory (get it?) on an 8GB raspberry pi, moved all my .yaml files for my esphome devices into the project directory, and then wrote a bash script called upgrade.sh in the same directory:

#!/bin/bash

cd ~/espaway
source venv/bin/activate
pip install esphome --upgrade
esphome --dashboard update-all .

I ran this script when esphome devices need to be updated and it works great.

But the real solution is running ESPHome Add-on on an 8GB system.

2 Likes

I ended up getting the 8GB compute module and, voila, problem solved.

1 Like

This is the solution I have been looking for - thank you @jeffehobbs. I’ve been trying to upgrade my ESP32 S3 Box 3 Firmware along with some extra libs to control the volume, screen and activate the sensors and this was always dying on my Odroid N2+ 4GB - CPU was maxing out at 100% and memory slowly creeping up to full allocated and then it just hangs at random points during the cmake even when just using the plain vanila upgrade in Home Assistant with no additional customisations in the yaml.

The ESPHome.io web solution was not an option either as I wanted to be able to use my own custom yaml.

Seconded. This is the best solution, although reinstall and migration of backup is a little bit of a pain.

I have a Rpi 4 with 4GB, never had any issue with installing esphome nodes but I just cannot get the esp32-s3-box-3 to install without completely crashing the RPi.

I don’t want to shoot at the pianist, but if voice assistant is such a thing for HA, there is still massive work needed to make this usable. First, installing voice assistant image on the ESP thru epshome web is broken - you never get to the wifi setup except going back and forward multiple times until you finally by some magic get this wifi setup option. Then once you adopt your esp box in HA, trying to install it crashes your HA host due to undocumented clear system requirements.