-
• #2
Take a look at Flash storage Module, any js type , web pages, css, js and images by Wilberforce
-
• #3
Has anyone tried compiling Espruino with FS enabled? It used to work, but after something like 1.93 it started freezing up the ESP8266 after flashing. I found it was pretty usable still with 1550 JSVars. this would be really a much more elegant solution than the flash storage module.
Also from looking at the thread, it looks like there are unresolved issues with the flash storage module that were left hanging...
-
• #4
I did test compiling the fs module for esp8266 at the time I got the flashfs filesystem working on the esp32. It needs 4K ram for the buffer as this is the size of the block size of the flash. So you do need to reduce the js vars quite a bit.
Gordon has made some changes that allows js modules to be complied into the firmware, and these don't take up as much space in ram as most of the code stays in flash. So you could compile the modules you need in, so that they will already be available at runtime, so the lack of jsvars might not be as much as an issue.
-
• #5
I also tried to the fs module but no good choice for the small ESP8266.
Now working with native require('flash').write() require('flash').read() calls to save some data when needed.
-
• #6
OK, cool. I'll try that out then -- thanks guys :)
-
• #7
First take a look at module FlashEEPROM
-
• #8
It would appear -- happily -- that the new Storage library in 1v96 solves these problems elegantly. I can even write files out to a lowly ESP-01. Not sure if you've used it yet. :)
-
• #9
Yes I use it because the build in module Storage is amazing!
-
• #10
Love it :)
Hello
I would like to use esp8266 as web server and save files on 4mb esp8266 flash.
what is the best way to save static html/css/js files?
known way (dont want to write fs implementation on top of it):
f = require("Flash");
addr = 0x3C0000; // ESP8266_4MB flashArea[4]
f.write('ABCD',addr);
console.log(E.toString(f.read(1,addr)));
A
=undefined
what is the best way to store files similar to "fs" module?