maxgerhardt / pio-esp32-esp8266-filesystem-downloader

Script for expanding PlatformIO's ability to download LittleFS and SPIFFS filesystems from ESP32 and ESP8266 chips and their contents
29 stars 9 forks source link

Unpacking LittleFS fails (argument missing) #9

Open Henning-Lenz opened 7 months ago

Henning-Lenz commented 7 months ago

First I'd like to thank for this script, it should be included as standard action in PlatformIO.

I just started using little FS and because uploading is one thing, also (temperature logger) files should be downloaded. Everything seems to work fine till the final unpack step which somehow errors out as following:

Executing extraction command: ['/home/user/.platformio/packages/tool-mklittlefs/mklittlefs', '-b', '8192', '-p', '256', '--unpack', 'unpacked_fs', '/home/user/GIT/Temperature_measurement/.pio/build/nodemcuv2/downloaded_fs_0x300000_0xfa000.bin']
PARSE ERROR:  
             Required arguments missing: list, unpack, create, image_file

Brief USAGE: 
   /home/user/.platformio/packages/tool-mklittlefs/mklittlefs  {-c
                                        <pack_dir>|-u <dest_dir>|-l} [-d
                                        <0-5>] [-a] [-b <number>] [-p
Unpacked filesystem.
                                        <number>] [-s <number>] [--]
                                        [--version] [-h] <image_file>
Extracted 0 file(s) from filesystem.

For complete USAGE and HELP type: 
   /home/user/.platformio/packages/tool-mklittlefs/mklittlefs --help

After trying to run the command directly from bash (works) and from Python (did not work instantly), I found out that changing shell=False here makes the script fully working. This line was recently changed with 1b44b66, before it was (defaulting to) False from the very beginning. As the real problem seems to be that the command parts are not joined also " ".join(cmd) with shell=True does the job, but in my case it does not make sense to go for that.

Environment is Chromium 1.83.0.23277-r1 and PlatformIO 3.3.1 running under Linux with Python 3.11.5

maxgerhardt commented 7 months ago

Thanks for the report, I'll double check the commands. It also probably has something to do with the version of mklittlefs, with there being some possible differences in the arguments they accept.