Closed misterinterrupt closed 5 years ago
What build does is
So you would need the init.lua in fs and the other files in the lua folder.
To "install" the LUA image you need to node.flashrestore("LFS.img")
. This will write the LFS image to the reserved space and reboot.
If it does not reboot an explanation is returned by node.flashrestore.
On success the LFS.img file can then be deleted.
To see how to activate LFS you can have a look at nodemcu-firmware\lua_examples\lfs\_init.lua
which gives usefull additions. It tweaks dofile, loadfile and require to load stuff from the LFS image. Put it in the LFS image too.
Also have a look at nodemcu-firmware\lua_examples\lfs\lfs_fragments.lua
at the bottom to see how to tweak you init.lua to activate it all.
So the only file you need outside the LFS image is init.lua
.
@HHHartmann I'm grateful for you to pick up this support case, thank you. I will close it as doesn't concern this project but we can still continue here.
@misterinterrupt are you familiar with https://nodemcu.readthedocs.io/en/latest/lfs/?
thanks a ton for your help @HHHartmann ! looks like I was pretty close. @marcelstoer apologies if this is the wrong place to ask. I did read through that LFS doc page a couple times, but I didn't quite understand the 'why' of doing it or the necessity of it.. It seems like I do need to set up a filesystem. I just couldn't find a doc that communicated something very high level like the list of steps that I put above, at least not that included anything beyond build and flash the firmware.
Over in the firmware project developers (and we ourselves) noticed that there's quite a large gap between the "First steps" document and the LFS whitepaper. It is being addressed in https://github.com/nodemcu/nodemcu-firmware/issues/2656. Somewhere in the middle of that issue a user proposed some instructions which are tailored for Windows.
hmm okay, if its needed, I can put together my notes and submit a linux-focused doc, but it looks like that text file includes the use of nodemcu-tool so that works!
Hi there, thanks for all your awesome work! I am just getting into working with the nodemcu 0.9 and I have not been able to figure out what to do with the LFS image.. the README shows the use of the docker image to
~at one point, I thought the firmware build would take care of the SPIFFS/LFS needs.. I have the default
init.lua
in thelocal/lua
folder along with thecredentials.lua
file I also put a copy of an mqtt lua example into thelocal/fs
dironce I built and flashed the firmware, I run nodemcu-tool fsinfo and see this:
somewhat different than what I have seen in examples, but is that it, and its working as it should?
I am looking for a high level explanation of what is supposed to be done with the nodemcu regarding the filesystems.. there seems to be docs talking about all the parts, but what is the LFS for? do you need one on the nodemcu in order to run lua code on it?
Thanks for any pointers!