Hi all, I was messing around with the ESP8233 version on Board Manager and i think I messed up something on my code since it compiles, uploads but crashes once it receives a simple web request.
I have noticed that after compling, the console prints the following and I don't know what it is.
Console:
Executable segment sizes:
IROM : 303028 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 27916 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1292 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 2088 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 26576 ) - zeroed variables (global, static) in RAM/HEAP
Using the serial monitor and the ESP Exception decoder I'm able to trace the last two command before the the crash but i'm not sure what is going on.
ESP Exception decoder:
Decoding stack results
0x4020e0bf: String::String(char const*) at /Users/me/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.1/cores/esp8266/WString.cpp line 34
0x40203c95: handleRoot() at /Users/me/Documents/Arduino/thisproject/thisproject.ino line 129
The rest of my code looks like this:
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include<string> // for string class
#include "index.h" //Our HTML webpage contents
#ifndef STASSID
#define STASSID "ssid"
#define STAPSK "password"
#endif
const char* ssid = STASSID;
const char* password = STAPSK;
WiFiUDP ntpUDP;
ESP8266WebServer server(80);
void handleRoot() {
String page = MAIN_page;
server.send(200, "text/html", page);
}
Setup()
void setup() {
Serial.begin(115200);
Serial.println("\n\n\n-----------------------\nBooting");
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("Connection Failed! Rebooting...");
delay(5000);
ESP.restart();
}
//--------------------------
//SERVER REQUESTS
server.on("/", handleRoot);
server.begin();
Serial.println("HTTP server started");
}
Loop()
void loop() {
MDNS.update();
server.handleClient();
}
I appreciate your help!