klaasnicolaas / home-assistant-glow

⚡ The power of energy measurements in your house
https://glow-energy.io/
MIT License
1.07k stars 163 forks source link

ESP32 board is crashing after first reboot #557

Closed gezuka77 closed 1 month ago

gezuka77 commented 3 months ago

Hi,

While I have my D1 mini adventures, I am also trying to use my ESP board(s). Flashing via the website went well ok. I can access the built in interface. I have added to Home Assistant via the discovery. Entities show up.

The issue: However when I use the reboot button on the interface the ESP never comes back up. I don't have log messages either. This also happens when I adopt in the ESP Home in Home assistant. That time it pushes an firmware update to the ESP board and it reboots. After that it also never comes back up.

I have 5 different ESPs. All behave the same.

gezuka77 commented 3 months ago

I now managed to get some serial messages to the ESP board:

time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14822) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14842) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14860) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14877) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14905) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14923) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14941) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14968) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[W][wifi_esp32:530][arduino_events]: Event: Disconnected ssid='GezaNET_IoT' bssid=BA:FB:E4:74:4A:F1 reason='Association Failed'
[W][wifi_esp32:530][arduino_events]: Event: Disconnected ssid='GezaNET_IoT' bssid=BA:FB:E4:74:4A:F1 reason='Authentication Failed'
[D][wifi:696]: Retrying with hidden networks...
[I][wifi:312]: WiFi Connecting to 'GezaNET_IoT'...
[W][wifi:668]: Connecting to WiFi network failed. Are the credentials wrong?
[W][wifi_esp32:530][arduino_events]: Event: Disconnected ssid='GezaNET_IoT' bssid=BA:FB:E4:74:4A:F1 reason='Auth Expired'
[I][wifi:312]: WiFi Connecting to 'GezaNET_IoT'...
[W][wifi:652]: Error while connecting to network.
[D][wifi:696]: Retrying with hidden networks...
[I][wifi:312]: WiFi Connecting to 'GezaNET_IoT'...
[W][wifi:668]: Connecting to WiFi network failed. Are the credentials wrong?
[I][wifi:312]: WiFi Connecting to 'GezaNET_IoT'...
[W][wifi_esp32:530][arduino_events]: Event: Disconnected ssid='GezaNET_IoT' bssid=BA:FB:E4:74:4A:F1 reason='Association Leave'
[W][wifi:673]: WiFi Unknown connection status 0
[D][wifi:696]: Retrying with hidden networks...
[I][wifi:312]: WiFi Connecting to 'GezaNET_IoT'...
[I][wifi:616]: WiFi Connected!
[C][wifi:427]:   Local MAC: 08:3A:F2:AC:2F:54
[C][wifi:432]:   SSID: 'GezaNET_IoT'
[C][wifi:435]:   IP Address: 192.168.107.110
[C][wifi:439]:   BSSID: BA:FB:E4:74:4A:F1
[C][wifi:440]:   Hostname: 'home-assistant-glow-ac2f54'
[C][wifi:442]:   Signal strength: -13 dB ▂▄▆█
[C][wifi:446]:   Channel: 11
[C][wifi:447]:   Subnet: 255.255.255.0
[C][wifi:448]:   Gateway: 192.168.107.1
[C][wifi:449]:   DNS1: 192.168.1.120
[C][wifi:450]:   DNS2: 9.9.9.9
[D][wifi:625]: Disabling AP...
[C][web_server:128]: Setting up web server...
[C][api:025]: Setting up Home Assistant API server...
[I][app:062]: setup() finished successfully!
E (31082) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (31082) task_wdt:  - loopTask (CPU 1)
E (31082) task_wdt: Tasks currently running:
E (31082) task_wdt: CPU 0: IDLE
E (31082) task_wdt: CPU 1: IDLE
E (31082) task_wdt: Aborting.

abort() was called at PC 0x401047e4 on core 0

Backtrace:0x400839ad:0x3ffbe9dc |<-CORRUPTED

ELF file SHA256: 0000000000000000

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13132
load:0x40080400,len:3036
entry 0x400805e4
[I][logger:156]: Log initialized
[C][status_led:014]: Setting up Status LED...
[C][safe_mode:079]: There have been 1 suspected unsuccessful boot attempts
[D][esp32.preferences:114]: Saving 1 preferences to flash...
[D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[I][app:029]: Running through setup()...
[D][number:012]: 'Puls rate - imp/kWh': Sending state 1000.000000
[D][number:012]: 'Reset Value - Total Energy kWh': Sending state 0.000000
[C][light:035]: Setting up light 'Red'...
[D][light:036]: 'Red' Setting:
[D][light:041]:   Color mode: 
[D][text_sensor:064]: 'Home Assistant Glow - ESPHome Version': Sending state '2024.7.0'
[D][sensor:094]: 'Home Assistant Glow - Daily Energy': Sending state 0.00000 kWh with 3 decimals of accuracy
[C][wifi:047]: Setting up WiFi...
[C][wifi:060]: Starting WiFi...
[C][wifi:061]:   Local MAC: 08:3A:F2:AC:2F:54
[D][wifi:073]: Loaded saved wifi settings: GezaNET_IoT
[D][wifi:481]: Starting scan...
[D][text_sensor:064]: 'Glow - Installed version': Sending state '4.1.1'
[D][esp32.preferences:114]: Saving 1 preferences to flash...
[D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[W][component:157]: Component wifi set Warning flag: scanning for networks
[D][wifi:496]: Found networks:
[I][wifi:540]: - 'GezaNET_IoT' (BA:FB:E4:74:4A:F1) ▂▄▆█
[D][wifi:541]:     Channel: 11
[D][wifi:542]:     RSSI: -11 dB
[I][wifi:540]: - 'GezaNET_IoT' (82:AC:B9:B7:58:B9) ▂▄▆█
[D][wifi:541]:     Channel: 11
[D][wifi:542]:     RSSI: -52 dB
[I][wifi:540]: - 'GezaNET_IoT' (BA:FB:E4:74:46:D8) ▂▄▆█
[D][wifi:541]:     Channel: 6
[D][wifi:542]:     RSSI: -80 dB
[D][wifi:545]: - 'GezaNET' (B4:FB:E4:74:4A:F1) ▂▄▆█
[D][wifi:545]: - 'ChiaShanNET' (C2:FB:E4:74:4A:F1) ▂▄▆█
[D][wifi:545]: - '' (C6:FB:E4:74:4A:F1) ▂▄▆█
[D][wifi:545]: - 'GezaNET_CAMS' (BE:FB:E4:74:4A:F1) ▂▄▆█
[D][wifi:545]: - '' (FA:8F:CA:70:9B:17) ▂▄▆█
[D][wifi:545]: - 'DIRECT-lfM2070 Series' (32:CD:A7:16:F5:7C) ▂▄▆█
[D][wifi:545]: - 'GezaNET_Guest' (74:AC:B9:B7:58:B9) ▂▄▆█
[D][wifi:545]: - '' (7A:AC:B9:B7:58:B9) ▂▄▆█
[D][wifi:545]: - 'GezaNET' (7E:AC:B9:B7:58:B9) ▂▄▆█
[D][wifi:545]: - 'GezaNET_CAMS' (86:AC:B9:B7:58:B9) ▂▄▆█
[D][wifi:545]: - 'DNA-WIFI-0FD4' (30:C5:0F:3F:D5:00) ▂▄▆█
[D][wifi:545]: - 'ChiaShanNET' (C2:FB:E4:74:46:D8) ▂▄▆█
[D][wifi:545]: - 'GezaNET' (B4:FB:E4:74:46:D8) ▂▄▆█
[D][wifi:545]: - 'GezaNET_CAMS' (BE:FB:E4:74:46:D8) ▂▄▆█
[D][wifi:545]: - 'Drumfire_D-1_B8B82C' (00:22:6C:B8:B8:2C) ▂▄▆█
[I][wifi:312]: WiFi Connecting to 'GezaNET_IoT'...
[D][esp-idf:000][wifi]: E (14010) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14032) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14052) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14072) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14099) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14130) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14156) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14184) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14207) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14235) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14255) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14273) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14293) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14311) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14337) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14355) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14372) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14401) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14421) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14440) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14457) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14475) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14506) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14524) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14542) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14570) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14587) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14606) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14646) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14665) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14683) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14701) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14729) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14747) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14764) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14793) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14812) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14829) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14850) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14867) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14885) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14924) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14950) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14967) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (14985) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[D][esp-idf:000][wifi]: E (15026) wifi:
[D][esp-idf:000][wifi]: Association refused temporarily, comeback time 0 mSec
[D][esp-idf:000][wifi]: 

[W][wifi_esp32:530][arduino_events]: Event: Disconnected ssid='GezaNET_IoT' bssid=BA:FB:E4:74:4A:F1 reason='Association Failed'
[W][wifi:652]: Error while connecting to network.
[D][wifi:696]: Retrying with hidden networks...
[I][wifi:312]: WiFi Connecting to 'GezaNET_IoT'...
[W][wifi:668]: Connecting to WiFi network failed. Are the credentials wrong?
[W][wifi_esp32:530][arduino_events]: Event: Disconnected ssid='GezaNET_IoT' bssid=BA:FB:E4:74:4A:F1 reason='Auth Expired'
[I][wifi:312]: WiFi Connecting to 'GezaNET_IoT'...
[W][wifi:652]: Error while connecting to network.
[D][wifi:696]: Retrying with hidden networks...
[I][wifi:312]: WiFi Connecting to 'GezaNET_IoT'...
[W][wifi:668]: Connecting to WiFi network failed. Are the credentials wrong?
[I][wifi:312]: WiFi Connecting to 'GezaNET_IoT'...
[W][wifi_esp32:530][arduino_events]: Event: Disconnected ssid='GezaNET_IoT' bssid=BA:FB:E4:74:4A:F1 reason='Association Leave'
[W][wifi:673]: WiFi Unknown connection status 0
[D][wifi:696]: Retrying with hidden networks...
[I][wifi:312]: WiFi Connecting to 'GezaNET_IoT'...
[I][wifi:616]: WiFi Connected!
[C][wifi:427]:   Local MAC: 08:3A:F2:AC:2F:54
[C][wifi:432]:   SSID: 'GezaNET_IoT'
[C][wifi:435]:   IP Address: 192.168.107.110
[C][wifi:439]:   BSSID: BA:FB:E4:74:4A:F1
[C][wifi:440]:   Hostname: 'home-assistant-glow-ac2f54'
[C][wifi:442]:   Signal strength: -12 dB ▂▄▆█
[C][wifi:446]:   Channel: 11
[C][wifi:447]:   Subnet: 255.255.255.0
[C][wifi:448]:   Gateway: 192.168.107.1
[C][wifi:449]:   DNS1: 192.168.1.120
[C][wifi:450]:   DNS2: 9.9.9.9
[D][wifi:625]: Disabling AP...
[C][web_server:128]: Setting up web server...
[C][api:025]: Setting up Home Assistant API server...
[I][app:062]: setup() finished successfully!
E (36750) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (36750) task_wdt:  - loopTask (CPU 1)
E (36750) task_wdt: Tasks currently running:
E (36750) task_wdt: CPU 0: wifi
E (36750) task_wdt: CPU 1: IDLE
E (36750) task_wdt: Aborting.

abort() was called at PC 0x401047e4 on core 0

Backtrace:0x400839ad:0x3ffbe9dc |<-CORRUPTED

ELF file SHA256: 0000000000000000

Rebooting...
klaasnicolaas commented 3 months ago

Which ESP32 boards do you use?

./Klaas

gezuka77 commented 3 months ago

Which ESP32 boards do you use?

./Klaas

ESP32-WROOM-32D ESP32-WROOM-32U ESP32-WROOM-32 ESP32-PICO-MINI-02 btw

ESP8266MOD boards are also behaving the same as D1 mini, so throwing

[http_request.arduino:132] Stream pointer vanished!

after first reboot.

I also have tried flashing the micro USB boards with different cable.

klaasnicolaas commented 3 months ago

I will test it myself again soon, I don't have an explanation or solution for it now. You could always look if something similar occurs in the ESPHome issues.

./Klaas

Martin97y commented 3 months ago

I will test it myself again soon, I don't have an explanation or solution for it now. You could always look if something similar occurs in the ESPHome issues.

./Klaas

Hey so any solutions? Im using esp8266mod and I have same issue. [http_request.arduino:132] Stream pointer vanished!

klaasnicolaas commented 3 months ago

Hey so any solutions?

Please look upstream for this, it's waiting for a solution at ESPHome.

./Klaas

tramix32 commented 2 months ago

Same problem here.. Im using this board with ESP-WROOM-32D chip. Heres logs Esp-glow.zip

klaasnicolaas commented 2 months ago

With the latest release build my ESP32 worked without any issues. Are you still experiencing this issue?

./Klaas

tramix32 commented 2 months ago

@klaasnicolaas for now im using custom build of ha-glow with latest adruino framework. And its working solid for a week.

 framework:
    type: arduino
    version: latest

EDIT: But i don't know why sometimes i get random daily energy spikes even when i added filter (they also appear on the recommended framework version). :/

internal_filter: 100ms

Sensor is connected to GPIO 26. image image

github-actions[bot] commented 1 month ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!