I am using esp32 nodemcu with arduino framework building with platformIO.
Here's my platformio.ini
:
[env:nodemcu-32s]
platform = espressif32
board = nodemcu-32s
framework = arduino
lib_deps =
bcl@^0.0.5
ArduinoJson@^6.15.1
micro-ecc@^1.0.0
BIP66@^0.3.2
Ark-Cpp-Crypto@^1.1.0
Ark-Cpp-Client@^1.4.1
HTTP requests are randomly throwing the following error (Sometimes they work once, sometimes twice, and then force the controller to reboot):
Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x00000000 PS : 0x00060830 A0 : 0x801361d7 A1 : 0x3ffb1d50
A2 : 0x3ffb1e90 A3 : 0x00000000 A4 : 0x3ffd62a4 A5 : 0x0000004b
A6 : 0x3ffd6304 A7 : 0x0000004b A8 : 0x80162562 A9 : 0x3ffb1d30
A10 : 0x3ffcbe1c A11 : 0x00000000 A12 : 0x0000004b A13 : 0x00000000
A14 : 0xffffffff A15 : 0x00000004 SAR : 0x0000000a EXCCAUSE: 0x00000014
EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000
Backtrace: 0x00000000:0x3ffb1d50 0x401361d4:0x3ffb1d70 0x40136241:0x3ffb1d90 0x400d5b42:0x3ffb1db0 0x400d27d6:0x3ffb1f30 0x400d10b6:0x3ffb1f70 0x400d7861:0x3ffb1fb0 0x40088b9d:0x3ffb1fd0
void loop()
{
string nodeStatus = connection.api.node.status();
Serial.println(nodeStatus.c_str());
delay(3000);
}
I made a simple workaround for myself which is in no way a general solution but just to demonstrate what worked for me and stopped my controller from rebooting with calling one of the non-deprecated constructors:
std::string get(const char* request) override {
WiFiClientSecure client;
HTTPClient httpClient;
httpClient.setReuse(false);
httpClient.setTimeout(3000);
httpClient.addHeader("Content-Type", "application/json");
String ret;
httpClient.begin(client, std::string(std::string(request)).c_str());
int httpCode = httpClient.GET();
ret = httpClient.getString();
httpClient.end();
return ret.c_str();
}