esphome / issues

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

ESP-WROOM-32D Random Restarts #4083

Open thr33bricks opened 1 year ago

thr33bricks commented 1 year ago

The problem

The problem I encountered is my esp-wroom-32d restarts at a completely random point in time. It could work for a day with no problems or restart within an hour. I am using 3 dallas temperature sensors, ina219 voltage, current and power sensor, rtc, eeprom, gpio and switches. I think the problem has to do with the webserver v1 part as the stack trace suggests it is connected to the lwip library. I am not using HomeAssistant. Any help would be appreciated!

Which version of ESPHome has the issue?

2022.11.1

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

none

What platform are you using?

ESP32

Board

ESP32_DevKitc_V4

Component causing the issue

Trying to find out

Example YAML snippet

substitutions:
  board_name: board-name
  wifi: "wifi"
  wifi_password: "pass"
esphome:
  name: ${board_name}
  libraries:
    - "Wire"
  includes:
    - include/eeprom.h
  on_boot:
    priority: -100.0
    then:
      - lambda: |-
          id(state).publish_state("OFF"); // set the default (at boot) state to OFF
          id(gui_err).publish_state("");  // clear gui_error at boot

          bool lampIncons = get_eeprom(id(eeprom))->getLampIncons();
          if(lampIncons){
            id(gui_err).publish_state("Warning! Fixed current lamp total elapsed time inconsistency!");
            Serial.println("Fixed current lamp total elapsed time inconsistency!");
          }

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: ${logging_level}

# Enable Home Assistant API
#api:
#  password: ""

#ota:
#  password: ""

wifi:
  ssid: ${wifi}
  password: ${wifi_password}

  # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.7
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Lamp Node Fallback Hotspot"
    password: ""

web_server:
  port: 80
  version: 1
  ota: false
  css_include: "static/webserver-v1.min.css"
  css_url: ""
  js_include: "static/webserver-v1.min.js"
  js_url: ""

captive_portal:  

i2c:
  sda: ${pin_i2c_sda}
  scl: ${pin_i2c_scl}
  scan: true

# Sensors
dallas:
  pin: ${pin_one_wire_temp}
  update_interval: 1s

#===========================
#More irrelevant code

Anything in the logs that might be useful for us?

[15:28:17]Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
[15:28:17]Core 0 register dump:
[15:28:17]PC      : 0x4014b940  PS      : 0x00060f30  A0      : 0x8013be49  A1      : 0x3ffbb580
WARNING Decoded 0x4014b940: sys_arch_mbox_fetch at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/port/esp32/freertos/sys_arch.c:285
[15:28:17]A2      : 0x00000000  A3      : 0x3ffd8af0  A4      : 0x00000003  A5      : 0x003abf28  
[15:28:17]A6      : 0x00060120  A7      : 0x00000000  A8      : 0x8014b939  A9      : 0x3ffbb560

Additional information

I created an EEPROM library that reads and writes to AT24C32 chip with the Wire.h library from time to time. You can see it included in the yaml.

The C++ code communication with the EEPROM:

void writeEEPROM(uint16_t adrToWrite, uint8_t *buff, int len, int eepromAdr = EEPR_ADR){
    Wire.beginTransmission(eepromAdr);
    Wire.write((uint16_t)(adrToWrite >> 8));
    Wire.write((uint16_t)(adrToWrite & 0xFF));
    Wire.write(buff, len);
    Wire.endTransmission();

    delay(10);
}

void readEEPROM(uint16_t adrToRead, uint8_t *buff, int len, int eepromAdr = EEPR_ADR){
    Wire.beginTransmission(eepromAdr);
    Wire.write((uint16_t)(adrToRead >> 8));
    Wire.write((uint16_t)(adrToRead & 0xFF));
    Wire.endTransmission();

    Wire.requestFrom(eepromAdr, len);

    for (uint8_t i = 0; i < len && Wire.available(); ++i){
        buff[i] = Wire.read();
    }
}
bf8392 commented 1 year ago

I have the same issue with ESP-WROOM-32D...it randomly restats, but I also noticed it restarts when I (re)load the webinterface sometimes...I use Webserver version 2...

bf8392 commented 1 year ago

I just tested with both webserver versions, and the crashes appear on both...

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.