How to use esp8266 4mb of flash for file storage (html/css/js)? #6020
Replies: 1 comment
-
Posted at 2018-01-21 by @MaBecker Take a look at Flash storage Module, any js type , web pages, css, js and images by Wilberforce Posted at 2018-02-06 by hungryforcodes 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... Posted at 2018-02-07 by Wilberforce 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. Posted at 2018-02-07 by @MaBecker 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. Posted at 2018-02-10 by hungryforcodes OK, cool. I'll try that out then -- thanks guys :) Posted at 2018-02-10 by @MaBecker First take a look at module FlashEEPROM Posted at 2018-02-24 by hungryforcodes 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. :) Posted at 2018-02-24 by @MaBecker Yes I use it because the build in module Storage is amazing! Posted at 2018-03-06 by hungryforcodes Love it :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-01-20 by duplicator
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?
Beta Was this translation helpful? Give feedback.
All reactions