From d7ed3115870276865bea1f5292b83c4269d8c9fa Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 7 Dec 2020 12:34:09 +0100 Subject: [PATCH 01/11] Update changelog --- CHANGELOG.md | 4 ++-- RELEASENOTES.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 272e61907..1a453cb08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file. - KNX DPT9 (16-bit float) to DPT14 (32-bit float) by Adrian Scillato (#9811, #9888) ### Changed +- Core library from v2.7.4.7 to v2.7.4.9 - Shelly Dimmer fw upgrade using WebGUI Firmware Upgrade and file from folder `tools/fw_shd_stm32/` - MQTT Wifi connection timeout from 5000 to 200 mSec (#9886) - Platformio compiler option `-free -fipa-pta` enabled (#9875) @@ -66,8 +67,7 @@ All notable changes to this project will be documented in this file. ## [Released] -### 9.1.0 20201105 - +## [9.1.0] 20201105 - Release Imogen ## [9.0.0.3] - 20201105 diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7a43c4c8e..61cc3ccd8 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -24,7 +24,7 @@ While fallback or downgrading is common practice it was never supported due to S ## Supported Core versions -This release will be supported from ESP8266/Arduino library Core version **2.7.4.7** due to reported security and stability issues on previous Core version. This will also support gzipped binaries. +This release will be supported from ESP8266/Arduino library Core version **2.7.4.9** due to reported security and stability issues on previous Core version. This will also support gzipped binaries. Support of Core versions before 2.7.1 has been removed. @@ -38,7 +38,7 @@ For initial configuration this release supports Webserver based **WifiManager** ## Provided Binary Downloads -The following binary downloads have been compiled with ESP8266/Arduino library core version **2.7.4.7**. +The following binary downloads have been compiled with ESP8266/Arduino library core version **2.7.4.9**. - **tasmota.bin** = The Tasmota version with most drivers. **RECOMMENDED RELEASE BINARY** - **tasmota-BG.bin** to **tasmota-TW.bin** = The Tasmota version in different languages. @@ -82,7 +82,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - KNX DPT9 (16-bit float) to DPT14 (32-bit float) by Adrian Scillato (#9811, #9888) ### Changed -- Core library from v2.7.4.5 to v2.7.4.7 +- Core library from v2.7.4.5 to v2.7.4.9 - IRremoteESP8266 library from v2.7.12 to v2.7.13 - Shelly Dimmer 1 and 2 stm32 firmware from v51.4 to v51.5 - Platformio compiler option `no target align` enabled (#9749) From b9a3fd43420f90c1ae934da6536ed2a56d1d6ead Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 7 Dec 2020 15:33:09 +0100 Subject: [PATCH 02/11] Fix initial baudrate Fix initial baudrate (#7447) --- tasmota/settings.h | 9 +++++---- tasmota/settings.ino | 9 +++++++-- tasmota/support_tasmota.ino | 7 ------- tasmota/tasmota.ino | 26 +++++++++++++++++++------- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/tasmota/settings.h b/tasmota/settings.h index 02dd5cba3..d55fcc76f 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -683,17 +683,18 @@ typedef struct { uint16_t valid; // 290 (RTC memory offset 100) uint8_t oswatch_blocked_loop; // 292 uint8_t ota_loader; // 293 - unsigned long energy_kWhtoday; // 294 - unsigned long energy_kWhtotal; // 298 + unsigned long energy_kWhtoday; // 294 + unsigned long energy_kWhtotal; // 298 volatile unsigned long pulse_counter[MAX_COUNTERS]; // 29C - See #9521 why volatile power_t power; // 2AC EnergyUsage energy_usage; // 2B0 unsigned long nextwakeup; // 2C8 - uint8_t free_004[4]; // 2CC + uint32_t baudrate; // 2CC uint32_t ultradeepsleep; // 2D0 uint16_t deepsleep_slip; // 2D4 - uint8_t free_022[22]; // 2D6 + uint8_t free_2d6[22]; // 2D6 + // 2EC - 2FF free locations } TRtcSettings; TRtcSettings RtcSettings; diff --git a/tasmota/settings.ino b/tasmota/settings.ino index acaf40598..2ce535710 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -38,6 +38,7 @@ uint32_t GetRtcSettingsCrc(void) void RtcSettingsSave(void) { + RtcSettings.baudrate = Settings.baudrate * 300; if (GetRtcSettingsCrc() != rtc_settings_crc) { RtcSettings.valid = RTC_MEM_VALID; #ifdef ESP8266 @@ -50,8 +51,8 @@ void RtcSettingsSave(void) } } -void RtcSettingsLoad(void) -{ +bool RtcSettingsLoad(void) { + bool was_read_valid = true; #ifdef ESP8266 ESP.rtcUserMemoryRead(100, (uint32_t*)&RtcSettings, sizeof(RtcSettings)); // 0x290 #endif // ESP8266 @@ -59,6 +60,7 @@ void RtcSettingsLoad(void) RtcSettings = RtcDataSettings; #endif // ESP32 if (RtcSettings.valid != RTC_MEM_VALID) { + was_read_valid = false; memset(&RtcSettings, 0, sizeof(RtcSettings)); RtcSettings.valid = RTC_MEM_VALID; RtcSettings.energy_kWhtoday = Settings.energy_kWhtoday; @@ -68,9 +70,12 @@ void RtcSettingsLoad(void) RtcSettings.pulse_counter[i] = Settings.pulse_counter[i]; } RtcSettings.power = Settings.power; +// RtcSettings.baudrate = Settings.baudrate * 300; + RtcSettings.baudrate = APP_BAUDRATE; RtcSettingsSave(); } rtc_settings_crc = GetRtcSettingsCrc(); + return was_read_valid; } bool RtcSettingsValid(void) diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index 69d324ea6..02c6a00ca 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -1495,13 +1495,6 @@ void GpioInit(void) } SetModuleType(); - TasmotaGlobal.module_changed = (Settings.module != Settings.last_module); - if (TasmotaGlobal.module_changed) { - Settings.baudrate = APP_BAUDRATE / 300; - Settings.serial_config = TS_SERIAL_8N1; - SetSerialBegin(); - } - // AddLog_P(LOG_LEVEL_DEBUG, PSTR("DBG: Used GPIOs %d"), GPIO_SENSOR_END); #ifdef ESP8266 diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 0af214158..3dce0c860 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -215,22 +215,27 @@ void setup(void) { #endif RtcRebootSave(); + if (RtcSettingsLoad()) { + uint32_t baudrate = (RtcSettings.baudrate / 300) * 300; // Make it a valid baudrate + if (baudrate) { TasmotaGlobal.baudrate = baudrate; } + } Serial.begin(TasmotaGlobal.baudrate); + Serial.println(); // Serial.setRxBufferSize(INPUT_BUFFER_SIZE); // Default is 256 chars TasmotaGlobal.seriallog_level = LOG_LEVEL_INFO; // Allow specific serial messages until config loaded - snprintf_P(TasmotaGlobal.version, sizeof(TasmotaGlobal.version), PSTR("%d.%d.%d"), VERSION >> 24 & 0xff, VERSION >> 16 & 0xff, VERSION >> 8 & 0xff); // Release version 6.3.0 - if (VERSION & 0xff) { // Development or patched version 6.3.0.10 - snprintf_P(TasmotaGlobal.version, sizeof(TasmotaGlobal.version), PSTR("%s.%d"), TasmotaGlobal.version, VERSION & 0xff); - } - // Thehackbox inserts "release" or "commit number" before compiling using sed -i -e 's/PSTR("(%s)")/PSTR("(85cff52-%s)")/g' tasmota.ino - snprintf_P(TasmotaGlobal.image_name, sizeof(TasmotaGlobal.image_name), PSTR("(%s)"), CODE_IMAGE_STR); // Results in (85cff52-tasmota) or (release-tasmota) - SettingsLoad(); SettingsDelta(); OsWatchInit(); + TasmotaGlobal.module_changed = (Settings.module != Settings.last_module); + if (TasmotaGlobal.module_changed) { + Settings.baudrate = APP_BAUDRATE / 300; + Settings.serial_config = TS_SERIAL_8N1; + } + SetSerialBegin(); + if (1 == RtcReboot.fast_reboot_count) { // Allow setting override only when all is well UpdateQuickPowerCycle(true); } @@ -281,6 +286,13 @@ void setup(void) { } } + snprintf_P(TasmotaGlobal.version, sizeof(TasmotaGlobal.version), PSTR("%d.%d.%d"), VERSION >> 24 & 0xff, VERSION >> 16 & 0xff, VERSION >> 8 & 0xff); // Release version 6.3.0 + if (VERSION & 0xff) { // Development or patched version 6.3.0.10 + snprintf_P(TasmotaGlobal.version, sizeof(TasmotaGlobal.version), PSTR("%s.%d"), TasmotaGlobal.version, VERSION & 0xff); + } + // Thehackbox inserts "release" or "commit number" before compiling using sed -i -e 's/PSTR("(%s)")/PSTR("(85cff52-%s)")/g' tasmota.ino + snprintf_P(TasmotaGlobal.image_name, sizeof(TasmotaGlobal.image_name), PSTR("(%s)"), CODE_IMAGE_STR); // Results in (85cff52-tasmota) or (release-tasmota) + Format(TasmotaGlobal.mqtt_client, SettingsText(SET_MQTT_CLIENT), sizeof(TasmotaGlobal.mqtt_client)); Format(TasmotaGlobal.mqtt_topic, SettingsText(SET_MQTT_TOPIC), sizeof(TasmotaGlobal.mqtt_topic)); if (strchr(SettingsText(SET_HOSTNAME), '%') != nullptr) { From c73998f27d31bf0f0941c2f6abbf99090920baa9 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 7 Dec 2020 16:53:44 +0100 Subject: [PATCH 03/11] Use esp32-1.0.5-rc4 for stage --- platformio_override_sample.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio_override_sample.ini b/platformio_override_sample.ini index 464c507ea..259f2b47e 100644 --- a/platformio_override_sample.ini +++ b/platformio_override_sample.ini @@ -133,7 +133,7 @@ lib_extra_dirs = ${library.lib_extra_dirs} [core32_stage] platform = espressif32 @ 2.0.0 platform_packages = platformio/tool-esptoolpy @ ~1.30000.0 - framework-arduinoespressif32 @ https://github.com/Jason2866/arduino-esp32/releases/download/1.0.5-rc2/esp32-1.0.5-rc2.zip + framework-arduinoespressif32 @ https://github.com/Jason2866/arduino-esp32/releases/download/1.0.5-rc4/esp32-1.0.5-rc4.zip build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags} ;-DESP32_STAGE=true From 2f47a4b5c974ade48d8bb7efcd59609fa6adad3a Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 7 Dec 2020 17:03:22 +0100 Subject: [PATCH 04/11] Refactor serial init --- tasmota/support.ino | 8 ++++++-- tasmota/tasmota.ino | 13 ++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/tasmota/support.ino b/tasmota/support.ino index ef6b3813b..cb60c41fa 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -911,6 +911,10 @@ String GetSerialConfig(void) { return String(config); } +uint32_t GetSerialBaudrate(void) { + return (Serial.baudRate() / 300) * 300; // Fix ESP32 strange results like 115201 +} + void SetSerialBegin(void) { TasmotaGlobal.baudrate = Settings.baudrate * 300; AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_SERIAL "Set to %s %d bit/s"), GetSerialConfig().c_str(), TasmotaGlobal.baudrate); @@ -940,7 +944,7 @@ void SetSerialConfig(uint32_t serial_config) { void SetSerialBaudrate(uint32_t baudrate) { TasmotaGlobal.baudrate = baudrate; Settings.baudrate = TasmotaGlobal.baudrate / 300; - if (Serial.baudRate() != TasmotaGlobal.baudrate) { + if (GetSerialBaudrate() != TasmotaGlobal.baudrate) { SetSerialBegin(); } } @@ -958,7 +962,7 @@ void ClaimSerial(void) { TasmotaGlobal.serial_local = true; AddLog_P(LOG_LEVEL_INFO, PSTR("SNS: Hardware Serial")); SetSeriallog(LOG_LEVEL_NONE); - TasmotaGlobal.baudrate = Serial.baudRate(); + TasmotaGlobal.baudrate = GetSerialBaudrate(); Settings.baudrate = TasmotaGlobal.baudrate / 300; } diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 3dce0c860..d8d5a82f9 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -193,6 +193,7 @@ void setup(void) { memset(&TasmotaGlobal, 0, sizeof(TasmotaGlobal)); TasmotaGlobal.baudrate = APP_BAUDRATE; + TasmotaGlobal.seriallog_timer = SERIALLOG_TIMER; TasmotaGlobal.temperature_celsius = NAN; TasmotaGlobal.blinks = 201; TasmotaGlobal.wifi_state_flag = WIFI_RESTART; @@ -229,20 +230,20 @@ void setup(void) { OsWatchInit(); + TasmotaGlobal.seriallog_level = Settings.seriallog_level; + TasmotaGlobal.syslog_level = Settings.syslog_level; + TasmotaGlobal.module_changed = (Settings.module != Settings.last_module); if (TasmotaGlobal.module_changed) { Settings.baudrate = APP_BAUDRATE / 300; Settings.serial_config = TS_SERIAL_8N1; } - SetSerialBegin(); + SetSerialBaudrate(Settings.baudrate * 300); // Reset serial interface if current baudrate is different from requested baudrate - if (1 == RtcReboot.fast_reboot_count) { // Allow setting override only when all is well + if (1 == RtcReboot.fast_reboot_count) { // Allow setting override only when all is well UpdateQuickPowerCycle(true); } - TasmotaGlobal.seriallog_level = Settings.seriallog_level; - TasmotaGlobal.seriallog_timer = SERIALLOG_TIMER; - TasmotaGlobal.syslog_level = Settings.syslog_level; TasmotaGlobal.stop_flash_rotate = Settings.flag.stop_flash_rotate; // SetOption12 - Switch between dynamic or fixed slot flash save location TasmotaGlobal.save_data_counter = Settings.save_data; TasmotaGlobal.sleep = Settings.sleep; @@ -305,8 +306,6 @@ void setup(void) { GetEspHardwareType(); GpioInit(); -// SetSerialBaudrate(Settings.baudrate * 300); // Allow reset of serial interface if current baudrate is different from requested baudrate - WifiConnect(); SetPowerOnState(); From 43171d12a7b92ec1739109e85f7ad8f56e5ec4c0 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 7 Dec 2020 18:16:28 +0100 Subject: [PATCH 05/11] Fix ESP32 phy mode detection --- .../ESP32-to-ESP8266-compat/src/ESP32Wifi.cpp | 11 ++++++++++- tasmota/support_wifi.ino | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/libesp32/ESP32-to-ESP8266-compat/src/ESP32Wifi.cpp b/lib/libesp32/ESP32-to-ESP8266-compat/src/ESP32Wifi.cpp index 9ce191cde..a72d95cb6 100644 --- a/lib/libesp32/ESP32-to-ESP8266-compat/src/ESP32Wifi.cpp +++ b/lib/libesp32/ESP32-to-ESP8266-compat/src/ESP32Wifi.cpp @@ -19,6 +19,7 @@ // #include "Arduino.h" #include +#include // // Wifi @@ -35,7 +36,15 @@ void WiFiClass32::setSleepMode(int iSleepMode) int WiFiClass32::getPhyMode() { - return 0; // " BGN" + int phy_mode = 0; // " BGNL" + uint8_t protocol_bitmap; + if (esp_wifi_get_protocol(WIFI_IF_STA, &protocol_bitmap) == ESP_OK) { + if (protocol_bitmap & 1) { phy_mode = 1; } // 11b + if (protocol_bitmap & 2) { phy_mode = 2; } // 11g + if (protocol_bitmap & 4) { phy_mode = 3; } // 11n + if (protocol_bitmap & 8) { phy_mode = 4; } // Low rate + } + return phy_mode; } void WiFiClass32::wps_disable() diff --git a/tasmota/support_wifi.ino b/tasmota/support_wifi.ino index 87d0110f1..6cba8a053 100644 --- a/tasmota/support_wifi.ino +++ b/tasmota/support_wifi.ino @@ -163,7 +163,7 @@ void WiFiSetSleepMode(void) void WifiBegin(uint8_t flag, uint8_t channel) { - const char kWifiPhyMode[] = " BGN"; + const char kWifiPhyMode[] = " bgnl"; #ifdef USE_EMULATION UdpDisconnect(); From 620ff05624c2a897f98b28bb6a56330e8c3778b0 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 7 Dec 2020 18:23:34 +0100 Subject: [PATCH 06/11] Use Platformio espressif32 @ 2.1.0 --- platformio_tasmota32.ini | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index cbc565e5b..c942b178a 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -86,8 +86,7 @@ build_flags = ${esp_defaults.build_flags} [core32] -platform = espressif32 @ 2.0.0 -platform_packages = platformio/tool-esptoolpy @ ~1.30000.0 - framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/1.0.4.2/esp32-1.0.4.2.zip +platform = espressif32 @ 2.1.0 +platform_packages = framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/1.0.4.2/esp32-1.0.4.2.zip build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags} From b873debcf3b449da211d968ea606172ad6a7e259 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 7 Dec 2020 18:31:32 +0100 Subject: [PATCH 07/11] Platformio espressif32 @ 2.1.0 --- platformio_override_sample.ini | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platformio_override_sample.ini b/platformio_override_sample.ini index 259f2b47e..ee86985a8 100644 --- a/platformio_override_sample.ini +++ b/platformio_override_sample.ini @@ -131,9 +131,8 @@ lib_extra_dirs = ${library.lib_extra_dirs} [core32_stage] -platform = espressif32 @ 2.0.0 -platform_packages = platformio/tool-esptoolpy @ ~1.30000.0 - framework-arduinoespressif32 @ https://github.com/Jason2866/arduino-esp32/releases/download/1.0.5-rc4/esp32-1.0.5-rc4.zip +platform = espressif32 @ 2.1.0 +platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/arduino-esp32/releases/download/1.0.5-rc4/esp32-1.0.5-rc4.zip build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags} ;-DESP32_STAGE=true From c1f103be5a14301d2814f65ad2d3e61a6f768b71 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Mon, 7 Dec 2020 19:37:11 +0100 Subject: [PATCH 08/11] Add Letsencrypt R3 CA --- tasmota/tasmota_ca.ino | 72 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/tasmota/tasmota_ca.ino b/tasmota/tasmota_ca.ino index a3377b305..990a0f970 100644 --- a/tasmota/tasmota_ca.ino +++ b/tasmota/tasmota_ca.ino @@ -85,6 +85,66 @@ static const br_x509_trust_anchor PROGMEM LetsEncryptX3CrossSigned_TA = { } }; +/*********************************************************************************************\ + * LetsEncrypt R3 certificate, RSA 2048 bits SHA 256, valid until 20250915 + * + * https://letsencrypt.org/certificates/ + * Downloaded from https://letsencrypt.org/certs/lets-encrypt-r3.pem + * + * to convert do: `bearssl ta lets-encrypt-r3.pem` + * then copy and paste below, chain the generic names to the same as below + * remove "static" and add "PROGMEM" +\*********************************************************************************************/ + +static const unsigned char PROGMEM LetsEncryptR3_DN[] = { + 0x30, 0x32, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, + 0x02, 0x55, 0x53, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0A, + 0x13, 0x0D, 0x4C, 0x65, 0x74, 0x27, 0x73, 0x20, 0x45, 0x6E, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x03, + 0x13, 0x02, 0x52, 0x33 +}; + +static const unsigned char PROGMEM LetsEncryptR3_RSA_N[] = { + 0xBB, 0x02, 0x15, 0x28, 0xCC, 0xF6, 0xA0, 0x94, 0xD3, 0x0F, 0x12, 0xEC, + 0x8D, 0x55, 0x92, 0xC3, 0xF8, 0x82, 0xF1, 0x99, 0xA6, 0x7A, 0x42, 0x88, + 0xA7, 0x5D, 0x26, 0xAA, 0xB5, 0x2B, 0xB9, 0xC5, 0x4C, 0xB1, 0xAF, 0x8E, + 0x6B, 0xF9, 0x75, 0xC8, 0xA3, 0xD7, 0x0F, 0x47, 0x94, 0x14, 0x55, 0x35, + 0x57, 0x8C, 0x9E, 0xA8, 0xA2, 0x39, 0x19, 0xF5, 0x82, 0x3C, 0x42, 0xA9, + 0x4E, 0x6E, 0xF5, 0x3B, 0xC3, 0x2E, 0xDB, 0x8D, 0xC0, 0xB0, 0x5C, 0xF3, + 0x59, 0x38, 0xE7, 0xED, 0xCF, 0x69, 0xF0, 0x5A, 0x0B, 0x1B, 0xBE, 0xC0, + 0x94, 0x24, 0x25, 0x87, 0xFA, 0x37, 0x71, 0xB3, 0x13, 0xE7, 0x1C, 0xAC, + 0xE1, 0x9B, 0xEF, 0xDB, 0xE4, 0x3B, 0x45, 0x52, 0x45, 0x96, 0xA9, 0xC1, + 0x53, 0xCE, 0x34, 0xC8, 0x52, 0xEE, 0xB5, 0xAE, 0xED, 0x8F, 0xDE, 0x60, + 0x70, 0xE2, 0xA5, 0x54, 0xAB, 0xB6, 0x6D, 0x0E, 0x97, 0xA5, 0x40, 0x34, + 0x6B, 0x2B, 0xD3, 0xBC, 0x66, 0xEB, 0x66, 0x34, 0x7C, 0xFA, 0x6B, 0x8B, + 0x8F, 0x57, 0x29, 0x99, 0xF8, 0x30, 0x17, 0x5D, 0xBA, 0x72, 0x6F, 0xFB, + 0x81, 0xC5, 0xAD, 0xD2, 0x86, 0x58, 0x3D, 0x17, 0xC7, 0xE7, 0x09, 0xBB, + 0xF1, 0x2B, 0xF7, 0x86, 0xDC, 0xC1, 0xDA, 0x71, 0x5D, 0xD4, 0x46, 0xE3, + 0xCC, 0xAD, 0x25, 0xC1, 0x88, 0xBC, 0x60, 0x67, 0x75, 0x66, 0xB3, 0xF1, + 0x18, 0xF7, 0xA2, 0x5C, 0xE6, 0x53, 0xFF, 0x3A, 0x88, 0xB6, 0x47, 0xA5, + 0xFF, 0x13, 0x18, 0xEA, 0x98, 0x09, 0x77, 0x3F, 0x9D, 0x53, 0xF9, 0xCF, + 0x01, 0xE5, 0xF5, 0xA6, 0x70, 0x17, 0x14, 0xAF, 0x63, 0xA4, 0xFF, 0x99, + 0xB3, 0x93, 0x9D, 0xDC, 0x53, 0xA7, 0x06, 0xFE, 0x48, 0x85, 0x1D, 0xA1, + 0x69, 0xAE, 0x25, 0x75, 0xBB, 0x13, 0xCC, 0x52, 0x03, 0xF5, 0xED, 0x51, + 0xA1, 0x8B, 0xDB, 0x15 +}; + +static const unsigned char LetsEncryptR3_RSA_E[] = { + 0x01, 0x00, 0x01 +}; + +static const br_x509_trust_anchor PROGMEM LetsEncryptR3_TA = { + { (unsigned char *)LetsEncryptR3_DN, sizeof LetsEncryptR3_DN }, + BR_X509_TA_CA, + { + BR_KEYTYPE_RSA, + { .rsa = { + (unsigned char *)LetsEncryptR3_RSA_N, sizeof LetsEncryptR3_RSA_N, + (unsigned char *)LetsEncryptR3_RSA_E, sizeof LetsEncryptR3_RSA_E, + } } + } +}; + /*********************************************************************************************\ * Amazon Root CA, RSA 2048 bits SHA 256, valid until 20380117 * @@ -160,6 +220,18 @@ const br_x509_trust_anchor PROGMEM Tasmota_TA[] = { } } , + { + { (unsigned char *)LetsEncryptR3_DN, sizeof LetsEncryptR3_DN }, + BR_X509_TA_CA, + { + BR_KEYTYPE_RSA, + { .rsa = { + (unsigned char *)LetsEncryptR3_RSA_N, sizeof LetsEncryptR3_RSA_N, + (unsigned char *)LetsEncryptR3_RSA_E, sizeof LetsEncryptR3_RSA_E, + } } + } + } + , { { (unsigned char *)AmazonRootCA1_DN, sizeof AmazonRootCA1_DN }, BR_X509_TA_CA, From fdec66ee015648fb029d76d93f8d4d04dad4fec3 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 7 Dec 2020 20:04:47 +0100 Subject: [PATCH 09/11] Fix zigbee32 compile error --- tasmota/xdrv_23_zigbee_6_commands.ino | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasmota/xdrv_23_zigbee_6_commands.ino b/tasmota/xdrv_23_zigbee_6_commands.ino index 1e4675e22..63ea80869 100644 --- a/tasmota/xdrv_23_zigbee_6_commands.ino +++ b/tasmota/xdrv_23_zigbee_6_commands.ino @@ -479,10 +479,12 @@ void parseSingleTuyaAttribute(Z_attribute & attr, const SBuffer &buf, attr.setUInt(buf.get32BigEndian(i)); break; case 0x03: // String (we expect it is not ended with \00) + { char str[len+1]; strncpy(str, buf.charptr(i), len); str[len] = 0x00; attr.setStr(str); + } break; case 0x05: // enum in 1/2/4 bytes, Big Endian if (1 == len) { From a11004607336b08247cab6640a7e2a8f18ab1ea1 Mon Sep 17 00:00:00 2001 From: Vic Date: Mon, 7 Dec 2020 22:24:00 +0100 Subject: [PATCH 10/11] This is a fix for issue #10038 (first LED in a WS2812 string flicks colors instead of fading) --- tasmota/xlgt_01_ws2812.ino | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/tasmota/xlgt_01_ws2812.ino b/tasmota/xlgt_01_ws2812.ino index e98d3ec12..42340b5ad 100644 --- a/tasmota/xlgt_01_ws2812.ino +++ b/tasmota/xlgt_01_ws2812.ino @@ -304,22 +304,15 @@ void Ws2812Gradient(uint32_t schemenr) WsColor oldColor, currentColor; Ws2812GradientColor(schemenr, &oldColor, range, gradRange, offset); currentColor = oldColor; + speed = speed ? speed : 1; // should never happen, just avoid div0 for (uint32_t i = 0; i < Settings.light_pixels; i++) { if (kWsRepeat[Settings.light_width] > 1) { - Ws2812GradientColor(schemenr, ¤tColor, range, gradRange, i +offset); - } - if (Settings.light_speed > 0) { - // Blend old and current color based on time for smooth movement. - c.R = map(Light.strip_timer_counter % speed, 0, speed, oldColor.red, currentColor.red); - c.G = map(Light.strip_timer_counter % speed, 0, speed, oldColor.green, currentColor.green); - c.B = map(Light.strip_timer_counter % speed, 0, speed, oldColor.blue, currentColor.blue); - } - else { - // No animation, just use the current color. - c.R = currentColor.red; - c.G = currentColor.green; - c.B = currentColor.blue; + Ws2812GradientColor(schemenr, ¤tColor, range, gradRange, i + offset + 1); } + // Blend old and current color based on time for smooth movement. + c.R = map(Light.strip_timer_counter % speed, 0, speed, oldColor.red, currentColor.red); + c.G = map(Light.strip_timer_counter % speed, 0, speed, oldColor.green, currentColor.green); + c.B = map(Light.strip_timer_counter % speed, 0, speed, oldColor.blue, currentColor.blue); strip->SetPixelColor(i, c); oldColor = currentColor; } @@ -586,4 +579,4 @@ bool Xlgt01(uint8_t function) } #endif // USE_WS2812 -#endif // USE_LIGHT \ No newline at end of file +#endif // USE_LIGHT From 821270adc188819134fd328a9eeb59a116c58ce5 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 8 Dec 2020 11:06:19 +0100 Subject: [PATCH 11/11] Update changelog --- CHANGELOG.md | 5 +++++ RELEASENOTES.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a453cb08..57a781fb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,9 @@ All notable changes to this project will be documented in this file. - TyuaMcu update 2/3 by Federico Leoni (#10004) - Optional CCloader support for CC25xx Zigbee or CC26xx BLE by Christian Baars (#9970) - Command ``RfProtocol`` to control RcSwitch receive protocols by BBBits (#10063) +- Zigbee better support for Tuya Protocol (#10074) - Support for SPI connected MFRC522 13.56MHz rfid card reader (#9916) +- Letsencrypt R3 in addition to X3 CA (#10086) ### Breaking Changed - KNX DPT9 (16-bit float) to DPT14 (32-bit float) by Adrian Scillato (#9811, #9888) @@ -25,6 +27,7 @@ All notable changes to this project will be documented in this file. - Platformio compiler option `-free -fipa-pta` enabled (#9875) - IRremoteESP8266 library from v2.7.12 to v2.7.13 - Shelly Dimmer 1 and 2 stm32 firmware from v51.4 to v51.5 +- Force bigger Thunk Stack if 4K RSA even without EC ciphers (#10075) ### Fixed - KNX ESP32 UDP mulicastpackage (#9811) @@ -32,6 +35,8 @@ All notable changes to this project will be documented in this file. - ESP32 TasmotaClient firmware upgrade (#9218) - Reset to defaults after 6 hours of DeepSleep (#9993) - Backlog timing wraparound (#9995) +- First LED in addressable string does not fade when using scheme (#10088) +- Improved Opentherm error handling (#10055) ### Removed - PN532 define USE_PN532_CAUSE_EVENTS replaced by generic rule trigger `on pn532#uid=` diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 61cc3ccd8..79bfa0bd2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -67,6 +67,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - Zigbee support for Mi Door and Contact (#9759) - Zigbee alarm persistence (#9785) - Zigbee persistence of device/sensor data in EEPROM (only ZBBridge) +- Zigbee better support for Tuya Protocol (#10074) - TyuaMcu update 2/3 by Federico Leoni (#10004) - Support for additional EZO sensors by Christopher Tremblay - Support for AS608 optical and R503 capacitive fingerprint sensor @@ -77,6 +78,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - KNX read reply for Power (#9236, #9891) - Fallback NTP server from x.pool.ntp.org if no ntpservers are configured - Optional CCloader support for CC25xx Zigbee or CC26xx BLE by Christian Baars (#9970) +- Letsencrypt R3 in addition to X3 CA (#10086) ### Breaking Changed - KNX DPT9 (16-bit float) to DPT14 (32-bit float) by Adrian Scillato (#9811, #9888) @@ -88,6 +90,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - Platformio compiler option `no target align` enabled (#9749) - Sonoff L1 color up scaling and color margin detection (#9545) - MQTT Wifi connection timeout from 5000 to 200 mSec (#9886) +- Force bigger Thunk Stack if 4K RSA even without EC ciphers (#10075) ### Fixed - Command ``gpio`` using non-indexed functions regression from v9.1.0 (#9962) @@ -99,6 +102,8 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - ESP32 TasmotaClient firmware upgrade (#9218) - Reset to defaults after 6 hours of DeepSleep (#9993) - Backlog timing wraparound (#9995) +- First LED in addressable string does not fade when using scheme (#10088) +- Improved Opentherm error handling (#10055) ### Removed - Version compatibility check