Skip to content

Uploading cfg.json & presets.json via pio's Upload Filesystem Image does not work #5839

Closed as not planned

Description

@UsableLoki8221

What happened?

Previously I would flash the filesystem with premade config and presets file in wled00/data in 16.0.0 and this would work well. Now I noticed it has not been working on the most recent nightly source.

To Reproduce Bug

Backup cfg/presets to wled00/data/ and upload via run --target uploadfs --environment esp32c3dev and notice no settings are applied on startup

Expected Behavior

cfg and presets should be applied

Install Method

Self-Compiled

What version of WLED?

Installed version: WLED 17.0.0-devV5 (2607201) "ESP32-C3-QIO"

Which microcontroller/board are you seeing the problem on?

ESP32-C3

Relevant log/trace output

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. softhack007 commented on Sep 7, 2026

    @softhack007
    Member

    Previously I would flash the filesystem with premade config and presets file in wled00/data in 16.0.0 and this would work well. Now I noticed it has not been working on the most recent nightly source.

    @UsableLoki8221 uploading "data" is not supported any more since a long time - at least since WLED 0.13.x. WLED generates compressed HTML source files from the content of "data". This folder is not intended for supplying a user-defined cfg.json or presets.json.

    Edit: pio run --target uploadfs is not supported either, because it will most likely generate a SPIFFS filesystem, instead of LittleFS. This explains your observations with WLED 17.0.0-devV5 - the SPIFFS driver was removed in the new framework we use in 17.0.0.

  2. changed the title [-]Uploading cfg.json & presets.json via pio's Upload Filesystem Image does not work anymore.[/-] [+]Uploading cfg.json & presets.json via pio's Upload Filesystem Image does not work[/+] on Sep 7, 2026
  3. UsableLoki8221 commented on Sep 7, 2026

    @UsableLoki8221
    Author

    Weird, I was definitely pulling it off in 16.0.0 adequately:

    Executing task: C:\Users\Vero\.platformio\penv\Scripts\platformio.exe run --target uploadfs --environment esp32c3dev_qio 
    
    Processing esp32c3dev_qio (platform: https://github.com/tasmota/platform-espressif32/releases/download/2024.06.00/platform-espressif32.zip; framework: arduino; board: esp32-c3-devkitm-1)
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
    *** use existing my_config.h ***
    Installing node packages
    npm ci
    
    added 66 packages, and audited 67 packages in 1s
    
    14 packages are looking for funding
      run `npm fund` for details
    
    2 high severity vulnerabilities
    
    To address all issues, run:
      npm audit fix
    
    Run `npm audit` for details.
    npm run build
    
    > wled@16.0.0-alpha build
    > node tools/cdata.js
    
    
              ##  ##      ##        ######    ######
            ##      ##    ##      ##        ##  ##  ##
            ##  ##  ##  ##        ######        ##  ##
            ##  ##  ##  ##        ##            ##  ##
              ##  ##      ######    ######    ######
                     build script for web UI
    
    Web UI is already built
    CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-c3-devkitm-1.html
    PLATFORM: Espressif 32 (2024.6.0) > Espressif ESP32-C3-DevKitM-1
    HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
    DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
    PACKAGES: 
     - framework-arduinoespressif32 @ 2.0.18+sha.8ba0dc0 
     - tool-esptoolpy @ 4.7.4 
     - tool-mkfatfs @ 2.0.1 
     - tool-mklittlefs @ 3.2.0 
     - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
    LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ strict
    Found 38 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- AsyncTCP @ 3.4.7
    |-- AnimatedGIF @ 1.4.7
    |-- GifDecoder @ 1.1.0+sha.bc3af18
    |-- esp_dmx @ 3.1.1+sha.47db25d8
    |-- FastLED @ 3.6.0
    |-- IRremoteESP8266 @ 2.8.2
    |-- NeoPixelBus @ 2.8.4+sha.a0919d1
    |-- ESPAsyncWebServerWLED @ 2.4.2+sha.39b830c
    |-- AsyncMqttClient @ 0.9.0
    |-- QuickEspNow @ 0.8.1+sha.193e991
    |-- ESPmDNS @ 2.0.0
    |-- Wire @ 2.0.0
    |-- Update @ 2.0.0
    |-- ArduinoOTA @ 2.0.0
    |-- DNSServer @ 2.0.0
    |-- Ethernet @ 2.0.0
    |-- LittleFS @ 2.0.0
    |-- SPI @ 2.0.0
    |-- WiFi @ 2.0.0
    |-- NeoESP32RmtHI
    |-- ESP32 Async UDP @ 2.0.0
    |-- WebServer @ 2.0.0
    Building in release mode
    Building FS image from 'wled00\data' directory to .pio\build\esp32c3dev_qio\littlefs.bin
    /404.htm
    /cfg.json
    /common.js
    /cpal/cpal.htm
    /dmxmap.htm
    /edit.htm
    /favicon.ico
    /icons-ui/demo-files/demo.css
    /icons-ui/demo-files/demo.js
    /icons-ui/demo.html
    /icons-ui/fonts/wled122.woff
    /icons-ui/fonts/wled122.woff2
    /icons-ui/Read Me.txt
    /icons-ui/selection.json
    /icons-ui/style.css
    /index.css
    /index.htm
    /index.js
    /iro.js
    /liveview.htm
    /liveviewws2D.htm
    /msg.htm
    /pixart/boxdraw.js
    /pixart/favicon-16x16.png
    /pixart/favicon-32x32.png
    /pixart/favicon.ico
    /pixart/getPixelValues.js
    /pixart/pixart.css
    /pixart/pixart.htm
    /pixart/pixart.js
    /pixart/site.webmanifest
    /pixart/statics.js
    /pixelforge/omggif.js
    /pixelforge/pixelforge.htm
    /presets.json
    /pxmagic/pxmagic.htm
    /rangetouch.js
    /settings.htm
    /settings_2D.htm
    /settings_dmx.htm
    /settings_leds.htm
    /settings_pin.htm
    /settings_pininfo.htm
    /settings_sec.htm
    /settings_sync.htm
    /settings_time.htm
    /settings_ui.htm
    /settings_um.htm
    /settings_wifi.htm
    /style.css
    /update.htm
    /usermod.htm
    /welcome.htm
    Looking for upload port...
    Auto-detected: COM15
    Uploading .pio\build\esp32c3dev_qio\littlefs.bin
    esptool.py v4.7.4
    Serial port COM15
    Connecting...
    Chip is ESP32-C3 (QFN32) (revision v0.4)
    Features: WiFi, BLE, Embedded Flash 4MB (XMC)
    Crystal is 40MHz
    MAC: f8:5b:1b:22:ab:44
    Uploading stub...
    Running stub...
    Stub running...
    Changing baud rate to 460800
    Changed.
    Configuring flash size...
    Auto-detected Flash size: 4MB
    Flash will be erased from 0x00310000 to 0x003fffff...
    Compressed 983040 bytes to 199317...
    Writing at 0x00310000... (7 %)
    Writing at 0x003224e0... (15 %)
    Writing at 0x00332fe6... (23 %)
    Writing at 0x00344eda... (30 %)
    Writing at 0x00353913... (38 %)
    Writing at 0x00365130... (46 %)
    Writing at 0x0039e872... (53 %)
    Writing at 0x003b7325... (61 %)
    Writing at 0x003c41b6... (69 %)
    Writing at 0x003d3027... (76 %)
    Writing at 0x003e07a0... (84 %)
    Writing at 0x003eccda... (92 %)
    Writing at 0x003fc7ae... (100 %)
    Wrote 983040 bytes (199317 compressed) at 0x00310000 in 3.3 seconds (effective 2399.2 kbit/s)...
    Hash of data verified.
    
    Leaving...
    Hard resetting via RTS pin...
    ======================================================================================== [SUCCESS]`

    However, in the newest version I just noticed that flashing the filesystem isn't running the "Building FS image from 'wled00\data' directory to .pio\build\esp32c3dev_qio\littlefs.bin" message:

    executing task: C:\Users\Vero\.platformio\penv\Scripts\platformio.exe run --target uploadfs --environment esp32c3dev_qio 
    
    Processing esp32c3dev_qio (board: esp32-c3-devkitm-1; platform: https://github.com/tasmota/platform-espressif32/releases/download/2026.05.50/platform-espressif32.zip; framework: arduino)
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
    *** use existing my_config.h ***
    Installing node packages
    npm ci
    
    added 66 packages, and audited 67 packages in 974ms
    
    14 packages are looking for funding
      run `npm fund` for details
    
    found 0 vulnerabilities
    npm run build
    
    > wled@17.0.0-devV5 build
    > node tools/cdata.js
    
    
              ##  ##      ##        ######    ######
            ##      ##    ##      ##        ##  ##  ##
            ##  ##  ##  ##        ######        ##  ##
            ##  ##  ##  ##        ##            ##  ##
              ##  ##      ######    ######    ######
                     build script for web UI
    
    Web UI is already built
    CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-c3-devkitm-1.html
    PLATFORM: Espressif 32 (2026.5.50) > Espressif ESP32-C3-DevKitM-1
    HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
    DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, esp-prog-2, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
    PACKAGES: 
     - contrib-piohome @ 3.4.4 
     - framework-arduinoespressif32 @ 3.3.8+sha.f2a3fa2b 
     - tool-esp-rom-elfs @ 2024.10.11 
     - tool-esptoolpy @ 5.2.0 
     - tool-riscv32-esp-elf-gdb @ 16.3.0+20250913 
     - toolchain-riscv32-esp @ 15.2.0+20251204
    LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ off, Compatibility ~ strict
    Found 43 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- AsyncTCP @ 3.4.10
    |-- AnimatedGIF @ 1.4.7
    |-- GifDecoder @ 1.1.0+sha.bc3af18
    |-- esp_dmx @ 4.1.0+sha.ed12a29
    |-- IRremoteESP8266 @ 2.9.0
    |-- ESPAsyncWebServerWLED @ 2.4.2+sha.ac44e32
    |-- AsyncMqttClient @ 0.9.0
    |-- NeoPixelBus @ 2.9.0+sha.76afe83
    |-- audioreactive
    |-- auto_save
    Building in release mode
    Building FS image from 'wled00\data' directory to .pio\build\esp32c3dev_qio\littlefs.bin
    Looking for upload port...
    Auto-detected: COM15
    Uploading .pio\build\esp32c3dev_qio\littlefs.bin
    esptool v5.2.0
    Serial port COM15:
    Connecting...
    Connected to ESP32-C3 on COM15:
    Chip type:          ESP32-C3 (QFN32) (revision v0.4)
    Features:           Wi-Fi, BT 5 (LE), Single Core, 160MHz, Embedded Flash 4MB (XMC)
    Crystal frequency:  40MHz
    USB mode:           USB-Serial/JTAG
    MAC:                f8:5b:1b:22:ab:44
    
    Uploading stub flasher...
    Running stub flasher...
    Stub flasher running.
    Changing baud rate to 460800...
    Changed.
    
    Configuring flash size...
    Auto-detected flash size: 4MB
    Flash will be erased from 0x00310000 to 0x003fffff...
    Compressed 983040 bytes to 220316...
    
    Writing at 0x00310000 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0.0% 0/220316 bytes... 
    
    Writing at 0x00321f17 [██░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   7.4% 16384/220316 bytes... 
    
    Writing at 0x00345225 [████░░░░░░░░░░░░░░░░░░░░░░░░░░]  14.9% 32768/220316 bytes... 
    
    Writing at 0x00352ffb [██████░░░░░░░░░░░░░░░░░░░░░░░░]  22.3% 49152/220316 bytes... 
    
    Writing at 0x00360112 [████████░░░░░░░░░░░░░░░░░░░░░░]  29.7% 65536/220316 bytes... 
    
    Writing at 0x0036e03c [███████████░░░░░░░░░░░░░░░░░░░]  37.2% 81920/220316 bytes... 
    
    Writing at 0x00384025 [█████████████░░░░░░░░░░░░░░░░░]  44.6% 98304/220316 bytes... 
    
    Writing at 0x00394638 [███████████████░░░░░░░░░░░░░░░]  52.1% 114688/220316 bytes... 
    
    Writing at 0x003a6877 [█████████████████░░░░░░░░░░░░░]  59.5% 131072/220316 bytes... 
    
    Writing at 0x003b65d9 [████████████████████░░░░░░░░░░]  66.9% 147456/220316 bytes... 
    
    Writing at 0x003cc7ec [██████████████████████░░░░░░░░]  74.4% 163840/220316 bytes... 
    
    Writing at 0x003dd1dd [████████████████████████░░░░░░]  81.8% 180224/220316 bytes... 
    
    Writing at 0x003ebda6 [██████████████████████████░░░░]  89.2% 196608/220316 bytes... 
    
    Writing at 0x003fa936 [█████████████████████████████░]  96.7% 212992/220316 bytes... 
    
    Writing at 0x00400000 [██████████████████████████████] 100.0% 220316/220316 bytes... 
    Wrote 983040 bytes (220316 compressed) at 0x00310000 in 3.3 seconds (2385.7 kbit/s).
    Verifying written data...
    Hash of data verified.
    
    Hard resetting via RTS pin...
    ======================================================================================== [SUCCESS]
  4. softhack007 commented on Sep 7, 2026

    @softhack007
    Member

    As I explained - pio filesystem upload is not supported for WLED, even if the feature exists in PlatformIO. Its a "may or may not work" thing.

    Edit: Building FS image from 'wled00\data' directory to .pio\build\esp32c3dev_qio\littlefs.bin ... Wrote 983040 bytes
    means that you override the compressed web UI files with a bloated collection of uncompressed files. This can be useful for WebUI debugging, but its definitely not meant for "production".

  5. UsableLoki8221 commented on Sep 7, 2026

    @UsableLoki8221
    Author

    So I flashed WLED 17.0.0-devV5 (2607201) and then used my previous 16.0.0 environment where I copied the contents of wled00/data from 17 into and ran the filesystem and it worked. So I think that something's gotten messed up in the newer environment where pio's filesystem command doesn't catch any files after Building FS image from 'wled00\data' directory to .pio\build\esp32c3dev_qio\littlefs.bin

  6. softhack007 commented on Sep 7, 2026

    @softhack007
    Member

    @UsableLoki8221 again - you're doing something which is not officially supported, and actually its very much discouraged to create and upload a huge filesystem in the way you explain. I see no need to "fix it", because we never said it would work. Period.

  7. UsableLoki8221 commented on Sep 7, 2026

    @UsableLoki8221
    Author

    @softhack007 How is uploading the filesystem not supported? Its just platformio core functionality that's someone previously configured to upload whatever is in wled00/data from the environment.

    Regardless of your impatience I am genuinely trying to point out the discrepancy and be helpful- I figured out why the filesystem uploader stopped working in the latest environment compared to the previous:
    previously littleFS (<17.0) used "mklittlefs" -c wled00\data -s 983040 -p 256 -b 4096 .pio\build\esp32c3dev_qio\littlefs.bin. to build the fs binary.

    The new littleFS (17.0) uses build_fs_router([".pio\build\esp32c3dev_qio\littlefs.bin"], ["wled00\data"]) which fails to actually make a binary from files in that location.

    I already wrote myself a script that uses the previous filesystem binary tool so I'm happy- if what I found is helpful then make of that what you will. Period.

  8. softhack007 commented on Sep 7, 2026

    @softhack007
    Member

    @softhack007 How is uploading the filesystem not supported? Its just platformio core functionality

    @UsableLoki8221 sorry if I appear impatient. What your proposing is actually a dangerous hack, and I'm obviously struggling to make myself clear on the "why".

    • a normal WLED build - without FS creation - stores all *htm, *.js, *.css files from wled00/data inside the firmware; files are compressed and inlined into header files. The web server reads these directly from the firmware (read-only), instead of accessing the filesystem.

    • "uploading the filesystem" creates a huge copy of the same data - in your case, it seems to be ~980Kb, so uploading to a 4MB board may fail due to image size. You might very soon face "out of file space" problems when saving new presets.

    • the huge copy overwrites everything that is stored inside the firmware. OTA updates may leave you with a broken UI, because firmware and WebUI do not fit together any more

    • uncompressed files on the filesystem cause userinterface slowdown

    • overwiting the build-in userinterface by littleFS files can lead to LEDs flickering during file reading, particularly bad on -C3.

    All this lead to a design decision (around the time of WLED 0.13.0) of not using filesystem upload (from wled00/data) in WLED. Even when platformIO allows it, WLED builds would become unreliable, 4MB boards will have problems, and OTA updates can lead to a corrupted user interface. Hence the development team consideres it "not supported".

    I hope you understood me better now.

  9. UsableLoki8221 commented on Sep 7, 2026

    @UsableLoki8221
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions