ESPhome freezes during compile

Exactly the same issues with me, Pi3b+. I have to power cycle the Pi each time, so now I do a restart of Hassio and then compile.
Mine usually dies at Compiling /data/deta_rewireable_1/.pioenvs/deta_rewireable_1/src/esphome/components/api/api_server.cpp.o
I do have my unifi controller plugin on hassio too. Can’t really stop it to work on esphome as I need to always check out which IP the device I’m flashing is connecting as. They have to work at the same time lol

Worth it to upgrade to Pi 4 or go straight to NUC? Obviously if I can get away with the Pi 4 then I’d be happy

I do not have unifi controller and the situation is the same…

Happened to just have the same issue. Reboot solved it. Thanks!

I was having this problem I’d estimate about 30% of the time I went to compile/upload on my pi3b+. It was frustrating, but in the end I guess tolerable since (luckily?) all of those improper power downs didn’t end up corrupting my drive.

Finally last week I upgraded from a pi3b+ to a pi4, and I’ve had nothing but success with compile/upload ever since (well over 10 good uploads in a row and counting… pi3 would never do more than a few before crashing). Not only is the crashing gone, it also compiles about 4x faster than the pi3. An indicator of how easily the pi4 handles the task… pi3 all 3 load averages went to 2 to 3 right after a compile, where as pi4 stays cool and usually loads are 2/1/1 post compile. Pi4 is a beast comparatively… totally overkill for most ha uses, except for esphome compiling lol. Of course, the huge plus is no more risky power downs to corrupt my drives. :slight_smile:

Same situation here, without the unifi controller (I have it on an Unifi hardware cloud key controller). It gets stuck on api_server.cpp, it started a couple days ago, and now it’s almost all compiles. Obviously, reboot after reboot, I managed to damage the homeassistant filesystem.

Hi.

I’ve always had this problem in my Raspberry Pi 3 B+, but i dont want to change it only for this problem. Everything works great except this.

I found a clue about it: In ESPHome you can change platformio options: https://esphome.io/components/esphome.html#platformio-options

Maybe, if you tell platformio that you are using a raspberry pi 3b, compiler adjust to rpi’s hardware not to causing freeze. Parameters we have to put are described here: https://docs.platformio.org/en/latest/boards/linux_arm/raspberrypi_3b.html

1 Like

Have the same issue. Compiling crashes Hassio… For me it runs on a VM sooo… Any ideas?

Perhaps the post above yours?

Jup. 1gb of ram is to little. i increased to 3 and it work ok :wink:

I have sort of the same issue. Running ESPHome in docker, when compiling it hangs just after

Looking for AsyncMqttClient-esphome library in registry

checked dns, but thats fine and working ok. it is not downloading any packages it seems. any idea?

I’m having the same issue (RPi3b) running HASSIO. If the RPi hasn’t enough guts (assuming it is not a stupid question) is there anyway to do the compiling work away from HomeAssistant say on a MAC or PC?

I’ve been having the same problem, this is like the fourth or fifth time it’s crashed. Takes down HA when it stops. I’m on Pi 3b+ and I have the unifi controller installed. Glad I’m not the only one.

You can install it on any machine that runs docker AFAIK.

1 Like

You can even do it with a Linux-live-usb-stick. :slight_smile: And on Windows, and, and, and

Just compile the *.bin file and then copy it to your RPi or use another tool to flash it (there is a nice windows tool for flashing).

Thanks @nickrout & @paddy0174 for your feedback. In the end I bit the bullet and upgraded to a RPi4…

I don’t want to be the messenger with bad news, but what I’m seeing on my Pi4, I would suggest looking at the alternatives in the near future… Can’t hurt to be prepared, imho it will not take very long, until the Pi4 gives in as well. :open_mouth: :open_mouth: :open_mouth: :joy: :joy: :joy:

Don’t misunderstand me, the Pi4 is great for HA, but for compiling with ESPHome, I already use my windows laptop… :laughing:

Hello, I have a RPi4 1Gb that I am running hassio in docker with only Grafana, Influxdb and ESPHome addons.
It freezes when trying to compile an esphome yaml.
Any idea how to make it work?
I also tried to compile directly from terminal but it also crashes.
Is there anybody with Rpi4 1Gb that EspHome works ok?

Not sure if anyone has tried the dev version of ESPHome but I just caused the problem when trying to compile on the dev version. :cry:

Increase the swap size.

Unfortunately the problem is still on my RPi4 even with swap size increased.
Probably it is quite random if the ram is filled up before the compilation is finished or something similar.