Esphome 1.18 .0 freezes HA since when updated HA to 2021.5.5 at api_server.cpp

Hi
I have been using Esphome on since last month(new to HA). Everything was running perfectly fine until Esphome 1.17.0 and HA 2021.5.3.
But since then latest upgrade ESPHome freezes at “api_server.cpp” line while while creating new node, or even updating or compiling the node.
|-- 1.0
|-- 1.2
| |-- 1.0
|-- 1.1.1
| |-- 1.0
Compiling /data/power_sw_d/.pioenvs/power_sw_d/src/esphome/components/api/api_connection.cpp.o
Compiling /data/power_sw_d/.pioenvs/power_sw_d/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/power_sw_d/.pioenvs/power_sw_d/src/esphome/components/api/api_pb2_service.cpp.o
Compiling /data/power_sw_d/.pioenvs/power_sw_d/src/esphome/components/api/api_server.cpp.o

Please Guide.
Thanks

What is you HA hardware?

Raspberry Pi 3B+.
And tried every thing viz. Re-installing many times, re-installing on other sd card and only loading HA +Esphome.
Also tried restoring from sanpshot while loading 1.17.0 of esphome.
while restoring from snapshot the HA version of snapshot which was 2021.5.3 gets upgraded to 2021.5.5 by itself.
Even tried uninstalling all other addons and configuration.
But no change.
So at present I have installing HA on 2 sd cards and tried again. But all failed.
Also let me know if there is any possiblity that esphome can run from any other way, viz windows or linux on pc. or else.
Also observing that now its recovering from that freez due to esphome but still the purpose is getting defeated as compilation or update to every thing not working.

Thanks

I think there is a bit of evidence that the RAM in an rpi3 is too little.

You don’t need to run it on the same computer as home assistant. Read Getting Started with ESPHome — ESPHome

Thanks…I am also looking for this to install it on somewhere else too. Will work on this too.

Meanwhile its a matter of concern that if it worked earlier it should also be made to work now too. Some wayaround need to be worked on.

I understand and also monitored memory during its use and also found that memory drain takes place.

Software gets more complex in each iteration. Sorry about that.

Yes, and politicians should do something about climate change, cancer and bullying.

Compiling c++ uses memory, who’d have thought.

Hello,
I’m also experiencing same issue. But I can’t catch when It started to occur, after update to HA core 5.5 or after update ESPHome to 1.18.0… But the effect is that after one day of doing nothing in ESPHome, and when I want to compile new binary it freezes at compiling /api_server.cpp.o so hard, that I must reset host because it’s not responding to input via HA or directly SSH. It happens now everyday (after work I’m doing some changes in different nodes configuration and there’s 100% chance that first compile with freeze host. After that, it works good for next 5-7 compilations and then story begins again) so it’s not one-time-issue. I wasn’t doing any major changes in HA or host.
I’m using ESPHome for over 2 months and everything was working without problem
Unfortunately there’s no errors in logs. Hosts only purpose is hosting HA (Debian installation, no VMs)

Host Spec:
HP T620 AMD GX-415GA
6GB RAM
128GB SSD

I usually take full snapshot once any new addon having configuration requirement and download it to pc. HA while re-installing now updates to newer version 5.5 and now when I tried restoring esphome 1.17 , it still freezes the Home Assistant such that you have to reboot it.

After so many installs I found that the problem is taking place due to HA latest update of 2021.5.5 when running on Pi3 B+ .

The problem is still same with fresh install of HA with only Esphome on Pi3 B+

Its working good on Pi4 (4gb) module.

home assistant and esphome are independent.

I’ve found out the issue. 1 ram card is broken And I only had 2GB of RAM. I also have Unifi Controller on HA and when I started to compile ESPHome project, the host ran out of ram so it crashes. Right now I’ve disable Unifi Controller to free some memory and it’s stable for now

2 Likes

Hello,

nice to hear that someone has exactly the same problem.
so yes, I have exactly the same problem.
i also use a pi 3 (1GB RAM), at first i also thought it was because of the small memory.
but i think it is not.
I have run the compiling in the vm with the same version and imported from backup.
I have allocated less than 1GB of memory to the vm and it still runs fine.

the compiling process is also much faster in comparison. (ca. 3sec in vm, ca. 20 sec on pi without completion and with crash afterwards)
so i think it’s the cpu power, but i don’t know for sure, it’s just a guess.
but based on my test i actually rule out the memory.

has the problem already been reported so it can be fixed?

greetings from german

VM ware (0,9GB RAM) → no Crash
Home Assistant Core 2022.5.5
Home Assistant Supervisor 2022.05.3
Home Assistant OS 8.1
Kernel version 5.15.41
Agent version 1.2.1

running on Pi 3+ 1GB → with Crash
Home Assistant Core 2022.5.5
Home Assistant Supervisor 2022.05.3
Home Assistant OS 8.1
Kernel version 5.15.32-v8
Agent version 1.2.1

oh, I just saw that this topic is already 1 year old,
have solutions been found yet?
does anyone still have this problem?

@Puebllo 's computer was broken, so he didn’t have enough RAM.

Home Assistant is definately one of the very good app.
But there is a requirement of its version to run on old android phone with twrp.
I am sure there at least each person have one good old android phone at home which can be better utilised and in this way the best home automation like Home assistant can reach to almost each mobile phone user.

Really can’t work out what drugs you are on.

Just stumbled across the same issue, I enabled 4GB of swap-memory and now it’s working flawlessly.