Mount NodeMCU with Micropython filesystem?

690 views Asked by At

I've recently bought a NodeMCU board and flashed Micropython in it.
I've read about the boot.py and main.py scripts, but I can't understand how to access them.
I have succesfully connected to the Python REPL with the screen command and everything works fine.
Is there a way to mount it as an external drive on Mac OS X? Because I haven't found a way till now.

Thanks in advance!

3

There are 3 answers

4
Fruch On

you can enable the webrepl and upload via that

I've found this one package very helpful to upload vi the serial.

pip install mpfshell

python -m mp.mpfshell
> open COM3 
> put main.py

micropython is cool...

0
Zoltan On

The mpy-utils software package contains a tool called mpy-fuse that allows you to mount a MicroPython device from Linux or MacOS using FUSE. I found this tool through this video that describes how to set it up and shows how it looks like in action.

0
pixelstuermer On

Due to some questions I had about the NodeMcu and running Python on it, I just set up a pretty end-to-end documentation python2nodemcu on GitHub.

Viewing, downloading, uploading or listing files of the MicroPython filesystem has its own section there.

It utilizes Ampy, a Python library to connect to the MicroPython-based board via its serial connection. For listing all files for example, simply run python3 ampy/cli.py --port /dev/tty.{device-file} --baud 115200 ls.