From 628c00f0906bd55b38820a323c1808eba9433335 Mon Sep 17 00:00:00 2001 From: Lenbok Date: Fri, 29 Oct 2021 19:43:10 +1300 Subject: [PATCH 1/8] Reflect PVVX firmware reed switch status The first bit of the flag field reflects reed switch status so this device can additionally be used to monitor the status of a door. --- tasmota/xsns_62_esp32_mi_ble.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasmota/xsns_62_esp32_mi_ble.ino b/tasmota/xsns_62_esp32_mi_ble.ino index cb9548e6e..761d1c0de 100644 --- a/tasmota/xsns_62_esp32_mi_ble.ino +++ b/tasmota/xsns_62_esp32_mi_ble.ino @@ -1586,6 +1586,10 @@ void MI32ParseATCPacket(const uint8_t * _buf, uint32_t length, const uint8_t *ad MIBLEsensors[_slot].bat = ppv_packet->battery_level; MIBLEsensors[_slot].eventType.bat = 1; + MIBLEsensors[_slot].Btn = (ppv_packet->flags) & 0x1; // First bit is reed switch status + MIBLEsensors[_slot].eventType.Btn = 1; + MIBLEsensors[_slot].feature.Btn = 1; + if(MI32.option.directBridgeMode) { MIBLEsensors[_slot].shallSendMQTT = 1; MI32.mode.shallTriggerTele = 1; @@ -3271,4 +3275,4 @@ bool Xsns62(uint8_t function) #endif // CONFIG_IDF_TARGET_ESP32 or CONFIG_IDF_TARGET_ESP32C3 #endif // ESP32 -#endif \ No newline at end of file +#endif From c8c21e9e3789a80d29605596ebc8634a1895a255 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Fri, 12 Nov 2021 09:43:55 +0100 Subject: [PATCH 2/8] Tcpbridge fix warning (#13651) * Fix compiler warning * Fix compiler warning --- tasmota/support.ino | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tasmota/support.ino b/tasmota/support.ino index 1bc0ba4a3..76ca608e9 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -1840,18 +1840,15 @@ int8_t ParseSerialConfig(const char *pstr) return serial_config; } +uint32_t ConvertSerialConfig(uint8_t serial_config) { #ifdef ESP8266 -SerConfu8 ConvertSerialConfigESP8286(uint8_t serial_config) { - return (SerConfu8)pgm_read_byte(kTasmotaSerialConfig + serial_config); -} -#define ConvertSerialConfig(a) ConvertSerialConfigESP8286(a) -#endif // ESP8266 -#ifdef ESP32 -uint32_t ConvertSerialConfigESP32(uint8_t serial_config) { + return (uint32_t)pgm_read_byte(kTasmotaSerialConfig + serial_config); +#elif defined(ESP32) return (uint32_t)pgm_read_dword(kTasmotaSerialConfig + serial_config); +#else + #error "platform not supported" +#endif } -#define ConvertSerialConfig(a) ConvertSerialConfigESP32(a) -#endif // ESP32 // workaround disabled 05.11.2021 solved with https://github.com/espressif/arduino-esp32/pull/5549 //#if defined(ESP32) && CONFIG_IDF_TARGET_ESP32C3 From dbd7d297654c37494d1794748d8b0480b97e843b Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 12 Nov 2021 14:39:14 +0100 Subject: [PATCH 3/8] Fix CSE7761 comms Fix CSE7761 and Sonoff Dual R3 comms --- lib/default/TasmotaSerial-3.3.0/src/TasmotaSerial.cpp | 4 ++-- tasmota/xnrg_19_cse7761.ino | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/default/TasmotaSerial-3.3.0/src/TasmotaSerial.cpp b/lib/default/TasmotaSerial-3.3.0/src/TasmotaSerial.cpp index 8b21de109..07754719e 100644 --- a/lib/default/TasmotaSerial-3.3.0/src/TasmotaSerial.cpp +++ b/lib/default/TasmotaSerial-3.3.0/src/TasmotaSerial.cpp @@ -153,10 +153,10 @@ bool TasmotaSerial::begin(uint32_t speed, uint32_t config) { m_uart = tasmota_serial_index; tasmota_serial_index--; TSerial = new HardwareSerial(m_uart); - TSerial->begin(speed, config, m_rx_pin, m_tx_pin); - if (serial_buffer_size > 256) { + if (serial_buffer_size > 256) { // RX Buffer can't be resized when Serial is already running (HardwareSerial.cpp) TSerial->setRxBufferSize(serial_buffer_size); } + TSerial->begin(speed, config, m_rx_pin, m_tx_pin); // For low bit rate, below 9600, set the Full RX threshold at 10 bytes instead of the default 120 if (speed <= 9600) { // At 9600, 10 chars are ~10ms diff --git a/tasmota/xnrg_19_cse7761.ino b/tasmota/xnrg_19_cse7761.ino index c61322d30..ec6647a76 100644 --- a/tasmota/xnrg_19_cse7761.ino +++ b/tasmota/xnrg_19_cse7761.ino @@ -137,7 +137,7 @@ bool Cse7761ReadOnce(uint32_t log_level, uint32_t reg, uint32_t size, uint32_t* uint8_t buffer[8] = { 0 }; uint32_t rcvd = 0; - uint32_t timeout = millis() + 3; + uint32_t timeout = millis() + 6; while (!TimeReached(timeout) && (rcvd <= size)) { // while (!TimeReached(timeout)) { From f5b73bdf9c7fa1d05538b16875ad8cf3fe73aac0 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 12 Nov 2021 16:31:22 +0100 Subject: [PATCH 4/8] Fix ESP32-S2 compilation Fixed https://github.com/arendst/Tasmota/commit/568726be6f530147e0a679fdba19b70a9a40c06a --- tasmota/settings.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasmota/settings.h b/tasmota/settings.h index de77a0390..419313774 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -763,7 +763,10 @@ typedef struct { uint32_t cfg_crc32; // FFC } TSettings; +#ifndef CONFIG_IDF_TARGET_ESP32S2 +// For the ESP32-S2 the settings area has been made larger than 4096 by accident in order to support more GPIO's static_assert(sizeof(TSettings) == 4096, "TSettings Size is not correct"); +#endif typedef struct { uint16_t valid; // 280 (RTC memory offset 100 - sizeof(RTCRBT)) From c52f130afb4495f5f50f72ccd4162e62d85fd069 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Sat, 13 Nov 2021 20:37:10 +1000 Subject: [PATCH 5/8] apply IKEA tradfri quick to symfonisk too --- tasmota/xdrv_23_zigbee_5_converters.ino | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_23_zigbee_5_converters.ino b/tasmota/xdrv_23_zigbee_5_converters.ino index 494d26fb8..f2d3334eb 100644 --- a/tasmota/xdrv_23_zigbee_5_converters.ino +++ b/tasmota/xdrv_23_zigbee_5_converters.ino @@ -1311,8 +1311,9 @@ void ZCLFrame::computeSyntheticAttributes(Z_attribute_list& attr_list) { } break; case 0x00010021: // BatteryPercentage - if (modelId.startsWith(F("TRADFRI"))) { - attr.setUInt(attr.getUInt() * 2); // bug in TRADFRI battery, need to double the value + if (modelId.startsWith(F("TRADFRI")) || + modelId.startsWith(F("SYMFONISK"))) { + attr.setUInt(attr.getUInt() * 2); // bug in IKEA remotes battery, need to double the value } break; case 0x00060000: // "Power" for lumi Door/Window is converted to "Contact" From f19462f64bf6c910201cb96cf2a6d3aa4d0e2377 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 13 Nov 2021 12:44:45 +0100 Subject: [PATCH 6/8] Fix ESP32-S2 TSettings memory usage Fix ESP32-S2 TSettings memory usage fixed to 4096 bytes regression from v9.5.0.8 --- CHANGELOG.md | 3 +++ RELEASENOTES.md | 1 + tasmota/settings.h | 18 +++++++++--------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd72e5052..14efd97f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ All notable changes to this project will be documented in this file. ### Added - Support for HDC2010 temperature/humidity sensor by Luc Boudreau (#13633) +### Breaking Changed +- ESP32-S2 TSettings memory usage fixed to 4096 bytes regression from v9.5.0.8 + ### Changed - ESP32 core library from v1.0.7.5 to v2.0.1 diff --git a/RELEASENOTES.md b/RELEASENOTES.md index af4c13ba3..c0e1f5ff4 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -108,6 +108,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - Support for HDC2010 temperature/humidity sensor by Luc Boudreau [#13633](https://github.com/arendst/Tasmota/issues/13633) ### Breaking Changed +- ESP32-S2 TSettings memory usage fixed to 4096 bytes regression from v9.5.0.8 ### Changed - File editor no-wrap [#13427](https://github.com/arendst/Tasmota/issues/13427) diff --git a/tasmota/settings.h b/tasmota/settings.h index 419313774..0cde278e9 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -524,7 +524,7 @@ typedef struct { uint8_t ex_switchmode[8]; // 3A4 - Free since 9.2.0.6 - myio my_gp; // 3AC 2 x 18 bytes (ESP8266) / 2 x 40 bytes (ESP32) / 2 x 22 bytes (ESP32-C3) + myio my_gp; // 3AC 2x18 bytes (ESP8266) / 2x40 bytes (ESP32) / 2x22 bytes (ESP32-C3) / 2x47 bytes (ESP32-S2) #ifdef ESP8266 uint16_t gpio16_converted; // 3D0 uint8_t free_esp8266_3D2[42]; // 3D2 @@ -534,7 +534,7 @@ typedef struct { uint8_t free_esp32c3_3D8[36]; // 3D8 - Due to smaller myio #endif // CONFIG_IDF_TARGET_ESP32C3 #endif // ESP32 - mytmplt user_template; // 3FC 2 x 15 bytes (ESP8266) / 2 x 37 bytes (ESP32) / 2 x 23 bytes (ESP32-C3) + mytmplt user_template; // 3FC 2x15 bytes (ESP8266) / 2x37 bytes (ESP32) / 2x23 bytes (ESP32-C3) / 2x37 bytes (ESP32-S2) #ifdef ESP8266 uint8_t free_esp8266_41A[55]; // 41A #endif // ESP8266 @@ -546,6 +546,9 @@ typedef struct { uint8_t eth_clk_mode; // 447 uint8_t free_esp32_448[4]; // 448 +#ifdef CONFIG_IDF_TARGET_ESP32S2 + uint8_t free_esp32s2_456[2]; // 456 - fix 32-bit offset for WebCamCfg +#endif WebCamCfg webcam_config; // 44C uint8_t eth_address; // 450 @@ -563,9 +566,11 @@ typedef struct { myio8 ex_my_gp8; // 484 17 bytes (ESP8266) - Free since 9.0.0.1 #endif // ESP8266 #ifdef ESP32 - +#ifdef CONFIG_IDF_TARGET_ESP32S2 + uint8_t free_esp32s2_494[1]; // 494 - 2 bytes extra because of WebCamCfg 32-bit offset +#else uint8_t free_esp32_484[17]; // 484 - +#endif #endif // ESP32 uint8_t ex_my_adc0; // 495 Free since 9.0.0.1 @@ -634,9 +639,7 @@ typedef struct { mytmplt8285 ex_user_template8; // 72F 14 bytes (ESP8266) - Free since 9.0.0.1 #endif // ESP8266 #ifdef ESP32 - uint8_t free_esp32_72f[14]; // 72F - #endif // ESP32 uint8_t novasds_startingoffset; // 73D @@ -763,10 +766,7 @@ typedef struct { uint32_t cfg_crc32; // FFC } TSettings; -#ifndef CONFIG_IDF_TARGET_ESP32S2 -// For the ESP32-S2 the settings area has been made larger than 4096 by accident in order to support more GPIO's static_assert(sizeof(TSettings) == 4096, "TSettings Size is not correct"); -#endif typedef struct { uint16_t valid; // 280 (RTC memory offset 100 - sizeof(RTCRBT)) From 02346b4e49290f54713904a5c7c92da8d4bb3c26 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 13 Nov 2021 12:49:38 +0100 Subject: [PATCH 7/8] Update comments --- tasmota/tasmota_template.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 0de887e9c..4f9b41b4b 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -1076,11 +1076,11 @@ const char PINS_WEMOS[] PROGMEM = "IOTXIORXIOIOFLFLFLFLFLFLIOIOIOIOIOIOIOIOIOIOI typedef struct MYIO { uint16_t io[MAX_GPIO_PIN]; -} myio; // ESP8266: 18 * 2 = 36 bytes / ESP32: 40 * 2 = 80 bytes / ESP32-C3: 22 * 2 = 44 bytes +} myio; // ESP8266: 18*2 = 36 bytes / ESP32: 40*2 = 80 bytes / ESP32-C3: 22*2 = 44 bytes / ESP32-S2: 47*2 = 94 bytes typedef struct MYCFGIO { uint16_t io[MAX_USER_PINS]; -} mycfgio; // ESP8266: 14 * 2 = 28 bytes / ESP32: 36 * 2 = 72 bytes / ESP32-C3: 22 * 2 = 44 bytes +} mycfgio; // ESP8266: 14*2 = 28 bytes / ESP32: 36*2 = 72 bytes / ESP32-C3: 22*2 = 44 bytes / ESP32-S2: 36*2 = 72 bytes #define GPIO_FLAG_USED 0 // Currently no flags used @@ -1107,9 +1107,9 @@ typedef union { } gpio_flag; // 2 bytes typedef struct MYTMPLT { - mycfgio gp; // 28 / 72 / 44 bytes + mycfgio gp; // 28 / 72 / 44 / 72 bytes gpio_flag flag; // 2 bytes -} mytmplt; // 30 / 74 / 46 bytes +} mytmplt; // 30 / 74 / 46 / 74 bytes //******************************************************************************************** From 1e326460bde34fe432517a5dcaf4e05fe562a4da Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 13 Nov 2021 14:38:21 +0100 Subject: [PATCH 8/8] ESP8266 Gratuitous ARP enabled - ESP8266 Gratuitous ARP enabled and set to 60 seconds (#13623) - Version bump to 10.0.0.3 --- CHANGELOG.md | 6 +++++- RELEASENOTES.md | 7 ++++--- tasmota/my_user_config.h | 2 +- tasmota/settings.ino | 5 +++++ tasmota/tasmota_version.h | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14efd97f8..73594ea8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,11 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development -## [10.0.0.2] +## [10.0.0.3] +### Changed +- ESP8266 Gratuitous ARP enabled and set to 60 seconds (#13623) + +## [10.0.0.2] 20211113 ### Added - Support for HDC2010 temperature/humidity sensor by Luc Boudreau (#13633) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index c0e1f5ff4..858ab7ac7 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -100,7 +100,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo [Complete list](BUILDS.md) of available feature and sensors. -## Changelog v10.0.0.2 +## Changelog v10.0.0.3 ### Added - 1 second heartbeat GPIO - ESP32 Berry add module ``python_compat`` to be closer to Python syntax [#13428](https://github.com/arendst/Tasmota/issues/13428) @@ -111,9 +111,10 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - ESP32-S2 TSettings memory usage fixed to 4096 bytes regression from v9.5.0.8 ### Changed -- File editor no-wrap [#13427](https://github.com/arendst/Tasmota/issues/13427) - ESP32 core library from v1.0.7.4 to v2.0.1 -- ESP32-C3 core library from v2.0.0-post to v2.0.1-rc1 +- ESP32-C3 core library from v2.0.0-post to v2.0.1 +- File editor no-wrap [#13427](https://github.com/arendst/Tasmota/issues/13427) +- ESP8266 Gratuitous ARP enabled and set to 60 seconds [#13623](https://github.com/arendst/Tasmota/issues/13623) ### Fixed - Initial reset RTC memory based variables like EnergyToday and EnergyTotal diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 6f708f58b..432532e6e 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -79,7 +79,7 @@ #define WIFI_CONFIG_TOOL WIFI_RETRY // [WifiConfig] Default tool if Wi-Fi fails to connect (default option: 4 - WIFI_RETRY) // (WIFI_RESTART, WIFI_MANAGER, WIFI_RETRY, WIFI_WAIT, WIFI_SERIAL, WIFI_MANAGER_RESET_ONLY) // The configuration can be changed after first setup using WifiConfig 0, 2, 4, 5, 6 and 7. -#define WIFI_ARP_INTERVAL 0 // [SetOption41] Send gratuitous ARP interval +#define WIFI_ARP_INTERVAL 60 // [SetOption41] Send gratuitous ARP interval #define WIFI_SCAN_AT_RESTART false // [SetOption56] Scan Wi-Fi network at restart for configured AP's #define WIFI_SCAN_REGULARLY true // [SetOption57] Scan Wi-Fi network every 44 minutes for configured AP's diff --git a/tasmota/settings.ino b/tasmota/settings.ino index e64e0cec1..ec09129f4 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -1454,6 +1454,11 @@ void SettingsDelta(void) { memset(&Settings->energy_kWhtoday_ph, 0, 36); memset(&RtcSettings.energy_kWhtoday_ph, 0, 24); } + if (Settings->version < 0x0A000003) { + if (0 == Settings->param[P_ARP_GRATUITOUS]) { + Settings->param[P_ARP_GRATUITOUS] = WIFI_ARP_INTERVAL; + } + } Settings->version = VERSION; SettingsSave(1); diff --git a/tasmota/tasmota_version.h b/tasmota/tasmota_version.h index 5c33aeeaf..7e3e74d42 100644 --- a/tasmota/tasmota_version.h +++ b/tasmota/tasmota_version.h @@ -20,6 +20,6 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x0A000002; +const uint32_t VERSION = 0x0A000003; #endif // _TASMOTA_VERSION_H_