esphome / esp-web-tools

Open source tools to allow working with ESP devices in the browser
https://esphome.github.io/esp-web-tools/
Apache License 2.0
391 stars 111 forks source link

Esp-WEB-Tools and SPIFFS #445

Open herve-tourrel opened 7 months ago

herve-tourrel commented 7 months ago

Good morning, I cannot flash a spiffs file containing a website with ESP-Web-Tools. The firmware part flashes correctly but not the SPIFFS file. I have to use the Arduino IDE or VSCode and PlateformIO. Here is my manifest:

{
  "name": "ESPHome",
  "builds": [
    {
      "chipFamily": "ESP32",
      "improv": false,
      "parts": [
        { "path": "bootloader.bin", "offset": 4096 },
        { "path": "partitions.bin", "offset": 32768 },
        { "path": "boot_app0.bin", "offset": 57344 },
        { "path": "firmware.bin", "offset": 65536 },
    { "path": "spiffs.bin", "offset": 2686976}
      ]
    },
    {
      "chipFamily": "ESP8266",
      "parts": [
        { "path": "esp8266.bin", "offset": 0 }
      ]
    }
  ]
}

and here is what the Arduino IDE does:

For the spiffs part : 

Serial port COM17
Connecting.....
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: b4:8a:0a:63:70:38
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 16MB
Flash will be erased from 0x00290000 to 0x003effff...
Compressed 1441792 bytes to 7020...
Writing at 0x00290000... (100 %)
Wrote 1441792 bytes (7020 compressed) at 0x00290000 in 8.2 seconds (effective 1414.2 kbit/s)...
Hash of data verified.
Jason2866 commented 7 months ago

A better approach is to flash a combined image. Just one file. Use esptool merge to combine the needed images.

herve-tourrel commented 6 months ago

Thanks for the answer, I will try to make a single file with esptool.

rainerfritz commented 6 months ago

Does your partition table also have the spiffs partition defined, corresponding to the offset?

herve-tourrel commented 6 months ago

Yes, but my problem is solved with Jason2866's method and the use of flash_download_tool_3.9.5 which allows you to create a combined image graphically.

gism commented 6 months ago

I had the same issue with latest version (9.4.3) Also, I've seen that this version overwrites SPIFFS even if bin and addresses are smaller and don't reach SPIFFS addresses. For my application I want to flash application and keep SPIFFS with no update. Now i'm using version 3.4.2. I can write SPIFFS and application with different buttons. thanks

AllanOricil commented 5 days ago

@gism can you show me how you did it? I have a site which I want to upload to my esp32 from my website. I'm using platform.io to build the firmware.

herve-tourrel commented 5 days ago

J'ai vu le message et je répondrai dans un ou deux jours.

Le dim. 30 juin 2024, 15:13, Allan Oricil @.***> a écrit :

@gism https://github.com/gism can you show me how you did it? I have a site which I want to upload to my esp32 from my website. I'm using platform.io to build the firmware.

— Reply to this email directly, view it on GitHub https://github.com/esphome/esp-web-tools/issues/445#issuecomment-2198559362, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCLDP24M4Q6O5HE4DAL733LZJ776BAVCNFSM6AAAAABKEDHABOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGU2TSMZWGI . You are receiving this because you authored the thread.Message ID: @.***>

AllanOricil commented 3 days ago

I was able to do it. If anyone is interested, here is how you can do it

https://github.com/allanoricil/esp32-mfa-authenticator

Open scripts/build.sh