← index #17222Issue #7776
Related · high · value 0.127
QUERY · ISSUE

esp32s3 builtin serial prompt: mpremote connects but cp/ls not working

openby emardopened 2025-04-30updated 2025-09-05
enhancementtools

Description

I have got micropython prompt from this simple code.
"mpremote" connects and prompt works.
but mpremote cp or ls doesn't work, it would
be great if it works so full file management can be done.

I tried to run this from main.py and works as prompt
but file management results in some error...

import os
import machine
import sys
sys.path.extend(['/lib'])

# string indices in the default descriptor
i_str_manuf = 0x01
i_str_product = 0x02
i_str_serial = 0x03

# module ID (will be read from DIP switches)
module_id = 0x11

# make strings
str_module_id = f'{module_id:02x}'
str_unique_id = f'{int.from_bytes(machine.unique_id()):x}'
str_serial = f'{str_unique_id}_{str_module_id}'
str_product = f'proto_meter_{module_id:02x}'
str_manuf = 'TheStumbler'

mystrings = {}
mystrings[0] = None # need this for language
mystrings[i_str_manuf] = str_manuf
mystrings[i_str_product] = str_product
mystrings[i_str_serial] = str_serial

#for s in mystrings.items(): print(s)

usbdev = machine.USBDevice()
desc_dev = usbdev.BUILTIN_DEFAULT.desc_dev
desc_cfg = usbdev.BUILTIN_DEFAULT.desc_cfg
usbdev.active(False)
usbdev.builtin_driver = usbdev.BUILTIN_DEFAULT
usbdev.config( 
    desc_dev, desc_cfg, \
    desc_strs=mystrings \
)
usbdev.active(True)

Code Size

No response

Implementation

I hope the MicroPython maintainers or community will implement this feature

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

Error when copying file to ESP32 with mpremote

closedby Friday8229opened 2021-09-12updated 2021-09-19
port-esp32

The board is running micropython env. I want to upload a CSV file but there's an error. Also I can't upload any .py file.

friday@friday-VirtualBox:~/esp-idf/micropython/ports/esp32$ mpremote cp test.py :
cp test.py :test.py
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV

when using pyboard.py :

friday@friday-VirtualBox:~/esp-idf/micropython/ports/esp32$ ./pyboard.py --device /dev/ttyUSB0 -f cp A00068.csv :A00068.csv
cp A00068.csv :A00068.csv
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV

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