A place to put your YouTube video that is ESP8266 related.

User avatar
By Pedro Albuquerque
#55093 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.
Last edited by Pedro Albuquerque on Wed Sep 14, 2016 1:32 pm, edited 1 time in total.
User avatar
By martinayotte
#55104 PROGMEM need to be read by code in a special way since it is coming directly from Flash.
Every places you are using server.send() needs to be replace by its PROGMEM variant server.send_P() to avoid crashes.
User avatar
By Pedro Albuquerque
#55107
martinayotte wrote:PROGMEM need to be read by code in a special way since it is coming directly from Flash.
Every places you are using server.send() needs to be replace by its PROGMEM variant server.send_P() to avoid crashes.


Hello Martinayotte, thank you so much for your explanation, i would never guess, and already tested and confirmed - it WORKS!!! no more resets.

I wonder were I can find information about available methods and purpose, or do I have to dig into the library code ?

thanks once again
Pedro