← index #9204PR #8231
Off-topic · high · value 0.697
QUERY · ISSUE

tools/mpremote Copy folder content creates folder on board

openby lhoff94opened 2022-09-03updated 2025-09-05
bugdocstools

Hi,

i noticed a behaviour with mpremote that doesn't seem right. I try to copy the content of a complete folder to the board. But instead of putting the folder content in the root of the device it creates a folder on the device and copies everything there.

Example:

Assume if have to following folder setup:

~/test$ tree mpy-project/
mpy-project/
├── boot.py
├── lib
│   └── urequests.py
└── main.py

I want to put the content of mpy-project on my empty board.
My first attempt was using this command:
mpremote connect /dev/ttyUSB1 cp -r mpy-project/* :
It transferred all files to the board but it was all in a folder called "mpy-project". It looked like that:

~/test$ mpytool -vp /dev/ttyUSB0 tree
./
└─ mpy-project/
├─ lib/
│  └─ urequests.py
├─ boot.py
└─ main.py

That seems counterintuitive for me since the *should be expanded and then the files should be copied.
There is also no use case where that behavior would make sense. If I wanted the complete folder copied I would leave /*out.

Or do i miss something?

Information about the version of MicroPython you're running

  • Micropython 1.19.1
  • mpremote 0.3.0
  • ESP32
CANDIDATE · PULL REQUEST

tools/mpremote: Add manifest function.

openby andrewleechopened 2022-01-31updated 2026-03-24
tools

Add manifest command to mpremote which will compile a manifest.py from the specified folder, eg:

      $ MPY_DIR=../../micropython 
      $ PORT_DIR=../../micropython/ports/esp32
      $ mpremote manifest .

This will assemble / mpy-cross everything specified in the manifest.py into the folder _manifest.
If the current folder is also mounted, this folder will automatically be added to the path, eg:

      $ mpremote manifest . mount .

Alternatively, the built folder can by copied / synched to the device, in which case
the copied folder will be added to the path:

      $ mpremote manifest -s . 

A soft-reset will re-process the manifest file to include any local updates allowing fast development of local files in a larger project without needing to copy / import-over-mount all files every reset.

Ideally, if the mpy_cross python package is installed from pypi, the local MPY_DIR=../../micropython variables will not need to be specified (unless your local manifest uses them directly`

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied