Closed popy2k14 closed 4 months ago
@lubeda @andrewjswan let's continue here.
The problem is clearly here: https://github.com/lubeda/EspHoMaTriXv2/blob/6a0818f16840d636f8d3760366bfb810d4165aa9/components/ehmtxv2/EHMTX.cpp#L143 But I don’t know why it occurs, maybe we need to add an explicit instruction:
this->display->clear();
Or
if (this->display != NULL)
{
this->display->clear();
}
You are right it happens in clear() but a null check does'nt help.
Code tested:
void EHMTX::set_display_off()
{
this->show_display = false;
ESP_LOGD(TAG, "display off");
if (this->display != NULL)
{
ESP_LOGD(TAG, "display off 2");
this->display->clear();
}
ESP_LOGD(TAG, "display off 3");
for (auto *t : on_show_display_triggers_)
{
t->process(this->show_display);
}
}
[D][template.switch:046]: Restored state OFF
[D][switch:016]: 'Display' Turning OFF.
[D][EHMTXv2:142]: display off
[D][EHMTXv2:145]: display off 2
Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandl ed.
Core 1 register dump:
PC : 0x400d37a8 PS : 0x00060030 A0 : 0x800dba37 A1 : 0x3f fb2390
A2 : 0x00000000 A3 : 0x401ba8d0 A4 : 0x00000000 A5 : 0x00 000000
A6 : 0x00000001 A7 : 0x3ffb08c0 A8 : 0x800d37a0 A9 : 0x3f fb2370
A10 : 0x00000000 A11 : 0x3ffb2398 A12 : 0x3ffb239c A13 : 0x00 007ffe
A14 : 0x00000005 A15 : 0x00000001 SAR : 0x00000004 EXCCAUSE: 0x00 00001d
EXCVADDR: 0x00000000 LBEG : 0x4008b191 LEND : 0x4008b1a1 LCOUNT : 0xff ffffff
Backtrace:0x400d37a5:0x3ffb23900x400dba34:0x3ffb23c0 0x401b8dc9:0x3ffb23f0 0x400 db6dd:0x3ffb2410 0x400db70d:0x3ffb2430 0x400db6c2:0x3ffb2450 0x400ded14:0x3ffb24 70 0x400fb2ad:0x3ffb2490 0x400faf41:0x3ffb24b0 0x401ba7a7:0x3ffb24d0 0x401b9d49: 0x3ffb24f0 0x400f1181:0x3ffb2510 0x400f0afb:0x3ffb2530 0x400f1108:0x3ffb2550 0x4 00f1116:0x3ffb2580 0x401ba225:0x3ffb25a0 0x401ba2c1:0x3ffb25c0 0x400f9269:0x3ffb 25e0 0x400ff192:0x3ffb2610 0x4010d39a:0x3ffb2820
ELF file SHA256: 0000000000000000
Rebooting...
Because it reaches the "display off 2" log, it seems display is NOT NULL, hence executing clear().
Any ideas?
Because it reaches the "display off 2" log, it seems display is NOT NULL, hence executing clear().
That’s what I thought, the object was created, but it’s not completely initialized, it’s a fall inside the ESPHome. Here you need to look for a problem in ESPHome, or change tactics.
I also thought something like this. Not so deep in esphome, but maybe there is an flag in the display component, which get's set when completly initialized?
Already done a workaround with a "booted" variable, display switch restore_mode: ALWAYS_ON & the triggers on_started_running but i thought it would be good to report it here.
If another user is playing with the restiore_mode, they would also stumble on this issue.
Not so deep in esphome, but maybe there is an flag in the display component, which get's set when completly initialized?
I looked, there is a simple function call, and it should work for me. https://github.com/esphome/esphome/blob/dc0a7b1e205f5fa4e25fd1cadd507c27173636e1/esphome/components/display/display.cpp#L16
@popy2k14 Try change to:
if if (this->is_running)
{
this->display->clear();
}
I make PR ...
Tested PR #227 and it's working. thx
Bug report
Describe the bug
When adding the switch:
The important part is: restore_mode: ALWAYS_OFF which calls "id(rgb8x32)->set_display_off();" at boot and crashes EspHoMaTriXv2.
Additional information
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should not crash
Configuration
see switch above
Logs
Serial log of the crash: