Microptyhon on the ESP32: file management
What does no change, however, is that MicroPython still can have access to the local file system. Just try:
import os
os.listdir()
So, one way of dealing with this limitation is to use a tool that can offer us access to the local filesystem on the target MicroPython board (ours based on the ESP32 now). And it does this by using the raw-REPL over the serial connection and and some code on the PC side called rshell. This way you can list, copy, delete and create or destroy folders and files on the MicroPython board local-filesystem, all through the serial terminal. Definitely, a useful tool that was not needed when you already could see the MicroPython board local-storage as a mass storage device (as it happened with BlackPill).
Please note rshell is just a command-line tool and you need to provide an external editor if you want to edit the content of any file. If you don't, then you can do file management and/or start a REPL session.
But given the ESP32 has wifi connectivity, a question may arise "Is it possible to do that wirelessly?". And the answer is yes. You can do that same work wirelessly using your browser. But some preparation is needed:
- On the one hand, you need the ESP32 to connect to your local network on boot (if you have any, or to create its own network and allow you to connect to it if you do not have one wifi network).
- On the other hand, some server code needs to run on the ESP32 side so your browser can interact with it to provide you file-editing and access to the local-filesystem of the board.
Use a HTTP connection, eg. http://micropython.org/webrepl/.
Alternatively, download the files from GitHub and run them locally.
Comments