ESPhome freezes during compile

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

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.

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.

What? It’s called memory management

1GB simply isn’t enough… I can see on my Pi4 (4GB), that it needs more than 1GB to compile correctly or at all.

I’d recommend to use your PC/Laptop for compiling. Then you can decide how you want to go ahead, uploading via a Windows FlashTool (ESPHomeFlasher) or uploading the binary file to your Pi and then forward it to the device. There is no need to compile it on your Pi, besides the comfort. :slight_smile:

I didn’t know it was possible but super easy to install: pip install esphome.

I just went into one of my more powerful Linux machines to set up an ESPHome installation thinking this way I could compile on it instead of my pi hoping to avoid this common situation of freezing the whole pi and forcing me to power cycle it. What I found out is that I would have to recreate the whole structure of my YAML files from my home assistant so that my inherited secrets file would work… I’m not really interested in copying out my secrets file to another machine.

I wish I could just compile these on the pi without the risk of it hanging the whole pi.

You don’t need to. ESPhome has it’s own secrets.yaml file. In my secrets.yaml (esphome) there are only three or four entries listed, that would be the ssid, the wifi-password, mqtt-password and ota-password.

All the other entries shouldn’t be needed from the HA secrets.yaml. :slight_smile:
And you don’t have to rebuild any structure from HA, you just need to write one file, that you then could use for all of your future projects.

As I said, you will loose some comfort, but it’s your choice. Use esphome with a little less comfort or don’t use it at all, as the Pi will definitively not get more power over time, and esphome will not get smaller… :wink:

In the end it is one copy & paste to the secrets.yaml on esphome and you are good to go and can compile and upload very easy. :slight_smile:

Yeah. I’m doing this now but I’m not happy about it. Having two sets of config files is terrible especially two sets of secrets. I’ll have a hard time keeping everything sync’d up and if I ever need to do something remotely (through the ingress), I’ll have to remember subsequently to sync it up backwards – otherwise I’ll end up undoing some improvement/fix.

I guess I prefer having to do all of that versus risking esphome crashing the pi during compiles.