Hi,
I've started a module that stores and recovers JavaScript fragments in esp8266 flash.
The first 4096 byte page is used to store a json string that holds a structure.
The first part of this contains the length, and the rest is an associate array holding keys, and the start page and number of pages for the object stored at this key.
The idea is to be able to store css, html, and js fragments in flash.
Using a .pipe method, requests to these resources can be streamed out to the browser using very little memory overhead.
I have also tested storing functions and eval'ing to load and run the function.
I'm also experimenting with a cache type function - where you specify the source uri, this is fetched from the web, and then stored in cache.
This means images, bootstrap.css and other resources can be stored on the device, meaning it can be run in ap mode, and still have a decent looking interface. This means that a page could be set up, which does a wifi scan, provides a select list of access points, and asks a password to join a network.
Let me know if you would like to see the code so far.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi,
I've started a module that stores and recovers JavaScript fragments in esp8266 flash.
The first 4096 byte page is used to store a json string that holds a structure.
The first part of this contains the length, and the rest is an associate array holding keys, and the start page and number of pages for the object stored at this key.
The idea is to be able to store css, html, and js fragments in flash.
Using a .pipe method, requests to these resources can be streamed out to the browser using very little memory overhead.
I have also tested storing functions and eval'ing to load and run the function.
I'm also experimenting with a cache type function - where you specify the source uri, this is fetched from the web, and then stored in cache.
This means images, bootstrap.css and other resources can be stored on the device, meaning it can be run in ap mode, and still have a decent looking interface. This means that a page could be set up, which does a wifi scan, provides a select list of access points, and asks a password to join a network.
Let me know if you would like to see the code so far.