ESPhome freezes during compile

Yes, this was also my issue. After disabling everything else RPI3b+ managed to compile. But ram was still full. It was a sign to me that I need to upgrade hardware. I wanted to buy RPI4 but at that time ti was not awailable here yet, so I got an old mini pc for good price.

I figured out why my esphome is freezing when compiling. I am running HA on a rpi3 B+ using a usb stick (not an sd card). The usb stick was slowing dying and recently was on itā€™s last breathe. Changed out the usb stick and I am able to compile from start to finish without any issue.

This also fixed another issue I had where when I restart HA, it does not restart proper and would just hang at lost connection some of the time.

I had this issue on SSD. But anyway, my setup was too big for RPI3b+ at the end anyway :slight_smile:

Same here often it just compiles just fine, but now and then hoem assistant becomes totally unresponsive and i nee dot pull the power plug, which is a no no on a raspi 3 with sd card. I think has to do with the out of the store placement of esphome.

What about the RAM usage before the crash ?
On my previous installation on a Pi 3B+ I would see the RAM filling up to almost 100% just before everything froze.
Add the system monitor integration if you donā€™t already have.

Same issue

Same Issue, Seems to completely hand the HA server running on the Pi 3B+ during compile or configuration.

Same issue, RPi 3B, it starts compiling but completely hangs after some minutes. I have not pulled the power out of it since it hang 3 hours ago and it does not clear itself, it did accept ā€œfreeā€ command from putty but it took 2+ hours to executeā€¦ There should be a rule that does not allow compilling to start if device RAM is not capable of it. Always afraid to pull the cord to risk corrupting the SDcard.
The same device is running HA, Mosquitto and Portainer docker containers, without any problems ever.

I will add to this: The RPi did finish compiling, after 7+ hours of being unresponsive. And then returned to normal, HA automations i had going did also work but with the same 2 hour delay that i had with running Putty commands. The RPi did not 100% freeze because my Putty never disconnected from it, being the reason i chose not to pull power cord out of it to end the compiling frozenness. It was more like 99.99% frozen during all those 7+ hours.

Still saying, if your device enters this kind of frozenness, just pull the cord to end it, and keep a full backup of your machine at all times. Just to be safe, dont use a RPi with only 1gig of ram to do the compiling.

Do you not have any other computer?

I do, and i did compile the code again on this computer, and installed it on the D1. Now im wondering how can i do the compiling(alone) separately on another machine and keep the devices listed under the ESPhome dashboard on a different machine, although HA integration keeps them organized anyways without the dashboard.

It would be just so lovely if i could run the ESPhome dashboard and compiler on the same machine that is online 24/7 and has HA on it. Its a management mess.

Oh AND ESPHome dashboard does not seem to work under windows! I guess i could use a virtual linux there. But its again adding to the hassle. Id rather just forward the compiling to be done on another machine and keep the dashboard installation on the RPi.

This is exactly the reason why I upgraded to something more powerful than a Raspberry Pi. Iā€™m rocking 32GB of RAM now and Iā€™ve never had an issue with compiling since! :grin:

I was keeping another instance of ESPHome running on a separate Linux machine for about a year but like you said it is a management mess. Trying to keep two directories in sync is a pain and using the built-in ESPHome ingress is so excellent. Do the upgrade, you wonā€™t be sorry.

P.S. you donā€™t need 32GB of ram for this to work. I get it for free so I might as well stuff it full. Iā€™m running from a Nuc 10. Bought it Dec 9th 2020ā€¦ been running HA on there ever since. No hangs.

For me that would be the only reason i NEED to upgrade to anything more powerful (more energy hungry also). Everything else i currently run on my RPi 3b works perfectly fine.

To be fair, it was only a test up to the point when i had a LTS 64bit server Ubuntu, docker, under docker: HA, portainer, grafana, eclipse-mosquitto and ESPHome and the dashboard for it. All of those running with only 58%ish RAM usage being reported by the RPi 3b system. Before the RPi, they were running on an old 2 core Laptop that was sooooo hungry, thank god i dont need run that thing anymore. Only thing i cannot do on the RPi, is the compiling action on ESPHome currently.

I am also thinking of running a pi-hole, or even my unifi controller on the 24/7 computer of mine, both also available in docker. Why im hinking of getting atleast a 4gig RPi 4 to continue ahead with that. But the prices! :expressionless:

yup, was for me too but the benefits that you donā€™t realize are out there too. Like restarting HA and it happens in seconds. Anyway, I guess you could just forgo using ESPHome if it keeps hanging your system and you really want to stick to a Raspberry Pi. Good luck!

BTW, I still use my old Raspberry Piā€™s I turned one of them into a reverse proxy and the other two are redundant piholes for DNS service to my intranet.

Yes, i know, things happened faster on the old laptop of mine, it did also have 8gigs of memory.

But i did a ā€œmistakeā€ of doing too many calculations on what is using energy and how much, and what that does to my wallet. So having that old laptop running 24/7 did cost me 3x the money compared to the RPi. Also that introduced me into the world of having sleep modes enabled in smart devices when possible, having automations controlled accurately and actually moving to led lighting everywhere in the apartment etc, etc. So now i save quite a few bucks compared to how it was back then. Its gonna pay itself back even if i needed to buy new devices.

Why would you need to run esphome on your HA machine if you are running it on another machine?

Cause the another machine is not online 24/7 and is not reachable at all times, also needs to be updated to the latest ESPHome revision everytime an update comes. On the 24/7 machine i am keeping the software updated at all times. Whereas on the machine i have the ESPHome compiling happening, i am only using the ESPHome when i need to update an ESP device, or run a new code onto one. Also that being a windows machine, i can never use the dashboard for ESPHome (correct me if im wrong here).

So the thing here is, im compiling my ESPHome code on my gaming computer. Im wishing i could do the code compiling alone on this powerful computer and the rest of the ESPHome jobs on the RPi to not need to upgrade the RPi to something more powerful, as that is the only task ā€œkillingā€ my RPi.

I do not want to boot up my gaming computer and run the code to compile/update all of the code for my esp devices just alone because of a need to update those devices etc. I do play games often so thats a side job to do at the same time as im playing. I do have a partial script already in there to automate half of the stuff. :grinning: Its a tiny tiny task to do on a computer that has so much umph and a 16gigs of memory.

Yes, im overly green dude, looking too much onto how much power is being consumed for things etc. Sorry for that :grin:

Normally im managing my RPi from my tablet, as most of the things a have browser interface today, and the things not having that, can be accessed with a SSH connection. And i keep my tablet (and all the mobile devices) charged from my battery pack that is charged by solar panels :smiley:

Thats quite a lengthy answer to your question. :crazy_face:

I donā€™t know what esphome tasks you could be doing on the pi?

Just the basic, ā€œesphome run devicecode.yamlā€, the most used command for esphome, and that kills my RPi if it goes past the validation part.