Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESP8266HTTPUpdateServer library] [WebUpdate example] false "Update Success" response if no file selected #7721

Closed
6 tasks done
rejnok93 opened this issue Nov 24, 2020 · 0 comments · Fixed by #7729
Closed
6 tasks done

Comments

@rejnok93
Copy link

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP-01
  • Core Version: 2 Aug 2020 (2.7.4)
  • Development Env: Platformio
  • Operating System: MacOS

Settings in IDE

  • Module: Generic ESP8266 Module
  • Flash Mode: qio
  • Flash Size: 1MB
  • lwip Variant: ?
  • Reset Method: ?
  • Flash Frequency: 40Mhz
  • CPU Frequency: ?
  • Upload Using: OTA
  • Upload Speed: -

Problem Description

Steps to reproduce + Actual behaviour:
When user not select any file for FileSystem, and click update filesystem, server respond message that update is succesfull - not true.
Expected behaviour:
Server respond that update fails, because no file is sent!

MCVE Sketch

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>

#ifndef STASSID
#define STASSID "test"
#define STAPSK  "test"
#endif

const char* host = "test";
const char* ssid = STASSID;
const char* password = STAPSK;

ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;

void setup(void) {
  WiFi.mode(WIFI_AP_STA);
  WiFi.begin(ssid, password);
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    WiFi.begin(ssid, password);
  }
  MDNS.begin(host);
  httpUpdater.setup(&httpServer);
  httpServer.begin();
  MDNS.addService("http", "tcp", 80);
}

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

Debug Messages


earlephilhower added a commit to earlephilhower/Arduino that referenced this issue Nov 28, 2020
Fixes esp8266#7721 by adding a new error code for when Update::end is called
without any progress at all being made (i.e. no data actually ::write()
to the Update object.
d-a-v pushed a commit that referenced this issue Dec 1, 2020
Fixes #7721 by adding a new error code for when Update::end is called
without any progress at all being made (i.e. no data actually ::write()
to the Update object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant