From 95fc96d5635e87e7eac66bea29c04a10df7bbec9 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 6 Jan 2020 14:52:04 +0100 Subject: [PATCH] Add support for gzipped binaries Add support for gzipped binaries --- RELEASENOTES.md | 4 +++- tasmota/CHANGELOG.md | 16 ++++++++++------ tasmota/settings.ino | 5 +++++ tasmota/tasmota_version.h | 2 +- tasmota/xdrv_01_webserver.ino | 14 ++++++++------ 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0335fc6e6..007b99fe2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -52,7 +52,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c ## Changelog -### Version 8.1.0.2 +### Version 8.1.0.3 - Change Lights: simplified gamma correction and 10 bits internal computation - Fix Sonoff Bridge, Sc, L1, iFan03 and CSE7766 serial interface to forced speed, config and disable logging @@ -62,6 +62,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Fix LCD line and column positioning (#7387) - Fix Display handling of hexadecimal escape characters (#7387) - Add command ``SetOption79 0/1`` to enable reset of counters at teleperiod time by Andre Thomas (#7355) +- Add command ``SetOption82 0/1`` to limit the CT range for Alexa to 200..380 - Add command ``ShutterButton `` to control shutter(s) by to-scho (#7403) - Add SerialConfig to ``Status 1`` - Add WifiPower to ``Status 5`` @@ -71,3 +72,4 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Add optional support for Prometheus using file xsns_91_prometheus.ino (#7216) - Add experimental support for NRF24L01 as BLE-bridge for Mijia Bluetooth sensors by Christian Baars (#7394) - Add support to BMP driver to enter reset state (sleep enable) when deep sleep is used in Tasmota +- Add support for gzipped binaries diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index a087ea907..2c7e22a3f 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -1,17 +1,21 @@ ## Unreleased (development) +### 8.1.0.3 20200106 + +- Add support for gzipped binaries + ### 8.1.0.2 20191230 -- Add support for ``AdcParam`` parameters to control ADC0 Current Transformer Apparent Power formula by Jodi Dillon (#7100) -- Add optional support for Prometheus using file xsns_91_prometheus.ino (#7216) -- Add command ``ShutterButton `` to control shutter(s) by to-scho (#7403) -- Add experimental support for NRF24L01 as BLE-bridge for Mijia Bluetooth sensors by Christian Baars (#7394) -- Add support to BMP driver to enter reset state (sleep enable) when deep sleep is used in Tasmota - Fix LCD line and column positioning (#7387) - Fix Display handling of hexadecimal escape characters (#7387) - Fix Improved fade linearity with gamma correction - Fix wrong gamma correction for Module 48 lights (PWM5 for CT) -- Add SetOption82 to limit the CT range for Alexa to 200..380 +- Add support for ``AdcParam`` parameters to control ADC0 Current Transformer Apparent Power formula by Jodi Dillon (#7100) +- Add optional support for Prometheus using file xsns_91_prometheus.ino (#7216) +- Add command ``ShutterButton `` to control shutter(s) by to-scho (#7403) +- Add command ``SetOption82 0/1`` to limit the CT range for Alexa to 200..380 +- Add experimental support for NRF24L01 as BLE-bridge for Mijia Bluetooth sensors by Christian Baars (#7394) +- Add support to BMP driver to enter reset state (sleep enable) when deep sleep is used in Tasmota ### 8.1.0.1 20191225 diff --git a/tasmota/settings.ino b/tasmota/settings.ino index dbd4c6d50..21f3e0ab4 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -359,6 +359,11 @@ uint32_t OtaVersion(void) bool found = false; for (uint32_t address = start_address; address < end_address; address = address + FLASH_SECTOR_SIZE) { ESP.flashRead(address, (uint32_t*)buffer, FLASH_SECTOR_SIZE); + if ((address == start_address) && (0x1F == (buffer[0] & 0xFF))) { + version[1] = 0xFFFFFFFF; // Ota file is gzipped and can not be checked for compatibility + found = true; + break; + } for (uint32_t i = 0; i < (FLASH_SECTOR_SIZE / 4); i++) { version[0] = version[1]; version[1] = version[2]; diff --git a/tasmota/tasmota_version.h b/tasmota/tasmota_version.h index 4b410adf1..fab871449 100644 --- a/tasmota/tasmota_version.h +++ b/tasmota/tasmota_version.h @@ -20,7 +20,7 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x08010002; +const uint32_t VERSION = 0x08010003; // Lowest compatible version const uint32_t VERSION_COMPATIBLE = 0x07010006; diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index eb14933d4..682663905 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -2270,16 +2270,18 @@ void HandleUploadLoop(void) } else #endif { - if (upload.buf[0] != 0xE9) { + if ((upload.buf[0] != 0xE9) && (upload.buf[0] != 0x1F)) { // 0x1F is gzipped 0xE9 Web.upload_error = 3; // Magic byte is not 0xE9 return; } - uint32_t bin_flash_size = ESP.magicFlashChipSize((upload.buf[3] & 0xf0) >> 4); - if(bin_flash_size > ESP.getFlashChipRealSize()) { - Web.upload_error = 4; // Program flash size is larger than real flash size - return; + if (0xE9 == upload.buf[0]) { + uint32_t bin_flash_size = ESP.magicFlashChipSize((upload.buf[3] & 0xf0) >> 4); + if (bin_flash_size > ESP.getFlashChipRealSize()) { + Web.upload_error = 4; // Program flash size is larger than real flash size + return; + } +// upload.buf[2] = 3; // Force DOUT - ESP8285 } -// upload.buf[2] = 3; // Force DOUT - ESP8285 } } }