Code: Select all
static esp_err_t Http_Event_Handler( esp_http_client_event_t *evt )
{
switch ( evt->event_id )
{
case HTTP_EVENT_ERROR:
{
break;
}
case HTTP_EVENT_ON_CONNECTED:
{
break;
}
case HTTP_EVENT_HEADER_SENT:
{
break;
}
case HTTP_EVENT_ON_HEADER:
{
break;
}
case HTTP_EVENT_ON_DATA:
{
if ( !esp_http_client_is_chunked_response( evt->client ) )
{
strncpy( httpReceiveBuffer, ( char* )evt->data, evt->data_len );
}
break;
}
case HTTP_EVENT_ON_FINISH:
{
break;
}
case HTTP_EVENT_DISCONNECTED:
{
break;
}
}
return ESP_OK;
}
boolean Check_Firmware_Upgrade( void )
{
ESP_LOGI( LOG_TAG_MAIN, "Looking for a new firmware..." );
esp_http_client_config_t config;
esp_http_client_handle_t client;
config.url = "https://mysite.org/ota/firmware.json";
config.event_handler = Http_Event_Handler;
client = esp_http_client_init( &config );
[...]
return true;
}
[main.cpp:358] Check_Firmware_Upgrade(): Looking for a new firmware...
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x4008f554 PS : 0x00060f30 A0 : 0x800dca10 A1 : 0x3ffd3600
A2 : 0x800d1e49 A3 : 0x800d1e45 A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000001 A9 : 0x00000000
A10 : 0x3ffe0768 A11 : 0x3f4039e0 A12 : 0x000000ff A13 : 0x0000ff00
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x800d1e49 LBEG : 0x4008e9c9 LEND : 0x4008e9e1 LCOUNT : 0xfffffffe
ELF file SHA256: 0000000000000000
Backtrace: 0x4008f554:0x3ffd3600 0x400dca0d:0x3ffd3610 0x400d41cb:0x3ffd3630 0x400d1e4c:0x3ffd36b0 0x40092702:0x3ffd3760
Rebooting...
I tryed to keep in the Check_Firmware_Upgrade function only the esp_http_client_init and the error still, if I remove it the error disappears.
What am I doing wrong? Any suggestion?