ESPHome crashes HA on flashing - cannot reach node either

Hi,

Pretty new here, so I hope I’m not being too much of a noob. Anyhow:
I’ve installed ESPHome on my Home Assistant (running on Raspberry Pi 3b+). There’s not much else running, except for device trackers. I’m trying to make this work: GitHub - adonno/tagreader: Simple to build/use NFC tag reader, specially created for Home Assistant

I’ve built the tag reader. That seems to work fine. The problems start at the point of creating the nodes. I was able to see a serial port once after installing the drivers. But as soon as I try to install anything on my tag reader, Home Assistant becomes unresponsive. To the point of having to unplug the RPi and plugging it back in.
After the first few crashes, the serial port no longer showed up. I’ve tried installing by manual download, but that gives the same problems.

As a last resort, I’ve managed to get ESPHome running on my windows desktop. I was able to flash the right files, and could see the logs up and running. It does detect NFCtags too. But I cannot connect it to my Home Assistant.
The reader doesn’t show up in integrations, and manual adding (add integration → ESPHome) does only result in a message telling me to make sure I have ‘api’ in my configuration. I do.

What do I do wrong? I have DuckDNS running too. Would that be a problem somehow?

Might be a Power issue on your pi - are you using the official power supply?
In any case, since you use DuckDNS you probably have a SSL certificate, so you could just open the ESPHome Dashboard (you’ve installed the addon in HA, right?) and when selecting “Install”, choose “Plug into this computer”.
Make sure the WiFi credentials are correct (take a look at the config of the device in ESPHome) and the API is enabled (api: in the YAML)

I am using the official power supply.

I have installed the addon in HA.

I’ve tried installing by all four options. Multiple times each! :cry:
Wirelessly → crashes HA, or finds no connection if it doesn’t crash.
Plug into this computer → can’t find serial port, or crashes HA when it can.
Plug into the computer running ESPHome Dashboard → crashes HA.
Manual download → kills process or crashes HA when it doesn’t.

WiFi is correct - I can see the device on the network too.
Api is enabled.

Sad thing is, I have to power cycle the Pi to get HA back up. And when it does, the logs are always empty…

Hm, interesting.
Seems you’re not the only one with this issue :frowning_face:
For the time being you could try compiling on a different machine.

1 Like

I am able to get the reader working using ESPHome on my windows computer - however, I can’t seem to connect to it with HA afterwards. HA doesn’t discover the integration. If I try to add manually, it only results in a message: Can’t connect to ESP . Please make sure your YAML file contains an 'api:’ line.

Tried with host:
tagreader.local
the ipadress of the device
tagreader-cfcff0 (which is it’s name in my network)
and any other possibility I could think of. (tagreader:6053, tagreader-cfcff0:6053, tagreader-cfcff0.local etc)

Can you take a look at the DHCP logs / leases in your router? It should show up there with an IP address.
Also, can you paste your config? Remove the passwords or store them as secrets (that’s the proper way)

1 Like

I estimate that Rpi 3b + has insufficient memory to compile esp and run other integrations.

2 Likes

Then again, in the GitHub issue people confirm that behaviour with 10 cores and 8GB of RAM.

1 Like

Am noob: which config? ESPHome? Or the tagreader I’m trying to connect?

Will check the DCHP logs as soon as I am able to! Possible problem could be that HA is connected by LAN to the router itself, while the WIFI connections go through a WIFI booster system.

I´m having the same issue on a 3B+. For me it helped to stop all unnecessary addons before compiling. I read somewhere that it’s a performance issue. However, if it also happens on beefier systems maybe it´s a problem with a particular addon. That ones that I disabled are Grafana and InfluxDB.

1 Like

This had become a problem recently for RPI 3b. Increase your swap file size.

1 Like

Ok, I fixed my problem in connecting to the device! I still can’t use ESPHome to configure it, but at least HA sees the device now.

Problem was apparently: the device was connected wireless - to a DECO m4 subnet which I didn’t know existed until now. I’ve reconfigured the DECO network to an access point instead, so now HA sees everything on the network. Including the device.

I think the problem with ESPHome is a memory issue - and I can’t fix it currently. Disabling other addons doesn’t make a difference. So instead, I’m using ESPHome on my desktop computer, and just connect the resulting devices in HA.

Thanks for the help @all!

Same here!
The Pi crashes while compiling. Every time at another point. Looks like a hardware issue.
Not enough resources.
Any ideas how to investigate deeper?
Its the smalest Pi4 I could get.

Cheers!
Rakete

2 Likes

Same here since the last few weeks. It seems like HA stops responding in the ‘compilation terminal’. And after that, there is no response. However, the firmware got flashed onto the ESP device. So in the background, the compilation continues, and the upload to the ESP succeeds. But I have to reboot the Pi 4B (2GB) after almost every ESPhome compilation action. Which is far from ideal.

Ah, now I notice that the ESPhome dashboard in HA shows a device as ‘updated’ (at least without a notice ‘update available’) as soon as compilation starts. So my conclusion that compilation succeeds in the background is not true.

I solved it. First by swapping my Raspberry Pi 4B 2GB version for a 8GB version I had laying around for other purposes. But that made the setup way more stable. There is now continuously 6 GB free, while it used to be around 150MB while compiling, or less.
Second change (and I didn’t test this with the old 2GB config) was to enable the option in the ESPhome configuration (./hassio/addon/xxxxxxx_esphome/config) “Default compile processor limit” and set it to something < 4, to not fully load my Raspberry Pi while compiling. I takes a bit longer, though.

I found that my RPi3b+ could not handle ESPhome properly until I increased the swap file size.

1 Like

Thanks for this, I was wondering why my ha running on external ssd keeps crashing when compiling on esphome.