Skip to main content
Extending answer
Source Link
Codebreaker007
  • 1.3k
  • 1
  • 6
  • 14

Probably you have no SPIFFS uploaded.
So after flashing the program you have to use ESP8266DataUpload and in your Dir containing the *.ino there has to be a "data" directory in which the file you serve or the dir in your case "/static/" has to exist.

EDIT No the file is not existing ;-) use

 serveStatic("/", SPIFFS, "/static");  //=> no trailing '/'

or use (Be aware that serving dirs static is not working properly. I have every large file in a single static statement including the ageing

 serveStatic("/", SPIFFS, "/static/index.html"); 

Not knowing the size of your static files flash with 2MB FS / or 1MB FS / the problem is that if you don't need OTA you always waste space. I created my personal partition schemes with e.g. 2MB Spiffs/2MB flash/No OTA for the prog.

Your
Your memory should be sized as follows prog size + var size (seen in IDE) + size of the staticlargest (static) files * 1.2 (safety margin) should fill "App memory" around 80%.
As an example your usage is at the moment as follows:
You have at the moment max 400kb for the app AND serving (static) files. You use

  • 3 MB for SPIFFS file system,
  • 512 for OTA,
  • min 100kb for your Debug level

=> how could it keep/load e.g a 300kb file into flash?
Your error code 28 is normally connected to out of memory problems, the error message line two indicates that something should be loaded to memory and cant, We ruled out all other reasons so ...

Probably you have no SPIFFS uploaded.
So after flashing the program you have to use ESP8266DataUpload and in your Dir containing the *.ino there has to be a "data" directory in which the file you serve or the dir in your case "/static/" has to exist.

EDIT No the file is not existing ;-) use

 serveStatic("/", SPIFFS, "/static");  //=> no trailing '/'

or use

 serveStatic("/", SPIFFS, "/static/index.html"); 

Not knowing the size of your static files flash with 2MB FS / or 1MB FS / the problem is that if you don't need OTA you always waste space. I created my personal partition schemes with e.g. 2MB Spiffs/2MB flash/No OTA for the prog.

Your memory should be sized as follows prog size + var size (seen in IDE) + size of the static files * 1.2 (safety margin) should fill "App memory" around 80%.

Probably you have no SPIFFS uploaded.
So after flashing the program you have to use ESP8266DataUpload and in your Dir containing the *.ino there has to be a "data" directory in which the file you serve or the dir in your case "/static/" has to exist.

EDIT No the file is not existing ;-) use

 serveStatic("/", SPIFFS, "/static");  //=> no trailing '/'

or use (Be aware that serving dirs static is not working properly. I have every large file in a single static statement including the ageing

 serveStatic("/", SPIFFS, "/static/index.html"); 

Not knowing the size of your static files flash with 2MB FS / or 1MB FS / the problem is that if you don't need OTA you always waste space. I created my personal partition schemes with e.g. 2MB Spiffs/2MB flash/No OTA for the prog.
Your memory should be sized as follows prog size + var size (seen in IDE) + size of the largest (static) files * 1.2 (safety margin) should fill "App memory" around 80%.
As an example your usage is at the moment as follows:
You have at the moment max 400kb for the app AND serving (static) files. You use

  • 3 MB for SPIFFS file system,
  • 512 for OTA,
  • min 100kb for your Debug level

=> how could it keep/load e.g a 300kb file into flash?
Your error code 28 is normally connected to out of memory problems, the error message line two indicates that something should be loaded to memory and cant, We ruled out all other reasons so ...

Clarification after feedback Code
Source Link
Codebreaker007
  • 1.3k
  • 1
  • 6
  • 14

Probably you have no SPIFFS uploaded.
So after flashing the program you have to use ESP8266DataUpload and in your Dir containing the *.ino there has to be a "data" directory in which the file you serve or the dir in your case "/static/" has to exist.

EDIT No the file is not existing ;-) use

 serveStatic("/", SPIFFS, "/static");  //=> no trailing '/'

or use

 serveStatic("/", SPIFFS, "/static/index.html");  

Not knowing the size of your static files flash with 2MB FS / or 1MB FS / the problem is that if you don't need OTA you always waste space. I created my personal partition schemes with e.g. 2MB Spiffs/2MB flash/No OTA for the prog.

Your memory should be sized as follows prog size + var size (seen in IDE) + size of the static files * 1.2 (safety margin) should fill "App memory" around 80%.

Probably you have no SPIFFS uploaded.
So after flashing the program you have to use ESP8266DataUpload and in your Dir containing the *.ino there has to be a "data" directory in which the file you serve or the dir in your case "/static/" has to exist.

EDIT No the file is not existing ;-) use

 serveStatic("/", SPIFFS, "/static");  //=> no trailing '/'

or use

 serveStatic("/", SPIFFS, "/static/index.html");  

Probably you have no SPIFFS uploaded.
So after flashing the program you have to use ESP8266DataUpload and in your Dir containing the *.ino there has to be a "data" directory in which the file you serve or the dir in your case "/static/" has to exist.

EDIT No the file is not existing ;-) use

 serveStatic("/", SPIFFS, "/static");  //=> no trailing '/'

or use

 serveStatic("/", SPIFFS, "/static/index.html"); 

Not knowing the size of your static files flash with 2MB FS / or 1MB FS / the problem is that if you don't need OTA you always waste space. I created my personal partition schemes with e.g. 2MB Spiffs/2MB flash/No OTA for the prog.

Your memory should be sized as follows prog size + var size (seen in IDE) + size of the static files * 1.2 (safety margin) should fill "App memory" around 80%.

Clarification after feedback Code
Source Link
Codebreaker007
  • 1.3k
  • 1
  • 6
  • 14

Probably you have no SPIFFS uploaded.
So after flashing the program you have to use ESP8266DataUpload and in your Dir containing the *.ino there has to be a "data" directory in which the file you serve or the dir in your case "/static/" has to exist.

EDIT No the file is not existing ;-) use

 serveStatic("/", SPIFFS, "/static");  //=> no trailing '/'

or use

 serveStatic("/", SPIFFS, "/static/index.html");  

Probably you have no SPIFFS uploaded.
So after flashing the program you have to use ESP8266DataUpload and in your Dir containing the *.ino there has to be a "data" directory in which the file you serve or the dir in your case "/static/" has to exist.

Probably you have no SPIFFS uploaded.
So after flashing the program you have to use ESP8266DataUpload and in your Dir containing the *.ino there has to be a "data" directory in which the file you serve or the dir in your case "/static/" has to exist.

EDIT No the file is not existing ;-) use

 serveStatic("/", SPIFFS, "/static");  //=> no trailing '/'

or use

 serveStatic("/", SPIFFS, "/static/index.html");  
Source Link
Codebreaker007
  • 1.3k
  • 1
  • 6
  • 14
Loading