Releases: mjmcginty/FileServerNodeMCU
ESP File Manager for NodeMCU (ESP8266 and ESP32)
ESP File Manager for NodeMCU (ESP8266 and ESP32)
The differences between NodeMCU for ESP8266 and ESP32 are now very minor. To differentiate between the two I tested wifi.mode ~= nil, which is true for ESP32 but not for ESP8266. Most of the differences are in the WiFi module and what it needs to do to connect, so there are separate Lua files for each. The only other difference that this code ran into was no tmr.wdclr for ESP32.
Note that this entire project was originally written for and tested on ESP8266, however, in the middle of adding support for ESP32 my ESP8266 dev unit died, it won't come out of flash mode after flashing. So I have been unable to test this version, in its final form, on ESP8266 yet.
LFS is disabled at the moment, the call to _init.lua is commented, I will recompile it when my new 8266 comes in the mail.
ESP File Manager for NodeMCU (ESP32)
Branched to support ESP32.
[Minor edit, cosmetic only (help file.)]
See the aptly named help.html for complete setup and usage details.
Edit cfg.lua to determine whether it will initialize WiFi as a station (default) or AP, determined by the value of cfg.Mode. If you leave it in station mode you'll still need to edit cfg.lua to set the SSID and password for your WiFi. (Station mode automatically instantiates AP mode, so both work at the same time, IP for the AP is the default,192.168.4.1, to change that it must be confifured for AP mode only.)
The default file is index.html, the one provided merely loads files.html. Just browse to the IP address of your ESP8266 to load it into your browser.
ESP File Manager for NodeMCU (ESP8266)
See the aptly named help.html for complete setup and usage details.
Edit cfg.lua to determine whether it will initialize WiFi as a station (default) or AP, determined by the value of cfg.Mode. If you leave it in station mode you'll still need to edit cfg.lua to set the SSID and password for your WiFi.
The files wificfgsvr.lua, server.lua and fileupload.lua are bundled into lfs.img, see the NodeMCU docs for a full discussion of LFS. To run without it, comment the third line of init.lua that reads: dofile("_init.lua") Editing wificfgsvr.lua, server.lua and fileupload.lua will have no effect while LFS is enabled.
The default file is index.html, the one provided merely loads files.html. Just browse to the IP address of your ESP8266 to load it into your browser.