dhylands / rshell

Remote Shell for MicroPython
MIT License
944 stars 133 forks source link

rshell doesn't copy a file from WINDOWS host to ESP32 device #162

Open IhorNehrutsa opened 3 years ago

IhorNehrutsa commented 3 years ago

Host is:

Microsoft Windows 7 [Version 6.1.7601]

The destination device is:

MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32

rshell command-line arguments are:

rshell.py --port COM7 cp version.py /flash

Output is:

Using buffer-size of 32
Connecting to COM7 (buffer-size 32)...
Trying to connect to REPL  connected
Retrieving sysname ... esp32
Testing if ubinascii.unhexlify exists ... Y
Retrieving root directories ... /WiFi.py/ /amicropyserver.py/ /heartbeat.py/
Setting time ... Jun 15, 2021 21:59:48
Evaluating board_name ... pyboard
Retrieving time epoch ... Jan 01, 2000
Copying 'D:\microPython\rshell\rshell/version.py' to '/flash' ...

But the file is not copied. The issue is that Windows os.sep is '\', the device file separator is '/' but rshell always uses '/' when processing files.

davehylands commented 3 years ago

Windows actually accepts / as a directory separator internally. So I think the issue is that rshell isn't converting the \ to / when its contained in the filename. Unfortunately, I've packed away all of micropython stuff since I'm moving in a few weeks.