Skip to content

GET request exception 29 #6001

@dzmpr

Description

@dzmpr

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: Nodemcu v1.0 (esp-12e)
  • Core Version: v2.4.2
  • Development Env: Arduino IDE/PlatformIO
  • Operating System: Windows

Settings in IDE

  • Module: Nodemcu
  • Flash Mode: default
  • Flash Size: 4MB
  • lwip Variant: v2 Lower Memory
  • Reset Method: nodemcu
  • Flash Frequency: 40Mhz
  • CPU Frequency: 80Mhz
  • Upload Using: SERIAL
  • Upload Speed: 115200

Problem Description

In function which recieve data from server over HTTPS protocol, in case when certificate is incorrect ESP throws exception. Decoded stack below:

Exception 29: StoreProhibited: A store referenced a page mapped with an attribute that does not permit stores
Decoding 20 results
0x4020588e: WiFiClient::WiFiClient() at ?? line ?
0x4010654d: millis at ?? line ?
0x4020ac7c: BearSSL::WiFiClientSecure::_run_until(unsigned int, bool) at ?? line ?
0x4010654d: millis at ?? line ?
0x4020ac7c: BearSSL::WiFiClientSecure::_run_until(unsigned int, bool) at ?? line ?
0x401004e4: malloc at ?? line ?
0x40209950: operator new(unsigned int) at ?? line ?
0x40205c56: BearSSLTraits::create() at ?? line ?
0x40206359: HTTPClient::connect() at ?? line ?
0x40206b8c: HTTPClient::sendRequest(char const*, unsigned char*, unsigned int) at ?? line ?
0x40207ffc: HardwareSerial::write(unsigned char const*, unsigned int) at ?? line ?
0x402082a5: Print::write(char const*) at ?? line ?
0x40206c3e: HTTPClient::GET() at ?? line ?
0x40202aec: Strip_Control::_getData() at ?? line ?
0x40209b90: esp_yield at ?? line ?
0x4020360b: Strip_Control::start() at ?? line ?
0x40203c7c: loop at ?? line ?
0x40209c1c: loop_wrapper() at core_esp8266_main.cpp line ?
0x40100721: cont_wrapper at ?? line ?

Function _getData() calls every 2 seconds. On 2-3d call appears exception.
Intresting fact, when I disable debug (DEBUG_S, DEBUG_N functions) all works well, and exception do not appears. Also I wrote simple sketch where just 10 requests to server - all requests goes through.

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

#define SSID "ssid"
#define PASS "pass"

void setup() {
    Serial.begin(115200);
    WiFi.begin(SSID,PASS);
    while(WiFi.status() != WL_CONNECTED) {
        Serial.print(".");
        delay(500);
    }
    Serial.println("\nWifi connected!");

    uint8_t cert[20] = {42+1,180,2,164,216,43,148,148,229,203,186,227,194,178,70,121,142,36,244,105};

    HTTPClient https;
    https.setReuse(true);
    String url = "url";
    https.begin(url,cert);
    Serial.println(https.GET());
    Serial.println(https.connected());
    for(uint8_t i = 0; i < 10; i++) {
        Serial.print(String(i)+" : ");
        Serial.println(https.GET());
        Serial.println(https.getString());
        delay(1000);
    }
    
}

void loop() {
}

MCVE Sketch

void Strip_Control::_getData() {
    _response_code = _https.GET();
    DEBUG_N("[DEBUG]Request sent.");
    if (_response_code == 200) {
        String response;
        response = _https.getString();
        DEBUG_N("[DEBUG]Old response: " + _response);
        DEBUG_N("[DEBUG]Recieved response: " + response);
        if (_response == response) {
            return;
        } else {
            _response = response;
            _isNewData = true;
            return;
        }
    }
    _isNewData = false;
    DEBUG_S("[DEBUG]Request error. Response code: ");
    DEBUG_N(_response_code);
    return;
}

Debug Messages

[DEBUG]Connecting to API - failed.
[DEBUG]Request sent.
[DEBUG]Request error. Response code: -1

Exception (29):
epc1=0x4020588e epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000004 depc=0x00000000

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for feedbackWaiting on additional info. If it's not received, the issue may be closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions