Importing a module from memory, not disk

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
jcea
Posts: 27
Joined: Fri Mar 18, 2016 5:28 pm

Importing a module from memory, not disk

Post by jcea » Wed Mar 29, 2017 11:18 pm

My project (running on an ESP8266) downloads the last version of the code from the web, at every boot. I would like very much to be able to "import" that code without touching the flash filesystem, possibly from memory. Is that possible?.

Any idea?.

PS: My current approach is to store the new module in the flash filesystem to be imported immediately, but keeping the ETAG around to do a conditional HTTP fetch and only update the flash when the original code changed in the server, not at every reboot. Being able to import from memory would be far more easier and I would like to avoid wearing out the flash, too.

Post Reply