Skip to content

HTTPUpdateServer does not update SPIFFS or LittleFS #6482

Closed
@mrWheel

Description

@mrWheel

Board

ESP32 Wrover Module

Device Description

Nothing, just the bare board

Hardware Configuration

Nothing

Version

v2.0.2

IDE Name

Arduino IDE

Operating System

macOS 12.2.1

Flash frequency

80MHz and 40MHz

PSRAM enabled

no

Upload speed

921600 and 230400

Description

Created both SPIFFS and LittleFS bin files.

Tried to upload using the WebUpdater example sketch

Got these error's while trying to upload LittleFS.bin:
Monitor:

Update: WebUpdater.littlefs.bin
Bad Size Given
.Bad Size Given

Browser:

Update error: Bad Size Given

Same errors while trying to upload SPIFFS.bin

Sketch

/*
  To upload through terminal you can use: curl -F "image=@firmware.bin" esp32-webupdate.local/update
*/

#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include <ESPmDNS.h>
#include <HTTPUpdateServer.h>

#ifndef STASSID
#define STASSID "xyz"
#define STAPSK  "secret"
#endif

const char* host = "esp32-webupdate";
const char* ssid = STASSID;
const char* password = STAPSK;

WebServer httpServer(80);
HTTPUpdateServer httpUpdater(true);

void setup(void) {

  Serial.begin(115200);
  Serial.println();
  Serial.println("Booting Sketch...");
  WiFi.mode(WIFI_AP_STA);
  WiFi.begin(ssid, password);

  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    WiFi.begin(ssid, password);
    Serial.println("WiFi failed, retrying.");
  }
  
  MDNS.begin(host);
  if (MDNS.begin("esp32")) {
    Serial.println("mDNS responder started");
  }


  httpUpdater.setup(&httpServer);
  httpServer.begin();

  MDNS.addService("http", "tcp", 80);

  Serial.print("IP address [");
  Serial.print(WiFi.localIP());
  Serial.println("]");
  Serial.printf("HTTPUpdateServer ready! Open http://%s.local/update in your browser\n", host);
}

void loop(void) {
  httpServer.handleClient();
}

Debug Message

no other debug info

Other Steps to Reproduce

Partition Scheme: "Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)"

Updating the WebUpdater.ino.bin or other .ino.bin files without a problem.

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions