Firmware Update fails for my sensors (ESP8266/DHT11)

Hi,

I am running two esp8266 boards with DHT11 as simple sensors in Home Assistant.
Since version 2024.4.0 I have the problem that I cannot update the firmware for that sensors anymore.

The build fails with the following error:

INFO ESPHome 2024.4.1
INFO Reading configuration /config/esphome/sensor-bad.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing sensor-bad (board: esp01_1m; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
Dependency Graph
|-- ESPAsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.1.0
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.4
Compiling .pioenvs/sensor-bad/src/esphome/components/api/api_connection.cpp.o
xtensa-lx106-elf-g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
*** [.pioenvs/sensor-bad/src/esphome/components/api/api_connection.cpp.o] Error 1
========================= [FAILED] Took 28.84 seconds =========================

The ESP-Home-Log show the following for that time I tried the update:

2024-04-23 17:24:18,900 INFO 200 GET /devices (0.0.0.0) 3.39ms
2024-04-23 17:24:29,154 INFO 200 GET / (0.0.0.0) 267.16ms
2024-04-23 17:24:29,400 INFO 200 GET /devices (0.0.0.0) 58.99ms
2024-04-23 17:24:34,319 INFO 304 GET /devices (0.0.0.0) 3.87ms
2024-04-23 17:24:39,339 INFO 304 GET /devices (0.0.0.0) 8.41ms
2024-04-23 17:24:41,024 INFO 304 GET /info?configuration=sensor-bad.yaml (0.0.0.0) 14.25ms
2024-04-23 17:24:42,698 INFO 101 GET /run (0.0.0.0) 8.19ms
2024-04-23 17:24:42,710 INFO Running command 'esphome --dashboard run /config/esphome/sensor-bad.yaml --device 172.28.5.24'
2024-04-23 17:24:44,320 INFO 304 GET /devices (0.0.0.0) 4.29ms
2024-04-23 17:24:49,346 INFO 200 GET /devices (0.0.0.0) 15.74ms
2024-04-23 17:24:54,325 INFO 304 GET /devices (0.0.0.0) 6.67ms
2024-04-23 17:24:59,347 INFO 304 GET /devices (0.0.0.0) 11.31ms
2024-04-23 17:25:04,527 INFO 304 GET /devices (0.0.0.0) 128.15ms
2024-04-23 17:25:14,196 INFO 304 GET /devices (0.0.0.0) 791.28ms
2024-04-23 17:25:15,189 INFO 304 GET /devices (0.0.0.0) 3.54ms
2024-04-23 17:25:17,846 INFO Process exited with return code 1
2024-04-23 17:25:20,183 INFO 304 GET /devices (0.0.0.0) 3.32ms
2024-04-23 17:25:25,183 INFO 304 GET /devices (0.0.0.0) 5.75ms
2024-04-23 17:25:30,183 INFO 304 GET /devices (0.0.0.0) 3.77ms

The Sketch is very simple:

esphome:
  name: sensor-bad
  friendly_name: Sensor Bad

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "PXXXXXXXXX*********4UQOL0="

ota:
  password: "90XXXX****2cbe9a1a3514"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: 172.28.5.24

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Sensor-Bad Fallback Hotspot"
    password: "Ikousun8xnqh"

captive_portal:
    
sensor:
  - platform: dht
    model: dht11
    pin: 5
    temperature:
      name: "Temperatur"
      filters:
        - offset: -5.5
    humidity:
      name: "Feuchtigkeit"
      filters:
        - offset: +10
    update_interval: 15s

Can anyone help?

- use in device name is a quite bad idea, IMHO.
I would start from avoiding it, use _ instead.

1 Like

cleanbuild
Doesn’t hurt to clean build files every so often.

I tried that. The result is that it loads and install some libs before the error:

INFO ESPHome 2024.4.1
INFO Reading configuration /config/esphome/sensor-bad.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing sensor-bad (board: esp01_1m; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
Library Manager: Installing esphome/ESPAsyncTCP-esphome @ 2.0.0
INFO Installing esphome/ESPAsyncTCP-esphome @ 2.0.0
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Installing esphome/ESPAsyncWebServer-esphome @ 3.1.0
INFO Installing esphome/ESPAsyncWebServer-esphome @ 3.1.0
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Resolving dependencies...
INFO Resolving dependencies...
Library Manager: Installing ottowinter/ESPAsyncTCP-esphome
INFO Installing ottowinter/ESPAsyncTCP-esphome
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Installing esphome/noise-c @ 0.1.4
INFO Installing esphome/noise-c @ 0.1.4
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Resolving dependencies...
INFO Resolving dependencies...
Library Manager: Installing esphome/libsodium @ 1.10018.1
INFO Installing esphome/libsodium @ 1.10018.1
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
Dependency Graph
|-- ESPAsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.1.0
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.4
Compiling .pioenvs/sensor-bad/src/esphome/components/api/api_connection.cpp.o
xtensa-lx106-elf-g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
*** [.pioenvs/sensor-bad/src/esphome/components/api/api_connection.cpp.o] Error 1
========================= [FAILED] Took 40.34 seconds =========================

Well it worked for several versions of ESPHome, yet.

Why this is a bad idea?

Don’t mind. I’ve messesd with something else, where - lead to some issues. Sorry.

According to the docs, the model parameter should be INT (or pre-defined constant) and it is string. See here:
DHT Temperature+Humidity Sensor — ESPHome. Try DHT11 as model or leave it out altogether.

I seem to remember something about a braking change in the 2024.4 release logs

OK, the description is a bit confusing, it es saying " can be one of AUTO_DETECT , DHT11 , DHT22 , DHT22_TYPE2 , AM2302 , RHT03 , SI7021 , AM2120" but it wants an Integer.

I commented out the line “model: DHT11”, but it does not make a difference to the problem.

I don’t think your issue is the YAML. Something is preventing your compiler from completing. Are you compiling on a Raspberry PI? It may be hitting its memory limit causing the compiler to crash.

Try compiling on a different hardware to see if you are able to replicate the issue.

Yes I am using a Pi 3b+

OK, I try to figure out, how I can compile the sketch on another PC.

And you are certain that you didn’t run out of memory?

The docs got you covered, docker or pip

No I am not, since there is no display or log for that.

But you are obviously right, since it compiles and installs fine when I reboot the Pi (not only restart HA!) - This does point to a memory shortage issue…

1 Like

Try to increase the swap file size this will be a solution for low memory now. Used to get this on RPI 3b+ but not when increased the swap file.

Well, I’ll try to get a 4b 4GB… since the 5 is out, there are some 4B’s for sale :wink: - And it fits to my Rack carrier.

1 Like

Exactly what I did. :+1:

Good idea. So far RPi 4 4Gb easily handles 2x ESPHome compiations at a same time.