Skip to content

HTTPClient Guru Meditation Error: Core 0 panic'ed (Unhandled debug exception) in POST method #4567

@mourazo

Description

@mourazo

Hardware:

Board ESP32 nodeMCU
IDE name Arduino IDE
Flash Frequency 80Mhz
PSRAM enabled no
Upload Speed 115200
Computer OS Windows 10

Description:

I try to send post data with the library HTTPClient, but after send somes packets, I have the next exception:

Guru Meditation Error: Core 1 panic'ed (Unhandled debug exception)
Debug exception reason: Stack canary watchpoint triggered (BeginWIFITask)
Core 1 register dump:
PC : 0x4008c30c PS : 0x00060a36 A0 : 0x40081fac A1 : 0x3ffbab40
A2 : 0x3ffbaff0 A3 : 0x00000003 A4 : 0x00000004 A5 : 0x3ffbafe0
A6 : 0x3ffbac10 A7 : 0x00000014 A8 : 0x00000009 A9 : 0x0000005a
A10 : 0x00000024 A11 : 0x0000002a A12 : 0xffffffff A13 : 0x3f42bff0
A14 : 0x3ffbac10 A15 : 0x3ffbae34 SAR : 0x00000004 EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffa

ELF file SHA256: 0000000000000000

Backtrace: 0x4008c30c:0x3ffbab40 0x40081fa9:0x3ffbaf10 0x40114346:0x3ffbafa0 0x400fae0e:0x3ffbafe0 0x400f6ee5:0x3ffbb040 0x400f759b:0x3ffbb0f0 0x400f7727:0x3ffbb150 0x400f774b:0x3ffbb170 0x400d2c02:0x3ffbb190 0x4008966a:0x3ffbb2d0

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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:10900
load:0x40080400,len:6388
entry 0x400806b4

I decode the exception with ESP Exception decoder and this is the result:

PC: 0x4008c30c
EXCVADDR: 0x00000000

Decoding stack results
0x40114346: vsnprintf at ../../../.././newlib/libc/stdio/vsnprintf.c line 41
0x400fae0e: log_printf at C:\Users\alvar\Documents\Arduino\hardware\espressif\esp32\cores\esp32\esp32-hal-uart.c line 533
0x400f6ee5: HTTPClient::handleHeaderResponse() at C:\Users\alvar\Documents\Arduino\hardware\espressif\esp32\libraries\HTTPClient\src\HTTPClient.cpp line 1240
0x400f759b: HTTPClient::sendRequest(char const*, unsigned char*, unsigned int) at C:\Users\alvar\Documents\Arduino\hardware\espressif\esp32\libraries\HTTPClient\src\HTTPClient.cpp line 585
0x400f7727: HTTPClient::POST(unsigned char*, unsigned int) at C:\Users\alvar\Documents\Arduino\hardware\espressif\esp32\libraries\HTTPClient\src\HTTPClient.cpp line 493
0x400f774b: HTTPClient::POST(String) at C:\Users\alvar\Documents\Arduino\hardware\espressif\esp32\libraries\HTTPClient\src\HTTPClient.cpp line 498
0x400d2c02: beginWIFITask(void*) at C:\Users\alvar\Documents\Arduino\CO2_Interfaz_WifiH/tasks.ino line 92
0x4008966a: vPortTaskWrapper at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/port.c line 143

Sketch: (leave the backquotes for code formatting)

The sketch it's too long because I use a display with LVGL library but the exception it's in this part of code only when I use the HttpClient for send the data

void beginWIFITask(void *pvParameters) {


  updateBottomStatus(LV_COLOR_TEAL,"Conectando WIFI: " + ssidName);

  unsigned long startingTime = millis();

  WiFi.begin(ssidName.c_str(), password.c_str());
  while (WiFi.status() != WL_CONNECTED && (millis() - startingTime) < timeout)
  {
    vTaskDelay(250);
  }

   if(WiFi.status() != WL_CONNECTED) {
    updateBottomStatus(LV_COLOR_RED, "Revisa la contraseña y vuelve a intentarlo otra vez");
    vTaskDelay(2500);
    networkScanner();
    vTaskDelete(NULL);
  }

 
  updateBottomStatus(LV_COLOR_GREEN, "CONECTADO CORRECTAMENTE, IP: " +  WiFi.localIP().toString());
 
  while(1){
    if(WiFi.status() == WL_CONNECTED){
     
     delay(100);

     HTTPClient http;

       http.begin(serverName);
        

       // Specify content-type header
       http.addHeader("Content-Type", "application/x-www-form-urlencoded");
       String co2S = String(co2m);
       String tempS = String(temp);
       String humS = String(hum);       
       String httpRequestData = "key=47562jtugj7234785&co2=" + co2S+ "&temp="+ tempS +"&hum=" +humS;
       
       int httpResponseCode = http.POST(httpRequestData);
       
      if (httpResponseCode>0) {
        Serial.print("HTTP Response code: ");
        Serial.println(httpResponseCode);
      }
      
      http.end();
 
 
      updateBottomStatus(LV_COLOR_BLUE, "::Datos enviados correctamentes a Sequosentry::");


    delay(30000);
    updateBottomStatus(LV_COLOR_GREEN, "::Conectando con Sequosentry::");
    }else{
      
                WiFi.begin(ssidName.c_str(), password.c_str());
                while (WiFi.status() != WL_CONNECTED && (millis() - startingTime) < timeout)
                {
                  vTaskDelay(250);
                }
              
                 if(WiFi.status() != WL_CONNECTED) {
                  updateBottomStatus(LV_COLOR_RED, "Revisa la contraseña y vuelve a intentarlo otra vez");
                  vTaskDelay(2500);
                  networkScanner();
                  vTaskDelete(NULL);
                }
      
    }
  }
    updateBottomStatus(LV_COLOR_RED, "::Se perdio la conexion con la red WIFI::");
    delay(10000);
    networkScanner();
    vTaskDelete(NULL);
}

The line 92 of

0x400d2c02: beginWIFITask(void*) at C:\Users\alvar\Documents\Arduino\CO2_Interfaz_WifiH/tasks.ino line 92

its exactly the next line :

int httpResponseCode = http.POST(httpRequestData);

Thanks for all

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions