I'm trying to run nodemcu on an ESP32 (more memory than esp8266). I've build the firmware using the sources from https://github.com/nodemcu/nodemcu-firmware.git, the dev-esp32 branch. The build was done on a windows/WSL2/Ubuntu system.
The firmware works, however I am having issues with uploading and saving lua files. I've tried various tools, for example http://chilipeppr.com/esp32.
Functions like 'Heap' and 'Reset' work fine. However, uploading files fails. The console output is:
file.open("unnamed1.lua", "w")
file.writeline([[print("Test")]])
file.writeline([[]])
file.close()
node.compile("unnamed1.lua")
> file.open("unnamed1.lua", "w")
Lua error: stdin:1: attempt to call field 'open' (a nil value)
stack traceback:
stdin:1: in main chunk
[C]: ?
[C]: ?
> file.writeline([[print("Test")]])
Lua error: stdin:1: attempt to call field 'writeline' (a nil value)
stack traceback:
stdin:1: in main chunk
[C]: ?
[C]: ?
> file.writeline([[]])
Lua error: stdin:1: attempt to call field 'writeline' (a nil value)
stack traceback:
stdin:1: in main chunk
[C]: ?
[C]: ?
> file.close()
Lua error: stdin:1: attempt to call field 'close' (a nil value)
stack traceback:
stdin:1: in main chunk
[C]: ?
[C]: ?
> node.compile("unnamed1.lua")
Lua error: stdin:1: cannot open unnamed1.lua: No such file or directory
stack traceback:
[C]: in function 'compile'
stdin:1: in main chunk
[C]: ?
[C]: ?
Apparently, ESP8266 nodemcu implements file.open() where ESP32 nodemcu doesn't (ESP32 seems to implement the Lua io lib instead).
Am I having a build issue? I don't think so as https://nodemcu.readthedocs.io/en/dev-esp32/modules/file/ doesn't list file.open()
Is there an issue with the upload tools failing to detect my ESP32? Upon reset, my firmware reports as: ''' NodeMCU ESP32 build unspecified powered by Lua 5.1.4 [5.1-doublefp] on IDF v4.4.3 '''
Any help is appreciated.
Try
iolib instead.