esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
293 stars 36 forks source link

ESP8266 crashing/reseting after firmware update #6376

Open farbefreak opened 1 month ago

farbefreak commented 1 month ago

The problem

Hello Girls and Guys,

I just recently updated one of my ESP8266 nodes. It worked fine before so I updated very late. I dont know which version i had before the update but i might be able to date it by saying that i must have updated it around 8. june 2023. (same hardware setup using the bsec library)

I tried the last two versions, 2024.10.2 and 2024.10.0 and both show the issue.

The setup is quite simple, I only have a BME280 and a BME680 connected, additionally i use the software pwm component to drive 4 small lights. I wanted to try the new to me BME68x_bsec2 integration for the BME680 but it caused instant resets meaning that it rebooted instantly. It didnt reset when i disconnected the BME680. I found some post on the HA forum saying i should add: `platformio_options: build_flags:

Thinking thats its just a bsec2 issue i "downgraded" to the normal bsec integration. However to my horror, it still reboots every so often roughly every 5-7minutes.

I tried removing the logging component to save some memory but it didnt change a thing.

I always get the warning of bsec taking too long, not sure if thats related?

Which version of ESPHome has the issue?

2024.10.2

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP8266

Board

dev module

Component causing the issue

no idea

Example YAML snippet

esphome:
  name: mond
  platform: ESP8266
  board: esp12e
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  reboot_timeout: 1800s
  fast_connect: true
  manual_ip:
    static_ip: 192.168.0.104
    gateway: 192.168.0.1
    subnet: 255.255.255.0
logger:
  baud_rate: 0
api:
output:
  - platform: esp8266_pwm
    pin: GPIO16
    frequency: 1000 Hz
    id: pwm_mond
  - platform: esp8266_pwm
    pin: GPIO13
    inverted: True
    frequency: 1000 Hz
    id: pwm_explosion
  - platform: esp8266_pwm
    pin: GPIO1
    frequency: 1000 Hz
    id: pwm_USB1
  - platform: esp8266_pwm
    pin: GPIO3
    frequency: 1000 Hz
    id: pwm_USB2

i2c:
  - id: bus_a
    sda: GPIO4
    scl: GPIO5
    scan: True
    frequency: 5kHz

bme680_bsec:
  id: innen
  address: 0x77
  sample_rate: LP
  supply_voltage: 3.3V
  temperature_offset: 2.0
  state_save_interval: 6h

sensor:
  - platform: bme280_i2c
    temperature:
      name: "Außen Temperatur"
      oversampling: 16x
      filters:
    pressure:
      name: "Außen Luftdruck"
    humidity:
      name: "Außen Luftfeuchtigkeit"
    address: 0x76
    update_interval: 120s

  - platform: bme680_bsec
    bme680_bsec_id: innen
    temperature:
      name: "Innen Temperatur"
      filters:
        - or:
          - throttle: 120s
          - delta: 1.0
    pressure:
      name: "Innen Luftdruck"
      filters:
        - throttle: 120s

    humidity:
      name: "Innen Luftfeuchtigkeit"
      filters:
        - or:
          - throttle: 120s
          - delta: 1.0

    gas_resistance:
      name: "Innen Gas Widerstand"
      filters:
        - throttle: 240s
    iaq:
      name: "Innen IAQ"
      id: iaq
      filters:
        - throttle: 240s
    co2_equivalent:
      name: "Innen CO2"
      filters:
        - throttle: 240s
    breath_voc_equivalent:
      name: "Innen VOC"
      filters:
        - throttle: 240s

text_sensor:
  - platform: bme680_bsec
    bme680_bsec_id: innen
    iaq_accuracy:
      name: "Innen IAQ genauigkeit"
  - platform: template
    name: "Luftqualität"
    icon: "mdi:checkbox-marked-circle-outline"
    lambda: |-
      if ( int(id(iaq).state) <= 50) {
        return {"Super"};
      }
      else if (int(id(iaq).state) >= 51 && int(id(iaq).state) <= 100) {
        return {"Gut"};
      }
      else if (int(id(iaq).state) >= 101 && int(id(iaq).state) <= 150) {
        return {"Stickig"};
      }
      else if (int(id(iaq).state) >= 151 && int(id(iaq).state) <= 200) {
        return {"Extrem Stickig"};
      }
      else if (int(id(iaq).state) >= 201 && int(id(iaq).state) <= 250) {
        return {"Verschmutzt"};
      }
      else if (int(id(iaq).state) >= 251 && int(id(iaq).state) <= 350) {
        return {"Vergiftet"};
      }
      else if (int(id(iaq).state) >= 351) {
        return {"Lebensgefahr!"};
      }
      else {
        return {"Fehler"};
      }

light:
  - platform: monochromatic
    output: pwm_mond
    name: "Mondlampe"
  - platform: monochromatic
    output: pwm_explosion
    name: "Explosion"
  - platform: monochromatic
    output: pwm_USB1
    name: "Kürbis"
  - platform: monochromatic
    output: pwm_USB2
    name: "Lichterkette"

Anything in the logs that might be useful for us?

[W][component:237]: Component bme680_bsec took a long time for an operation (105 ms).
[W][component:238]: Components should block for at most 30 ms.

Additional information

No response

ssieb commented 1 month ago

Can you get serial logs to find out why it's crashing?

farbefreak commented 1 month ago

I would need to disassemble everything to do that. My board doesnt even have USB, so i need to pull out my serial converter and solder some wires up. If there is no other way, i might need to.

farbefreak commented 1 month ago

I just found out that deactivating the logger component completely causes much more restarts than just having it configured with baud_rate: 0 I had it off completely to save some memory and just tired and turned it on. So far with it on, i havent seen a reboot?!?

popy2k14 commented 3 weeks ago

Exact same issue with 2024.10 after updating from 2024.7. On 2024.7 was stable on this device. It has an H801 controller with an esp 8266. Its just using RGBW pwm outputs (4x).

For all my devices I have an included yaml base file with the folliwing logger settings:

...
#Enable logging
logger:
...

Sadly I don't have an serial Port connected. When it reboots I cant get logs.

Also tried to add "baud_rate: 0" now and will see how it goes...

farbefreak commented 3 weeks ago

So far, including the logger stuff from my first yaml but using the standard bsec library results in no reboots for me. Disabling the logger causes frequent restarts even with the bsec library. Bsec2 always restarts, doesn’t matter if logger activated or not.

I so far didn’t hook up my serial/usb converter to get real logs :( (too much hassle and it works now) Maybe you are able to get them?

popy2k14 commented 3 weeks ago

It's stable now for 13 hours with the baud_rate set to 0.

Should I'll add it to all my devices?