Compare commits

...
2 Commits
Author SHA1 Message Date
proddy c8a96352ec 3.8.4 2026-08-04 08:13:45 +02:00
proddy 02caaef916 fix firmware size check 2026-08-03 09:59:46 +02:00
3 changed files with 18 additions and 6 deletions
+6
View File
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.8.4] 4 August 2026
## Fixed
- Allow auto-download and install of firmware versions which are smaller to allow update to the latest 3.9.0-development version.
## [3.8.3] 1 August 2026 ## [3.8.3] 1 August 2026
## Added ## Added
+11 -5
View File
@@ -3024,18 +3024,24 @@ bool System::uploadFirmwareURL(const char * url) {
return false; // error return false; // error
} }
// the Content-Length from the response header, -1 if the server didn't send one.
int firmware_size = http.getSize(); int firmware_size = http.getSize();
if (firmware_size <= 0) {
LOG_ERROR("Firmware upload failed - unknown size");
http.end();
return false; // error
}
// check we have a valid size // catch a wrong URL early, before streaming. Smallest shipped image is ~1.9MB
if (firmware_size < 2097152) { // 2MB or greater is required if (firmware_size < 1677721) { // 1.6MB
LOG_ERROR("Firmware upload failed - invalid size"); LOG_ERROR("Firmware upload failed - too small (%d KB)", firmware_size / 1024);
http.end(); http.end();
return false; // error return false; // error
} }
// check we have enough space for the upload in the ota partition // check we have enough space for the upload in the ota partition
if (!Update.begin(firmware_size)) { if (!Update.begin(firmware_size)) {
LOG_ERROR("Firmware upload failed - no space"); LOG_ERROR("Firmware upload failed - %s", Update.errorString());
http.end(); http.end();
return false; // error return false; // error
} }
@@ -3052,7 +3058,7 @@ bool System::uploadFirmwareURL(const char * url) {
// get tcp stream and send it to Updater // get tcp stream and send it to Updater
WiFiClient * stream = http.getStreamPtr(); WiFiClient * stream = http.getStreamPtr();
if (Update.writeStream(*stream) != firmware_size) { if (Update.writeStream(*stream) != (size_t)firmware_size) {
LOG_ERROR("Firmware upload failed - size differences"); LOG_ERROR("Firmware upload failed - size differences");
http.end(); http.end();
EMSESP::system_.systemStatus(SYSTEM_STATUS::SYSTEM_STATUS_ERROR_UPLOAD); EMSESP::system_.systemStatus(SYSTEM_STATUS::SYSTEM_STATUS_ERROR_UPLOAD);
+1 -1
View File
@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.8.3" #define EMSESP_APP_VERSION "3.8.4"