Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guru Meditation Error: Core 1 panic'ed - core dump after 2 days of error free operation. #620

Closed
danobot opened this issue Jun 1, 2020 · 11 comments · Fixed by #633
Closed

Comments

@danobot
Copy link

danobot commented Jun 1, 2020

Describe the bug
I configured this on a new ESP32 dev board using v0.9.4beta which I read somewhere contians stability improvements for esp32. (The non beta version didn't work at all for me).
The esp with OMG was running fine for 2 days. Last night it stopped working altogether at 2am. WHen i plugged in to check serial logs, the device had reset itself and lost the wifi configuration entering the wifi AP loop.

Core dump printed (full log at the end):

N: Wifi connected
{"mqtt_server":"10.1.1.2","mqtt_port":"1883","mqtt_user":"omg","mqtt_pass":"","mqtt_topic":"home/","gateway_name":"gw"}
N: RF_EMITTER_PIN: 12                                                                                                           N: RF_RECEIVER_PIN: 27                                                                                                                               N: Setup OpenMQTTGateway end                                                                                                                                                           N: Erasing ESP Config, restarting                                                                                                                                                                                                                                      W: ESP32: Forcing to wifi 0
Guru Meditation Error: Core  1 panic'ed (Cache disabled but cached memory region accessed)
Core 1 register dump:
PC      : 0x40080f81  PS      : 0x00060034  A0      : 0x8008115d  A1      : 0x3ffbe750  
A2      : 0x00000001  A3      : 0x0000000b  A4      : 0x00000000  A5      : 0x3ffbe760  
A6      : 0x000000ba  A7      : 0x00000000  A8      : 0x800814aa  A9      : 0x3f4053c2  
A10     : 0x00000000  A11     : 0x000000ad  A12     : 0x00000000  A13     : 0x3f4053c2  
A14     : 0x00000003  A15     : 0x00060023  SAR     : 0x0000001e  EXCCAUSE: 0x00000007  
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  
Core 1 was running in ISR context:
EPC1    : 0x40086ce3  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x40080f81

Backtrace: 0x40080f81:0x3ffbe750 0x4008115a:0x3ffbe780 0x4008123d:0x3ffbe7b0 0x40084a31:0x3ffbe7d0 0x40086ce0:0x3ffba190 0x40082e4b:0x3ffba1b0 0x40088e3d:0x3ffba1d0

Rebooting...

To Reproduce
Not sure how to reproduce it because it was working fine for 2 days, then stopped working and now I am unable to even set it up on ESP32 as it keeps coredumping due to Meditation Error

Expected behavior
Not to cause this kind of low Level error. I'm a software engineer myself and this really stumps me. What is wrong? ESP32 is supported and many people are using it in a production environment. I've had so many issues, same with esp8266.

Do let me know how I can help with this.

Screenshots
Na
Environment (please complete the following information):

Additional context
I tried this on ESP8266 and the logs shows MQTT connection error because the "omg" user was supplied, which is not configured in MQTT server. AFter finding this out, checked the ESP32 again and omitted the MQTT user in configuration, unfortunately no luck.

[E][WebServer.cpp:617] _handleRequest(): request handler not found
*WM: [3] -> www.msftconnecttest.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.4.1 
*WM: [3] lastconxresulttmp: WL_IDLE_STATUS
*WM: [3] lastconxresult: WL_DISCONNECTED
*WM: [2] WiFi Scan ASYNC started 
*WM: [2] <- HTTP Wifi 
*WM: [2] Scan is cached 40365 ms ago
*WM: [1] 8 networks found
*WM: [2] DUP AP: 
*WM: [2] DUP AP: 
*WM: [2] DUP AP: 
*WM: [2] DUP AP: 
*WM: [2] DUP AP: 
*WM: [2] DUP AP: 
*WM: [2] DUP AP: 
*WM: [2] AP:  0 
*WM: [3] lastconxresulttmp: WL_IDLE_STATUS
*WM: [3] lastconxresult: WL_DISCONNECTED
*WM: [3] Sent config page 
*WM: [2] WiFi Scan ASYNC completed in 2324 ms
*WM: [2] WiFi Scan ASYNC found: 7
*WM: [2] Portal Timeout In 106 seconds
*WM: [2] <- HTTP WiFi save  
*WM: [3] Method: POST
*WM: [2] Parameters 
*WM: [2] -------------------- 
*WM: [2] server: 10.1.1.2
*WM: [2] port: 1883
*WM: [2] user: omg
*WM: [2] pass: 
*WM: [2] name: gw
*WM: [2] topic: home
*WM: [2] -------------------- 
*WM: [3] Sent wifi save page 
*WM: [2] process connect 
*WM: [2] Connecting as wifi client... 
*WM: [1] STA static IP:
*WM: [2] setSTAConfig static ip not set 
*WM: [3] WIFI station disconnect 
*WM: [1] Connecting to new AP: unifi_not
*WM: [3] Using Password: ****
*WM: [3] WiFi station enable 
*WM: [1] connectTimeout not set, ESP waitForConnectResult... 
*WM: [2] Connection result: WL_CONNECTED
*WM: [3] lastconxresult: WL_CONNECTED
*WM: [1] Connect to new AP [SUCCESS] 
*WM: [1] Got IP Address: 
*WM: [1] 10.1.1.105 
*WM: [2] disconnect configportal 
*WM: [2] restoring usermode STA
*WM: [2] wifi status: WL_CONNECTED
*WM: [2] wifi mode: STA
*WM: [1] config portal exiting 
N: Wifi connected
                 {"mqtt_server":"10.1.1.2","mqtt_port":"1883","mqtt_user":"omg","mqtt_pass":"","mqtt_topic":"home","gateway_name":"gw"}N: RF_EMITTER_PIN: 12 
                                                                                                                                                             N: RF_RECEIVER_PIN: 27 
                                                                                                                                                                                    N: Setup OpenMQTTGateway end
                                                                                                                                                                                                                N: Erasing ESP Config, restarting
                                                                                                                                                                                                                                                 W: ESP32: Forcing to wifi 0                                                                                                                                                                                                                                                                           Guru Meditation Error: Core  1 panic'ed (Cache disabled but cached memory region accessed)
Core 1 register dump:
PC      : 0x40080f81  PS      : 0x00060034  A0      : 0x8008115d  A1      : 0x3ffbe750  
A2      : 0x00000001  A3      : 0x00000032  A4      : 0x00000000  A5      : 0x00000031  
A6      : 0x000000ba  A7      : 0x00000000  A8      : 0x800814aa  A9      : 0x3f4053c2  
A10     : 0x00000000  A11     : 0x000000ad  A12     : 0x00000000  A13     : 0x3f4053c2  
A14     : 0x00000003  A15     : 0x00060023  SAR     : 0x0000001e  EXCCAUSE: 0x00000007  
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  
Core 1 was running in ISR context:
EPC1    : 0x40086ce9  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x40080f81

Backtrace: 0x40080f81:0x3ffbe750 0x4008115a:0x3ffbe780 0x4008123d:0x3ffbe7b0 0x40084a31:0x3ffbe7d0 0x40086ce6:0x3ffba190 0x40082e4b:0x3ffba1b0 0x40088e3d:0x3ffba1d0

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

rst:0x3 (SW_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:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5828
entry 0x400806ac
N: 
   ************* WELCOME TO OpenMQTTGateway **************
                                                          W: ESP32: Forcing to wifi 0
                                                                                     {"mqtt_server":"10.1.1.2","mqtt_port":"1883","mqtt_user":"omg","mqtt_pass":"","mqtt_topic":"home","gateway_name":"gw"}*WM: [3] allocating params bytes: 20
*WM: [2] Added Parameter: server
*WM: [2] Added Parameter: port
*WM: [2] Added Parameter: user
*WM: [2] Added Parameter: pass
*WM: [2] Added Parameter: name
*WM: [3] Updated _max_params: 10
*WM: [3] re-allocating params bytes: 40
*WM: [2] Added Parameter: topic
N: Attempting Wifi connection with saved AP: 0
                                              [E][WiFiSTA.cpp:219] begin(): connect failed!
N: Attempting Wifi connection with saved AP: 1
                                              [E][WiFiSTA.cpp:219] begin(): connect failed!
N: Attempting Wifi connection with saved AP: 2
                                              [E][WiFiSTA.cpp:219] begin(): connect failed!
*WM: [1] AutoConnect 
*WM: [2] ESP32 event handler enabled 
*WM: [2] Connecting as wifi client... 
*WM: [1] STA static IP:
*WM: [2] setSTAConfig static ip not set 
*WM: [3] WIFI station disconnect 
*WM: [1] No saved credentials, skipping wifi 
*WM: [2] Connection result: WL_NO_SSID_AVAIL
*WM: [3] lastconxresult: WL_NO_SSID_AVAIL
*WM: [1] AutoConnect: FAILED 
*WM: [2] AccessPoint set password is VALID 
*WM: [1] your_password 
*WM: [3] WIFI station disconnect 
*WM: [3] WiFi station enable 
*WM: [2] Disabling STA 
*WM: [2] Enabling AP 
*WM: [1] StartAP with SSID:  OpenMQTTGateway_ESP32_RF
*WM: [1] AP IP address: 192.168.4.1
*WM: [3] setupConfigPortal 
*WM: [1] Starting Web Portal 
*WM: [3] dns server started with ip:  192.168.4.1
*WM: [2] HTTP server started 
*WM: [2] WiFi Scan ASYNC started 
*WM: [2] Config Portal Running, blocking, waiting for clients... 
*WM: [2] WiFi Scan ASYNC completed in 2511 ms
*WM: [2] WiFi Scan ASYNC found: 8
*WM: [2] Portal Timeout In 91 seconds
*WM: [2] Portal Timeout In 61 seconds
*WM: [2] Portal Timeout In 31 seconds

omitting the MQTT user on ESP32 as deployment to ESP8266 showed MQTT errors in the logs

*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP WiFi save  
*WM: [3] Method: POST
*WM: [2] Parameters 
*WM: [2] -------------------- 
*WM: [2] server: 10.1.1.2
*WM: [2] port: 1883
*WM: [2] user: 
*WM: [2] pass: 
*WM: [2] name: gw
*WM: [2] topic: home/
*WM: [2] -------------------- 
*WM: [3] Sent wifi save page 
*WM: [2] process connect 
*WM: [2] Connecting as wifi client... 
*WM: [1] STA static IP:
*WM: [2] setSTAConfig static ip not set 
*WM: [3] WIFI station disconnect 
*WM: [1] Connecting to new AP: unifi_not
*WM: [3] Using Password: ********
*WM: [3] WiFi station enable 
*WM: [1] connectTimeout not set, ESP waitForConnectResult... 
*WM: [2] Connection result: WL_CONNECTED
*WM: [3] lastconxresult: WL_CONNECTED
*WM: [1] Connect to new AP [SUCCESS] 
*WM: [1] Got IP Address: 
*WM: [1] 10.1.1.96 
*WM: [2] disconnect configportal 
*WM: [2] restoring usermode STA
*WM: [2] wifi status: WL_CONNECTED
*WM: [2] wifi mode: STA
*WM: [1] config portal exiting 
N: Wifi connected
                 {"mqtt_server":"10.1.1.2","mqtt_port":"1883","mqtt_user":"","mqtt_pass":"","mqtt_topic":"home/","gateway_name":"gw"}N: RF_EMITTER_PIN: 12 
                                                                                                                                                           N: RF_RECEIVER_PIN: 27 
                                                                                                                                                                                  N: Setup OpenMQTTGateway end
                                                                                                                                                                                                              N: Erasing ESP Config, restarting
                                                                                                                                                                                                                                               W: ESP32: Forcing to wifi 0
                                                                                                                                                                                                                                                                          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:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5828
entry 0x400806ac
N: 
   ************* WELCOME TO OpenMQTTGateway **************
                                                          W: ESP32: Forcing to wifi 0
                                                                                     *WM: [3] allocating params bytes: 20
*WM: [2] Added Parameter: server
*WM: [2] Added Parameter: port
*WM: [2] Added Parameter: user
*WM: [2] Added Parameter: pass
*WM: [2] Added Parameter: name
*WM: [3] Updated _max_params: 10
*WM: [3] re-allocating params bytes: 40
*WM: [2] Added Parameter: topic
@danobot danobot changed the title Core dump after 2 days of error free operation. Guru Meditation Error: Core 1 panic'ed - core dump after 2 days of error free operation. Jun 1, 2020
@1technophile
Copy link
Owner

1technophile commented Jun 1, 2020

Not sure how to reproduce it because it was working fine for 2 days, then stopped working and now I am unable to even set it up on ESP32 as it keeps coredumping due to Meditation Error

You may try to erase the flash before a new upload to see if it is still core dumping.

Could you post your configuration used (env definition from platformio.ini) and user_config.h if you modified it?

Could you indicate your router model and eventually try with your smartphone as an internet AP?

Were you on development branch or on BLE refactor PR branch?

@danobot
Copy link
Author

danobot commented Jun 2, 2020

  • erased flash, cleaned build and reuploaded - same

platformio.ini: No customisation other than uncommenting the esp32dev-rf profile

default_envs = esp32dev-rf

User_config.h
Updated MQTT server details by removing credentials and updating IP address:
image

and changed the time_avoid_duplicate value to 150ms:
image

Router Model: UniFi AP-nanoHD (small business router with strong,reliable Wifi connection)

Version: Release 0.9.4beta Github Pre Release
Wifi Manager setup:
image

ESP32 Logs with RF module attached (core dump happens):

*WM: [3] Sent wifi save page 
*WM: [2] process connect 
*WM: [2] Connecting as wifi client... 
*WM: [1] STA static IP:
*WM: [2] setSTAConfig static ip not set 
*WM: [3] WIFI station disconnect 
*WM: [1] Connecting to new AP: unifi_not
*WM: [3] Using Password: ********
*WM: [3] WiFi station enable 
*WM: [1] connectTimeout not set, ESP waitForConnectResult... 
*WM: [2] Connection result: WL_CONNECTED
*WM: [3] lastconxresult: WL_CONNECTED
*WM: [1] Connect to new AP [SUCCESS] 
*WM: [1] Got IP Address: 
*WM: [1] 10.1.1.96 
*WM: [2] disconnect configportal 
*WM: [2] restoring usermode STA
*WM: [2] wifi status: WL_CONNECTED
*WM: [2] wifi mode: STA
*WM: [1] config portal exiting 
N: Wifi connected
                 {"mqtt_server":"10.1.1.2","mqtt_port":"1883","mqtt_user":"","mqtt_pass":"","mqtt_topic":"home/","gateway_name":"gw"}N: RF_EMITTER_PIN: 12 
                                                                                                                                                           N: RF_RECEIVER_PIN: 27 
                                                                                                                                                                                  N: Setup OpenMQTTGateway end
                                                                                                                                                                                                              N: Erasing ESP Config, restarting
                                                                                                                                                                                                                                               W: ESP32: Forcing to wifi 0
                                                                                                                                                                                                                                                                          Guru Meditation Error: Core  1 panic'ed (Cache disabled but cached memory region accessed)
Core 1 register dump:
PC      : 0x40080f7f  PS      : 0x00060034  A0      : 0x8008115d  A1      : 0x3ffbe750  
A2      : 0x00000001  A3      : 0x0000001a  A4      : 0x0000001a  A5      : 0x00000031  
A6      : 0x000000ba  A7      : 0x00000000  A8      : 0x800814aa  A9      : 0x3f4053c2  
A10     : 0x00000000  A11     : 0x000000ad  A12     : 0x8008a633  A13     : 0x3f4053c2  
A14     : 0x00000008  A15     : 0x00000001  SAR     : 0x00000014  EXCCAUSE: 0x00000007  
EXCVADDR: 0x00000000  LBEG    : 0x4000c349  LEND    : 0x4000c36b  LCOUNT  : 0xffffffff  
Core 1 was running in ISR context:
EPC1    : 0x400621b0  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x40080f7f

Backtrace: 0x40080f7f:0x3ffbe750 0x4008115a:0x3ffbe780 0x4008123d:0x3ffbe7b0 0x40084a31:0x3ffbe7d0 0x400621ad:0x3ffb1c70 0x40092672:0x3ffb1ca0 0x40092711:0x3ffb1cd0 0x40092ba6:0x3ffb1cf0 0x40087091:0x3ffb1d10 0x40145d96:0x3ffb1d30 0x400f28d1:0x3ffb1d50 0x400f418a:0x3ffb1d80 0x400f1bca:0x3ffb1db0 0x400f14d6:0x3ffb1dd0 0x400e22f0:0x3ffb1e20 0x400d2138:0x3ffb1e40 0x400d48f6:0x3ffb1e60 0x400d5285:0x3ffb1f70 0x400d538b:0x3ffb1f90 0x400e5b75:0x3ffb1fb0 0x40088e3d:0x3ffb1fd0

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

rst:0x3 (SW_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:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5828
entry 0x400806ac
N: 

Logs without RF module attached (core dump does not occur)

   ************* WELCOME TO OpenMQTTGateway **************
                                                          W: ESP32: Forcing to wifi 0
                                                                                     *WM: [3] allocating params bytes: 20
*WM: [2] Added Parameter: server
*WM: [2] Added Parameter: port
*WM: [2] Added Parameter: user
*WM: [2] Added Parameter: pass
*WM: [2] Added Parameter: name
*WM: [3] Updated _max_params: 10
*WM: [3] re-allocating params bytes: 40
*WM: [2] Added Parameter: topic
N: Attempting Wifi connection with saved AP: 0
                                              [E][WiFiSTA.cpp:219] begin(): connect failed!
N: Attempting Wifi connection with saved AP: 1
                                              [E][WiFiSTA.cpp:219] begin(): connect failed!
N: Attempting Wifi connection with saved AP: 2
                                              [E][WiFiSTA.cpp:219] begin(): connect failed!
*WM: [1] AutoConnect 
*WM: [2] ESP32 event handler enabled 
*WM: [2] Connecting as wifi client... 
*WM: [1] STA static IP:
*WM: [2] setSTAConfig static ip not set 
*WM: [3] WIFI station disconnect 
*WM: [1] No saved credentials, skipping wifi 
*WM: [2] Connection result: WL_NO_SSID_AVAIL
*WM: [3] lastconxresult: WL_NO_SSID_AVAIL
*WM: [1] AutoConnect: FAILED 
*WM: [2] AccessPoint set password is VALID 
*WM: [1] your_password 
*WM: [3] WIFI station disconnect 
*WM: [3] WiFi station enable 
*WM: [2] Disabling STA 
*WM: [2] Enabling AP 
*WM: [1] StartAP with SSID:  OpenMQTTGateway_ESP32_RF
*WM: [1] AP IP address: 192.168.4.1
*WM: [3] setupConfigPortal 
*WM: [1] Starting Web Portal 
*WM: [3] dns server started with ip:  192.168.4.1
*WM: [2] HTTP server started 
*WM: [2] WiFi Scan ASYNC started 
*WM: [2] Config Portal Running, blocking, waiting for clients... 
*WM: [2] WiFi Scan ASYNC completed in 2710 ms
*WM: [2] WiFi Scan ASYNC found: 9
[E][WebServer.cpp:617] _handleRequest(): request handler not found
*WM: [3] -> www.msftconnecttest.com 
*WM: [2] <- Request redirected to captive portal 
[E][WebServer.cpp:617] _handleRequest(): request handler not found
*WM: [3] -> www.msftconnecttest.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.4.1 
*WM: [3] lastconxresulttmp: WL_IDLE_STATUS
*WM: [3] lastconxresult: WL_DISCONNECTED
*WM: [2] Scan is cached 9806 ms ago
*WM: [2] <- HTTP Wifi 
*WM: [2] Scan is cached 11623 ms ago
*WM: [1] 9 networks found
*WM: [2] AP:  -38 unifi_not
*WM: [2] AP:  -69 Telstra9709E3
*WM: [2] AP:  -70 Telstra Air
*WM: [2] AP:  -70 Fon WiFi
*WM: [2] AP:  -81 WiFi-FBDC
*WM: [2] AP:  -85 NETGEAR70
*WM: [2] AP:  -90 WiFi-3050
*WM: [2] AP:  -91 WiFi-D3ED
*WM: [2] AP:  -95 D-Link DSL-2740B
*WM: [3] lastconxresulttmp: WL_IDLE_STATUS
*WM: [3] lastconxresult: WL_DISCONNECTED
*WM: [3] Sent config page 
*WM: [2] Portal Timeout In 107 seconds
[E][WebServer.cpp:617] _handleRequest(): request handler not found
*WM: [3] -> www.msftconnecttest.com 
*WM: [2] <- Request redirected to captive portal 
[E][WebServer.cpp:617] _handleRequest(): request handler not found
*WM: [3] -> www.msftconnecttest.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP WiFi save  
*WM: [3] Method: POST
*WM: [2] Parameters 
*WM: [2] -------------------- 
*WM: [2] server: 10.1.1.2
*WM: [2] port: 1883
*WM: [2] user: 
*WM: [2] pass: 
*WM: [2] name: gw
*WM: [2] topic: home/
*WM: [2] -------------------- 
*WM: [3] Sent wifi save page 
*WM: [2] process connect 
*WM: [2] Connecting as wifi client... 
*WM: [1] STA static IP:
*WM: [2] setSTAConfig static ip not set 
*WM: [3] WIFI station disconnect 
*WM: [1] Connecting to new AP: unifi_not
*WM: [3] Using Password: ********
*WM: [3] WiFi station enable 
*WM: [1] connectTimeout not set, ESP waitForConnectResult... 
*WM: [2] Connection result: WL_CONNECTED
*WM: [3] lastconxresult: WL_CONNECTED
*WM: [1] Connect to new AP [SUCCESS] 
*WM: [1] Got IP Address: 
*WM: [1] 10.1.1.96 
*WM: [2] disconnect configportal 
*WM: [2] restoring usermode STA
*WM: [2] wifi status: WL_CONNECTED
*WM: [2] wifi mode: STA
*WM: [1] config portal exiting 
N: Wifi connected
                 {"mqtt_server":"10.1.1.2","mqtt_port":"1883","mqtt_user":"","mqtt_pass":"","mqtt_topic":"home/","gateway_name":"gw"}N: RF_EMITTER_PIN: 12 
                                                                                                                                                           N: RF_RECEIVER_PIN: 27 
                                                                                                                                                                                  N: Setup OpenMQTTGateway end
                                                                                                                                                                                                              N: Erasing ESP Config, restarting
                                                                                                                                                                                                                                               W: ESP32: Forcing to wifi 0
                                                                                                                                                                                                                                                                          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:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5828
entry 0x400806ac
N: 
   ************* WELCOME TO OpenMQTTGateway **************
                                                          W: ESP32: Forcing to wifi 0
                                                                                     *WM: [3] allocating params bytes: 20
*WM: [2] Added Parameter: server
*WM: [2] Added Parameter: port
*WM: [2] Added Parameter: user
*WM: [2] Added Parameter: pass
*WM: [2] Added Parameter: name
*WM: [3] Updated _max_params: 10
*WM: [3] re-allocating params bytes: 40
*WM: [2] Added Parameter: topic
N: Attempting Wifi connection with saved AP: 0
                                              [E][WiFiSTA.cpp:219] begin(): connect failed!
N: Attempting Wifi connection with saved AP: 1
                                              [E][WiFiSTA.cpp:219] begin(): connect failed!
N: Attempting Wifi connection with saved AP: 2
                                              [E][WiFiSTA.cpp:219] begin(): connect failed!
*WM: [1] AutoConnect 
*WM: [2] ESP32 event handler enabled 
*WM: [2] Connecting as wifi client... 
*WM: [1] STA static IP:
*WM: [2] setSTAConfig static ip not set 
*WM: [3] WIFI station disconnect 
*WM: [1] No saved credentials, skipping wifi 
*WM: [2] Connection result: WL_NO_SSID_AVAIL
*WM: [3] lastconxresult: WL_NO_SSID_AVAIL
*WM: [1] AutoConnect: FAILED 
*WM: [2] AccessPoint set password is VALID 
*WM: [1] your_password 
*WM: [3] WIFI station disconnect 
*WM: [3] WiFi station enable 
*WM: [2] Disabling STA 
*WM: [2] Enabling AP 
*WM: [1] StartAP with SSID:  OpenMQTTGateway_ESP32_RF
*WM: [1] AP IP address: 192.168.4.1
*WM: [3] setupConfigPortal 
*WM: [1] Starting Web Portal 
*WM: [3] dns server started with ip:  192.168.4.1
*WM: [2] HTTP server started 
*WM: [2] WiFi Scan ASYNC started 
*WM: [2] Config Portal Running, blocking, waiting for clients... 
*WM: [2] WiFi Scan ASYNC completed in 2911 ms
*WM: [2] WiFi Scan ASYNC found: 9

@1technophile
Copy link
Owner

Erasing ESP Config, restarting

This message appears when TRIGGER_PIN is set to low and generate the reset of the ESP.

Do you have something connected to TRIGGER_PIN gpio 0 per default on ESP32 ?

@danobot
Copy link
Author

danobot commented Jun 3, 2020

good point but not that I am aware.. I have:

  • power connected via USB to ESP32.
  • Power connected to RF module and
  • D27 connected to Data pin of RF module.

No special setup, this is complete stock as per documentation. Figured I'd give that a go before customising it. (usb connection not shown below)

IMG_20200603_083442

I have checked the connections. The RF module works perfectly on Raspberry Pi.
Are there specific models for ESP32 that are recommended? Mine is ESP32 DEVKIT V1.
Any known issues with USB power in the long run?

@1technophile
Copy link
Owner

Are there specific models for ESP32 that are recommended? Mine is ESP32 DEVKIT V1.

You can see that in the compatibility list.

Any known issues with USB power in the long run?

This can be of course an issue, I have the case of if connected to an USB Hub the ESP reset continuously.

No special setup, this is complete stock as per documentation. Figured I'd give that a go before customising it. (usb connection not shown below)

Try to change the value of TRIGGER_PIN to 26 to see if you get the same behaviour.

@1technophile
Copy link
Owner

@danobot did you got the opportunity to test with another TRIGGER_PIN ?

@danobot
Copy link
Author

danobot commented Jun 8, 2020

Yes, changing the TRIGGER_PIN allowed me to set up the ESP32 and had it run for 5 days. Last night, it crashed again. Havent checked the logs why it crashed this time yet.

@1technophile 1technophile linked a pull request Jun 14, 2020 that will close this issue
@danobot
Copy link
Author

danobot commented Jun 17, 2020

Thanks for the PR and fix.

@1technophile
Copy link
Owner

I have found something else, I think that there is an issue with the interrupt handling of RCSwitch library in ESP32 context. I'm currently investigating it. The core dump occur especially when the Wifi is disconnected.

@1technophile 1technophile reopened this Jun 20, 2020
@1technophile
Copy link
Owner

1technophile commented Jun 21, 2020

So as to reproduce:

  • with esp32dev-rf either with wifimanager or with manual config
  • let the gateway connect to the wifi and mqtt server
  • deactivate the wifi on your access point
  • after some seconds the following error appears:
T: jsonPublishing
W: MQTT connection...
Guru Meditation Error: Core  1 panic'ed (Cache disabled but cached memory region accessed)
Core 1 register dump:
PC      : 0x40080fe9  PS      : 0x00060034  A0      : 0x800811ca  A1      : 0x3ffbe750
A2      : 0x00000001  A3      : 0x0000001c  A4      : 0x00000000  A5      : 0x00000031
A6      : 0x0000000b  A7      : 0x00000000  A8      : 0x8008151a  A9      : 0x3f402458
A10     : 0x00000000  A11     : 0x000000d0  A12     : 0x00000000  A13     : 0x3f402458
A14     : 0x00000003  A15     : 0x00060023  SAR     : 0x0000001c  EXCCAUSE: 0x00000007  
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000
Core 1 was running in ISR context:
EPC1    : 0x40086d5f  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x40080fe9

Backtrace: 0x40080fe9:0x3ffbe750 0x400811c7:0x3ffbe780 0x400812ad:0x3ffbe7b0 0x40084aa1:0x3ffbe7d0 0x40086d5c:0x3ffba190 0x40082ebb:0x3ffba1b0 0x40088ead:0x3ffba1d0

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

The interesting sentence is Core 1 was running in ISR context:, after some researches I found this and this .

The issue occurs only when using rcswitch library, irremoteESP8266 doesn't generate this problem when using esp32dev-ir.

So the issue seems to be related with interrupts usage (the 2 libraries above use interrupts to detect the coming signals), we can also see that IRRemote ESP8266 user had also this kind of issue.

Let's analyse RCSwitch code:
The first issue that I have found by comparing with IRRemote ESP8266 is the usage of ICACHE_RAM_ATTR instead of IRAM_ATTR for ESP32
But was not enough to get rid of the problem.

I've found an interesting comment saying that the variable used in the interrupt should be put into DRAM (thanks @atanisoft). So I tried to add DRAM_ATTR to the different varaibles accessed by the interrupts functions.
After some trials, bingo, the one that miss the prefix is the list of protocols proto.

I'm going to push the modifications to RCSwitch repositories.

1technophile added a commit that referenced this issue Jun 21, 2020
so as to avoid core dump when using RCSwitch on ESP32 and having wifi disconnection #620
1technophile added a commit to sui77/rc-switch that referenced this issue Jun 21, 2020
And replace ICACHE_RAM_ATTR by IRAM_ATTR for ESP32, so as to avoir core dump when using in conjunction with Wifi
1technophile/OpenMQTTGateway#620
@1technophile
Copy link
Owner

Correction pushed into RCSwitch repositories

1technophile added a commit to sui77/rc-switch that referenced this issue Jun 21, 2020
And replace ICACHE_RAM_ATTR by IRAM_ATTR for ESP32, so as to avoir core dump when using in conjunction with Wifi
1technophile/OpenMQTTGateway#620
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants