ESPHome does not allow OTA after fresh install. Potential mDNS bug, workaround provided

After a recovery of my HA setup and update to the latest version of ESPHome + HA, I had the following problem:

An existing sensor (worked prior recovery) can’t be updated via OTA.

Details:
I had to restart my HA after a SD Card failure. Did a fresh install on a new SD Card and started HA from scratch. Auto discovery found the BME280 sensor and showed it’s values. I installed manually ESPHome and created a sensor config from my backup. Reboot of HA shows the device to be offline in the ESPHome dashboard. Not OTA update possible

Analysis:
The sensor had the DNS sensorgarten.local.
I changed the Wifi domaine the YAML to domain: “.fritz.box”, this allowed installs over wifi again.
However, the devices is still shown offline in the dashboard, but I can get logs and update.

Findings 1:
The ESP sensor can’t update via ESPHome, if the sensorgarten.local is used. Explicit config of th domaine fritz.box enables OTA.

Walter

Attachment: Environment
I am running:
Add-on version: 2021.10.2
You are running the latest version of this add-on.
System: Home Assistant OS 6.5 (aarch64 / raspberrypi3-64)
Home Assistant Core: 2021.10.6
Home Assistant Supervisor: 2021.10.0
Wifi Network is based on a AVM Fritzbox (OS 7.28) with to Wifi repeaters
Browser is Firefox 93.0

Attachment: Sensor Config
Sensor config file looks like this:
esphome:
name: sensorgarten
platform: ESP8266
board: d1_mini

wifi:
ssid: “ssid”
password: “password”
domain: “.fritz.box”

logger:
level: DEBUG

api:
password: “password”

ota:
password: “password”

i2c:

  • sda: GPIO4
    scl: GPIO5
    scan: true
    id: bus_a

sensor:

  • platform: bme280
    temperature:
    name: “Temperatur (Garten)”
    id: garten_t
    pressure:
    name: “Luftdruck”
    id: garten_p
    humidity:
    name: “Relative Luftfeuchtigkeit (Garten)”
    id: garten_h
    address: 0x76
    update_interval: 120s

Can ether fix your mdns or enable ping for the dashboard online status.
Also prepare for the next SD card failure :wink:

I would agree to the statement “fix you mDNS”, but how? Enable Ping on the dashboard does not make the sensor online in the ESPHome dashbard.

Regarding the “next” SD card failure: Moved from “standard” SD to Max Endurance cards. This seems to be the card for solid lifetime. But I’d also like to mention that backup via snapshot does not automatically mean a restore is sucessful.

Hmmm, “endurance” sounds like the marketing worked.

the SanDisk MAX ENDURANCE microSD™ card is temperature-proof, waterproof, shockproof and X-ray-proof.2

Like all other SD cards too :man_facepalming:

But this card is anyway made for the opposite cause of your setup. It is optimized for continuous writing big junks of data (video recording for example). You are running a operating system and a database on it which writes small junks of data. Thank’s to write amplification the new card may even fail earlier than your old “standard” (maybe even a1 or a2 rated and therfor better suited) card.

Rather avoid any databases on SD cards at all and use a cheap ssd (even if it’s on usb) for that.

The SD Card thing is fair enough. I am fighting HA and ESPHome topics with every update. Before moving into a Pi4/SSD setup, I’d like to see HA work a bit stable. Not like the issue I am seeing now with the node that worked perfectly and is now offline after an update of HA/HAOS/ESPHome.

Any idea how to fix mDNS? Or how to get some leverage to raise sensible bug reports? I am lost (and currently writing the mDNS component documentation for the ESPHome web site).

Starts with basic troubleshooting like pinging a esphome node from your computer via it’s mdns hostname (sensorgarten.local).

Maybe install esphome locally (pip or docker) to see if things are working so you know the problem is located on the side of HA…

In theory mdns should work fine with your fritz box (I think their is even no way to turn it off in the router…)

Most problems with mdns typically arise with dockerization combined with missing forwards

I have installed HA in RPi3 as downloaded from homeassistant.io. No other stuff done by myself than adding the config folder to enable wifi. Homeassistant.local can be pinged from the PC. Sensorgarten.local can’t be pinged from the PC. I guess the node IP information is not distributed.

Update to 2021.10.3 resolved the problem of sensorgarten.local can’t be pinged for a PC in the network. mDNS seems to work now.