* added - usage info for LFS targets - lfs.img build rule (requires luac.cross from nodemcu-firmware) - basic autodetection for USB serial device * updated LFS code for recent nodemcu versions * safe default (SOFTAP) * Revert "safe default (SOFTAP)" This reverts commit a76db2a153f421cc81e9c1caf0903d550043b1d6. * removed compatibility code * updated nodemcu-firmware requirement Co-authored-by: langausd <langausd@github.com>
30 lines
713 B
Lua
30 lines
713 B
Lua
-- check/flash/use LFS support, if possible
|
|
if node.getpartitiontable().lfs_size > 0 then
|
|
if file.exists("lfs.img") then
|
|
if file.exists("lfs_lock") then
|
|
file.remove("lfs_lock")
|
|
file.remove("lfs.img")
|
|
else
|
|
local f = file.open("lfs_lock", "w")
|
|
f:flush()
|
|
f:close()
|
|
file.remove("httpserver-compile.lua")
|
|
node.LFS.reload("lfs.img")
|
|
end
|
|
end
|
|
pcall(node.flashindex("_init"))
|
|
end
|
|
|
|
-- Compile freshly uploaded nodemcu-httpserver lua files.
|
|
if file.exists("httpserver-compile.lua") then
|
|
dofile("httpserver-compile.lua")
|
|
file.remove("httpserver-compile.lua")
|
|
end
|
|
|
|
|
|
-- Set up NodeMCU's WiFi
|
|
dofile("httpserver-wifi.lc")
|
|
|
|
-- Start nodemcu-httpsertver
|
|
dofile("httpserver-init.lc")
|