ESP32 Guru Meditation Error with WiFiEspAT Library on PlatformIO

Hello,

I’m working on an ESP32 project using PlatformIO and I’m encountering a “Guru Meditation Error: Core 1 panic’ed (LoadProhibited)” whenever I try to connect to WiFi using the WiFiEspAT library.

Here’s the scenario:

  • I’m using the latest version of PlatformIO with the ESP32 platform.
  • My board is TTGO T7 V1.3 Mini32.
  • The issue occurs when executing the EspAtDrvClass::readRX function.
ELF file SHA256: 70109831e9fd07e0

Rebooting...
ets Jul 29 2019 12:21:46

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:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
Connecting to Wifi SSID mywifi
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400d8826  PS      : 0x00060c30  A0      : 0x800d8abc  A1      : 0x3ffb21c0  
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x00000000  
A6      : 0x00000000  A7      : 0x3ffc21b0  A8      : 0x0000003a  A9      : 0x0000003a  
A10     : 0x00000000  A11     : 0x3f40088c  A12     : 0x00000002  A13     : 0xffffffff  
A14     : 0x3ffb833c  A15     : 0x00000000  SAR     : 0x0000001d  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000000  LBEG    : 0x40087085  LEND    : 0x40087095  LCOUNT  : 0xffffffff  


Backtrace: 0x400d8823:0x3ffb21c0 0x400d8ab9:0x3ffb21f0 0x400d8fce:0x3ffb2210 0x400d8291:0x3ffb2230 0x400d38c2:0x3ffb2250 0x400dda42:0x3ffb2290
  #0  0x400d8823 in EspAtDrvClass::readRX(char const*, bool, bool) at .pio/libdeps/ttgo-t7-v13-mini32/WiFiEspAT/src/utility/EspAtDrv.cpp:1484
  #1  0x400d8ab9 in EspAtDrvClass::maintain() at .pio/libdeps/ttgo-t7-v13-mini32/WiFiEspAT/src/utility/EspAtDrv.cpp:123
  #2  0x400d8fce in EspAtDrvClass::joinAP(char const*, char const*, unsigned char const*) at .pio/libdeps/ttgo-t7-v13-mini32/WiFiEspAT/src/utility/EspAtDrv.cpp:365
  #3  0x400d8291 in WiFiClass::begin(char const*, char const*, unsigned char const*) at .pio/libdeps/ttgo-t7-v13-mini32/WiFiEspAT/src/WiFi.cpp:86
  #4  0x400d38c2 in setup() at src/main.cpp:142
  #5  0x400dda42 in loopTask(void*) at C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:42

platformio.ini

[env:ttgo-t7-v13-mini32]
platform = espressif32
platform_packages =
    espressif/toolchain-xtensa-esp32
board = ttgo-t7-v13-mini32

; change microcontroller
board_build.mcu = esp32

framework = arduino
upload_port = COM3
upload_speed = 115200
monitor_port = COM3
monitor_speed = 115200
lib_ldf_mode = chain+
lib_deps = 
	SPI
	witnessmenow/UniversalTelegramBot@^1.3.0
	WiFiEspAT
	khoih-prog/MySQL_MariaDB_Generic@^1.7.2
lib_ignore =
	WiFi101
	WiFi101_Generic
	WiFiMulti_Generic
	WiFiNINA_Generic

reboot after WiFi.begin(WIFI_SSID, WIFI_PASSWORD);

void setup()
{
    Serial.begin(115200);
    delay(1000);
    Serial.print("Connecting to Wifi SSID ");
    WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
}

Here’s a snippet of the code causing the issue:

bool EspAtDrvClass::readRX(PGM_P expected, bool bufferData, bool listItem) {
    // Code to handle RX buffer and read data...
    char terminator = '\n';
    // More code...
}

Has anyone else experienced this issue, or does anyone have insights on what might be causing this error and how to resolve it?

Any help would be greatly appreciated!

Thank you!

Wut? You might have a big misunderstandin there, you already are on an ESP32. The “WiFiEspAT” library should only be used if you’re programming a microcontroller that needs to use an external ESP8266 or ESP32 (that’s running the AT+ firmware) for connectivity. That’s not your case. You need to also lib_ignore that library and use the builtin WiFi library. You can find a basic tests sketch at https://github.com/espressif/arduino-esp32/blob/2.0.16/libraries/WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino.

Waaahhhhh!!!
Thank you, @maxgerhardt, for the clarification and the guidance. I misunderstood the purpose of the WiFiEspAT library and its application context. After switching to the standard WiFi library and ignoring WiFiEspAT in my PlatformIO configuration, everything started working perfectly. Your advice was extremely helpful!