ESP12E crash when using PROGMEM
Posted: Wed Sep 14, 2016 9:50 am
I've been exploring the ESP8266 having previous experience using Moteino (arduino based board from LowPower labs).
In this approach i was inspired and based my projects on Andreas Spiess video tutorials (thank so much for this enlightening videos) and and code.
My platform is a ESP12E board, and using Arduino IDE 1.6.9 with board version 2.3.0.
All compilation done choosing board NodeMCU 1.0 (ESP12E) with 4M (3M SPIFFS).
I started by creating a template on which I would base my several projects, one that would include OTA, and Web config page that would save configuration on EEPROM.
Code can be found here -> https://github.com/Pedroalbuquerque/template
The original source used the PROGMEM modifier on all static string like html page definition like
"//
// HTML PAGE
//
const char PAGE_AdminMainPage[] PROGMEM= R"=====(
<meta name="viewport" content="width=device-width, initial-scale=1" />
<strong>Administration</strong>
<hr>
<a"..
with this declaration every time I access one from a browser the processor resets.
Changing it to
"//
// HTML PAGE
//
const char PAGE_AdminMainPage[] = R"=====(
<meta name="viewport" content="width=device-width, initial-scale=1" />
<strong>Administration</strong>
<hr>
<a"...
solves the problem.
Couldn't find out why so far.
With isolated PROGRAM var declaration on a basic sketch with just one var, this seems to work, but not on a more complex sketch with several declarations.
Could that be a bug in the ESP8266WebServer object in the server.on ( "/", []() ...) method something related to the size of the string pointer the method is expecting being diferente when there is a PROGMEM string var or regular string var ?
Did any one had this problem ?
problem can be seen on the video(.mov) also available on github.
In this approach i was inspired and based my projects on Andreas Spiess video tutorials (thank so much for this enlightening videos) and and code.
My platform is a ESP12E board, and using Arduino IDE 1.6.9 with board version 2.3.0.
All compilation done choosing board NodeMCU 1.0 (ESP12E) with 4M (3M SPIFFS).
I started by creating a template on which I would base my several projects, one that would include OTA, and Web config page that would save configuration on EEPROM.
Code can be found here -> https://github.com/Pedroalbuquerque/template
The original source used the PROGMEM modifier on all static string like html page definition like
"//
// HTML PAGE
//
const char PAGE_AdminMainPage[] PROGMEM= R"=====(
<meta name="viewport" content="width=device-width, initial-scale=1" />
<strong>Administration</strong>
<hr>
<a"..
with this declaration every time I access one from a browser the processor resets.
Changing it to
"//
// HTML PAGE
//
const char PAGE_AdminMainPage[] = R"=====(
<meta name="viewport" content="width=device-width, initial-scale=1" />
<strong>Administration</strong>
<hr>
<a"...
solves the problem.
Couldn't find out why so far.
With isolated PROGRAM var declaration on a basic sketch with just one var, this seems to work, but not on a more complex sketch with several declarations.
Could that be a bug in the ESP8266WebServer object in the server.on ( "/", []() ...) method something related to the size of the string pointer the method is expecting being diferente when there is a PROGMEM string var or regular string var ?
Did any one had this problem ?
problem can be seen on the video(.mov) also available on github.