Hey, not sure where to search further around this one, so here I am I guess.
In short: I have a d1 mini 8266 running since August which has 2 infrared sensor connected to read power and gas usage. It ran without interuption until the 1st of January, there I had to do a hard reboot because it stopped providing data to HA, but again flawless since then. Today I changed the code for the first time since August and did an OTA update, which resulted in a boot loop without being able to connect to the Wifi. I reverted the code change, flashed the old version via USB, but the d1 mini still behaves the same.
The only change I made since August: I updated my esphome version to 2022.12.8.
I use my windows10 laptop to develop and flash, so esphome command line.
When I do the flashing via USB, the logs return this:
[09:46:54]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[09:46:54]
[09:46:54]Exception (28):
WARNING Exception type: Access to invalid address: LOAD (wild pointer?)
[09:46:54]epc1=0x4020d01b epc2=0x00000000 epc3=0x00000000 excvaddr=0x0c260000 depc=0x00000000
WARNING Decoded 0x4020d01b: esphome::wifi::WiFiComponent::wifi_sta_connect_status_()
[09:46:54]
[09:46:54]>>>stack>>>
WARNING Found stack trace! Trying to decode it
[09:46:54]
[09:46:54]ctx: cont
[09:46:54]sp: 3ffffc80 end: 3fffffc0 offset: 0190
[09:46:54]3ffffe10: 3fff1e44 4020d00c 4bc6a7f0 00000000
WARNING Decoded 0x4020d00c: esphome::wifi::WiFiComponent::wifi_sta_connect_status_()
[09:46:54]3ffffe20: 00000000 3ffef500 40100629 4020c74a
WARNING Decoded 0x40100629: millis
WARNING Decoded 0x4020c74a: esphome::wifi::WiFiComponent::check_connecting_finished()
[09:46:54]3ffffe30: 000017c2 3ffef590 3fff18b4 40210012
WARNING Decoded 0x40210012: esphome::Scheduler::call()
[09:46:54]3ffffe40: 007a1200 589b167b 3ffe8600 00000100
[09:46:54]3ffffe50: 3fff0bcc 00000013 3fff0bcc 00000100
[09:46:54]3ffffe60: 3fff0bcc 000017c2 3fff0bcc 4020c8dc
WARNING Decoded 0x4020c8dc: esphome::wifi::WiFiComponent::loop()
[09:46:54]3ffffe70: 000017c2 00000013 3ffef590 40222750
WARNING Decoded 0x40222750: esphome::Component::call_loop()
[09:46:54]3ffffe80: 3fff16a4 3ffffea0 3ffef590 4022281c
WARNING Decoded 0x4022281c: esphome::Component::call()
[09:46:54]3ffffe90: 3fff0bcc 00000013 3ffef590 4020ed09
WARNING Decoded 0x4020ed09: esphome::Application::setup()
[09:46:54]3ffffea0: 00000014 00000014 3fff1a5c 4022f21c
WARNING Decoded 0x4022f21c: operator delete(void*) at /workdir/repo/gcc-gnu/libstdc++-v3/libsupc++/del_op.cc:50
[09:46:54]3ffffeb0: 00000050 00000000 00000000 4020dc42
WARNING Decoded 0x4020dc42: esphome::Application::register_component_(esphome::Component*)
[09:46:54]3ffffec0: 3fff0edc 3ffef668 3fffff70 3ffef590
[09:46:54]3ffffed0: 3fffff70 3fff0b54 3ffef6a4 402113c4
WARNING Decoded 0x402113c4: setup
[09:46:54]3ffffee0: 3fff0e04 3fff0e08 3fff0e08 00000000
[09:46:54]3ffffef0: 74746177 00000000 00000000 00000000
[09:46:54]3fffff00: 3fffff08 0000000c 6b486a6a 6f65516f
[09:46:54]3fffff10: 52336259 00000000 00000000 00000000
[09:46:54]3fffff20: 00000000 00000000 00000000 00000000
[09:46:54]3fffff30: 00000000 00000000 3fffff70 00000001
[09:46:54]3fffff40: 6b486a6a 6f65516f 52336259 feefef00
[09:46:54]3fffff50: 3fffff38 00000001 3fffff38 00000001
[09:46:54]3fffff60: 3fffff38 00000001 3fffff38 00000002
[09:46:54]3fffff70: 3fff1724 feefeffe feefeffe feefeffe
[09:46:54]3fffff80: 3fff1244 00000084 3fff10f4 00000001
[09:46:54]3fffff90: feefeffe feefeffe feefeffe 3ffef9ac
[09:46:54]3fffffa0: 3fffdad0 00000000 3ffef998 4021ed58
WARNING Decoded 0x4021ed58: loop_wrapper() at core_esp8266_main.cpp
[09:46:54]3fffffb0: feefeffe feefeffe 3ffe8640 40100471
WARNING Decoded 0x40100471: cont_wrapper
[09:46:54]<<<stack<<<
[09:46:54]
[09:46:54]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[09:46:54]
[09:46:54] ets Jan 8 2013,rst cause:2, boot mode:(3,6)
[09:46:54]
[09:46:54]load 0x4010f000, len 3460, room 16
[09:46:54]tail 4
[09:46:54]chksum 0xcc
[09:46:54]load 0x3fff20b8, len 40, room 4
[09:46:54]tail 4
[09:46:54]chksum 0xc9
[09:46:54]csum 0xc9
[09:46:54]v00068360
[09:46:54]~ld
In case it helps, this is the YAML (with the original code that ran since August):
esphome:
name: power8266
esp8266:
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
wifi:
ssid: "xxxxxx"
password: "xxxxxxxx"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Power8266 Fallback Hotspot"
password: "xxxxxxxxx"
captive_portal:
time:
- platform: homeassistant
id: homeassistant_time
on_time_sync:
then:
- lambda: |-
id(lastpulse) = millis();
globals:
- id: total_e_pulses
type: int
restore_value: false
initial_value: '0'
- id: total_g_pulses
type: int
restore_value: false
initial_value: '0'
- id: lastpulse
type: float
restore_value: false
initial_value: '0'
- id: rotationtime
type: float
restore_value: false
initial_value: '0'
binary_sensor:
- platform: gpio
id: electro_pulse_counter
pin: GPIO12
filters:
- invert:
- delayed_on: 200ms
on_press:
then:
- lambda: |-
id(total_e_pulses) += 1;
id(rotationtime) = (millis() - id(lastpulse)) / 1000;
id(lastpulse) = millis();
- platform: gpio
id: gas_pulse_counter
pin: GPIO5
filters:
- delayed_on: 500ms
on_press:
then:
- lambda: id(total_g_pulses) += 1;
sensor:
- platform: template
name: "Gas usage"
device_class: gas
unit_of_measurement: "mÂł"
state_class: "total_increasing"
icon: "mdi:fire"
accuracy_decimals: 2
lambda: |-
return id(total_g_pulses) * 0.01;
- platform: template
name: "Power usage"
device_class: energy
unit_of_measurement: "kWh"
state_class: "total_increasing"
icon: "mdi:flash"
accuracy_decimals: 2
lambda: |-
return id(total_e_pulses) * 0.0026666666666667;
- platform: template
name: "rotation time"
unit_of_measurement: "s"
update_interval: 30s
lambda: |-
return id(rotationtime);
- platform: template
name: "current watt"
device_class: "power"
unit_of_measurement: "W"
update_interval: 30s
accuracy_decimals: 0
lambda: |-
return 9600 / id(rotationtime);
Not sure what to do with this one, any ideas would be highly appreciated. I could flash the code onto another d1 mini board under a different device name (to narrow things down further), but I’m a bit afraid of messing up my energy statistics.
Thanks a lot in advance! Cheers