Open juju2143 opened 2 years ago
but of course we'll need some additional code to detect whether file or io is to be used so it works as usual on an ESP8266.
I have added --io-module
flag in cli to allow to choose whether io
or file
module is to be used.
The branch dev-esp32
The following pull requests also have been applied:
fix: upgrade prompt dep to fix non-existent property warning
Checklist
Can you establish a serial connection WITHOUT Nodemcu-Tool - e.g. with a serial terminal like Putty ?
yes
Does the
nodemcu-tool fsinfo
command work ?yes
Environment
Arch Linux
ESP-WROOM-32
3.2.1
16.11.1
latest dev-esp32-idf4 with Lua 5.3
Issue Description
Expected Behavior
You can upload files
Current Behavior
You can't upload files
Steps to Reproduce
nodemcu-tool upload something.lua
Detailed Description
The above command works, yet the file does not show up in the filesystem. This is because NodeMCU in the latest dev-esp32 branches moved file IO from the
file
module to the standard Luaio
. The commands fails silently as if it worked, even thoughfile.open
is unavailable and returnsnil
.Possible Solution
I have modified lib/lua/esp8266-commands.js to use
io
instead offile
and so far it works very well, but of course we'll need some additional code to detect whetherfile
orio
is to be used so it works as usual on an ESP8266.This took a while to figure out from the documentation even though the ESP32 is very unsupported, has preliminary support, the maintainers of this repo might not have an ESP32 to test on, and a casual user might think their ESP32 is broken, it's not, here's the solution :)