Can't modify content in /flash directory via mpfshell on LoBo port.

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
water
Posts: 75
Joined: Sun Sep 24, 2017 9:16 am

Can't modify content in /flash directory via mpfshell on LoBo port.

Post by water » Wed Feb 14, 2018 8:58 pm

I success connected ESP-WROOM-32 via mpfshell, Micropython is "ESP32_LoBo_v3.1.18 - 2017-02-07" prebuilt firmware,
and success list ESP-32 file via "ls" command.

In /flash directory, I try to use "put xxx.xxx" to upload local machine file to ESP-32, but appear "Failed to create file: xxx.xxx", and use "get boot.py" to download boot.py to local machine from ESP-32, appear "Failed to read file: boot.py".

In /flash directory, use "md test" to create "test" directory and change to /flash/test directory, these operation ("put" and "get" file) above are success.
And other way, in Micropython shell, use this method like below is also success:

>>> f = open('/flash/boot.py')
>>> f.read()

This prebuilt firmware used SPIFFS with internal filesystem, is it mpfshell must required FAT filesystem? or /flash directory has some access permissions ?

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: Can't modify content in /flash directory via mpfshell on LoBo port.

Post by loboris » Wed Feb 14, 2018 11:44 pm

I've tried with the same prebuilt firmware and it works fine.

Code: Select all

boris@UbuntuMate:~$ mpfshell

** Micropython File Shell v0.8.1, sw@kaltpost.de ** 
-- Running on Python 2.7 using PySerial 3.4 --

mpfs [/]> open ttyUSB0
Connected to esp32
mpfs [ /flash]> ls

Remote files in '/flash':

 <dir> ..
       boot.py

mpfs [ /flash]> ls

Remote files in '/flash':

 <dir> ..
       boot.py

mpfs [ /flash]> get boot.py
mpfs [ /flash]> put boot.py boot_copy.py
mpfs [ /flash]> ls

Remote files in '/flash':

 <dir> ..
       boot.py
       boot_copy.py

mpfs [ /flash]> md test
mpfs [ /flash]> ls

Remote files in '/flash':

 <dir> ..
 <dir> test
       boot.py
       boot_copy.py

mpfs [ /flash]> cd test
mpfs [ /flash/test]> ls

Remote files in '/flash/test':

 <dir> ..

mpfs [ /flash/test]> put boot.py
mpfs [ /flash/test]> ls

Remote files in '/flash/test':

 <dir> ..
       boot.py

mpfs [ /flash/test]> repl
>
*** Exit REPL with Ctrl+] ***

MicroPython ESP32_LoBo_v3.1.18 - 2017-02-07 on ESP32 board with ESP32
Type "help()" for more information.
>>> 
mpfs [ /flash/test]> 

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: Can't modify content in /flash directory via mpfshell on LoBo port.

Post by mattyt » Fri Oct 19, 2018 1:19 am

Hi folks,

I've run into the same issue but it seems a problem only on Windows.

I'm using ESP32_LoBo_v3.2.24 - 2018-09-06 on an M5Stack Core (no PSRAM) with mpfshell 0.8.1. Using mpfshell to connect to this from a Linux host (Ubuntu 16.04) works fine; files can be transferred. Using the same version of mpfshell on Windows prevents files from being transferred in either direction:

Code: Select all

$ python -m mp.mpfshell

** Micropython File Shell v0.8.1, sw@kaltpost.de **
-- Running on Python 3.6 using PySerial 3.4 --
mpfs [/]> open COM6
Connected to esp32_LoBo
mpfs [/flash_]> ls

Remote files in '/flash':

 <dir> ..
       boot.py

mpfs [/flash_]> lls

Local files:

       test.py

mpfs [/flash_]> put test.py

Failed to create file: test.py

mpfs [/flash_]> get boot.py

Failed to read file: boot.py
I've used Dave Hyland's rshell and, after working around an issue running rshell on Windows, it connects and transfers files fine.

I would be inclined to say this is an mpfshell issue however there appears to be no problems with mainline MicroPython on Windows:

Code: Select all

$ python -m mp.mpfshell                            
                                                   
** Micropython File Shell v0.8.1, sw@kaltpost.de **
-- Running on Python 3.6 using PySerial 3.4 --     
                                                   
mpfs [/]> open COM9                                
Connected to esp32                                 
mpfs [/]> get boot.py                              
mpfs [/]> lls                                      
                                                   
Local files:                                       
                                                   
       boot.py
In any case, we can use rshell as a work-around for now but it does seem that the Lobo fork is doing something different to mainline MicroPython and perhaps this is causing issues with mpfshell?

Boris, should I raise this as an issue on your issue tracker? Could it be a problem on the Lobo fork?

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: Can't modify content in /flash directory via mpfshell on LoBo port.

Post by OutoftheBOTS_ » Fri Oct 19, 2018 4:30 am

Yes as a windows user I also have problem with windows security blocking

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: Can't modify content in /flash directory via mpfshell on LoBo port.

Post by mattyt » Fri Oct 19, 2018 4:34 am

OutoftheBOTS_ wrote:
Fri Oct 19, 2018 4:30 am
Yes as a windows user I also have problem with windows security blocking
I don't think this particular issue is due to security blocking - for two reasons. 1) I tried running the console as Administrator and 2) mainline MicroPython works fine.

Informatic0re
Posts: 1
Joined: Fri Oct 22, 2021 2:55 pm

Re: Can't modify content in /flash directory via mpfshell on LoBo port.

Post by Informatic0re » Fri Oct 22, 2021 3:00 pm

I am having the exact same issue on Windows but with an nRF52 and Micropython.
Somehow the initial upload if the file does not yet exist works but not if I try to upload it again. If I remove the file using mpfshell and try to upload again, I receive the error message "Failed to create file:" but it got uploaded.

Because I am using a script to upload multiple files and also create folders I added a command delete all files first and then upload them which seems to work, I do not receive the error anymore.

Post Reply