From f9c702f8ebe388a5aef890a8647efea1c6c94d41 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Wed, 25 Apr 2018 12:06:53 +0200 Subject: [PATCH 1/4] v5.12.0m - Add MQTT_TELE_RETAIN 5.12.0m * Add define MQTT_TELE_RETAIN compile option default set to 0 (#1071) --- platformio.ini | 361 ++++++++++++++++++++++++++++++--------- sonoff/_releasenotes.ino | 1 + sonoff/sonoff.ino | 4 +- sonoff/user_config.h | 3 + sonoff/xdrv_10_rules.ino | 2 + 5 files changed, 292 insertions(+), 79 deletions(-) diff --git a/platformio.ini b/platformio.ini index c74fe3c8d..39a9e974d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -33,13 +33,23 @@ src_dir = sonoff [env:sonoff] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -52,7 +62,7 @@ monitor_baud = 115200 ; *** Upload file to OTA server using SCP ;upload_port = user@host:/path -;extra_scripts = pio/sftp-uploader.py +;extra_scripts = pio/strip-floats.py, pio/sftp-uploader.py ; *** Upload file to OTA server using HTTP ;upload_port = domus1:80/api/upload-arduino.php @@ -60,14 +70,24 @@ monitor_baud = 115200 [env:sonoff-minimal] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DBE_MINIMAL -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DBE_MINIMAL -DUSE_CONFIG_OVERRIDE +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DBE_MINIMAL +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; Serial Monitor options @@ -75,13 +95,24 @@ monitor_baud = 115200 [env:sonoff-classic] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_CLASSIC -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_CLASSIC -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DUSE_CLASSIC +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; Serial Monitor options @@ -89,13 +120,24 @@ monitor_baud = 115200 [env:sonoff-knx] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_KNX_NO_EMULATION -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_KNX_NO_EMULATION -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DUSE_KNX_NO_EMULATION +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; Serial Monitor options @@ -103,13 +145,24 @@ monitor_baud = 115200 [env:sonoff-allsensors] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_ALL_SENSORS -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_ALL_SENSORS -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DUSE_ALL_SENSORS +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; Serial Monitor options @@ -117,13 +170,24 @@ monitor_baud = 115200 [env:sonoff-BG] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=bg-BG -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=bg-BG -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=bg-BG +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -131,13 +195,24 @@ monitor_baud = 115200 [env:sonoff-CN] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=zh-CN +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -145,13 +220,24 @@ monitor_baud = 115200 [env:sonoff-CZ] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=cs-CZ -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=cs-CZ -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=cs-CZ +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -159,13 +245,24 @@ monitor_baud = 115200 [env:sonoff-DE] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=de-DE -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=de-DE -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=de-DE +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -173,13 +270,24 @@ monitor_baud = 115200 [env:sonoff-ES] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=es-AR -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=es-AR -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=es-AR +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -187,13 +295,24 @@ monitor_baud = 115200 [env:sonoff-FR] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=fr-FR -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=fr-FR -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=fr-FR +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -201,13 +320,24 @@ monitor_baud = 115200 [env:sonoff-GR] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=el-GR -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=el-GR -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=el-GR +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -215,13 +345,24 @@ monitor_baud = 115200 [env:sonoff-HU] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=hu-HU -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=hu-HU -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=hu-HU +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -229,13 +370,24 @@ monitor_baud = 115200 [env:sonoff-IT] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=it-IT -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=it-IT -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=it-IT +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -243,13 +395,24 @@ monitor_baud = 115200 [env:sonoff-NL] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=nl-NL -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=nl-NL -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=nl-NL +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -257,13 +420,24 @@ monitor_baud = 115200 [env:sonoff-PL] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=pl-PL -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=pl-PL -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=pl-PL +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -271,13 +445,24 @@ monitor_baud = 115200 [env:sonoff-PT] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=pt-PT -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=pt-PT -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=pt-PT +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -285,13 +470,24 @@ monitor_baud = 115200 [env:sonoff-RU] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=ru-RU -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=ru-RU -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=ru-RU +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options @@ -299,13 +495,24 @@ monitor_baud = 115200 [env:sonoff-TW] ;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 +platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.7.0 ; v2.4.1 +;platform = espressif8266 framework = arduino board = esp01_1m board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-TW -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-TW -DUSE_CONFIG_OVERRIDE + +; *** Fix espressif8266@1.7.0 induced undesired all warnings +build_unflags = -Wall + +build_flags = + -Wl,-Tesp8266.flash.1m0.ld + -DVTABLES_IN_FLASH + -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + -DMY_LANGUAGE=zh-TW +; -DUSE_CONFIG_OVERRIDE + +; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes extra_scripts = pio/strip-floats.py ; *** Serial Monitor options diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 454f24137..c56d6fda0 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -3,6 +3,7 @@ * Remove sonoff-xxl * Add sonoff-classic, sonoff-allsensors and sonoff-knx * Add some coloring to important web buttons + * Add define MQTT_TELE_RETAIN compile option default set to 0 (#1071) * Add user selectable defines for Sunrise/set Dawn option (#2378) * Add random window to timers (#2447) * Add optional KNX IP Protocol Support (#2402) diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 4bb89b6e6..71a2a33d4 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -1459,10 +1459,10 @@ void PerformEverySecond() mqtt_data[0] = '\0'; MqttShowState(); - MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_STATE)); + MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_STATE), MQTT_TELE_RETAIN); mqtt_data[0] = '\0'; - if (MqttShowSensor()) MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_SENSOR), Settings.flag.mqtt_sensor_retain); + if (MqttShowSensor()) { MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_SENSOR), Settings.flag.mqtt_sensor_retain); } } } diff --git a/sonoff/user_config.h b/sonoff/user_config.h index 92dd23dda..6bfa6e1cd 100644 --- a/sonoff/user_config.h +++ b/sonoff/user_config.h @@ -191,6 +191,9 @@ // Alternative MQTT driver does not block network when MQTT server is unavailable. No TLS support //#define MQTT_LIBRARY_TYPE MQTT_ESPMQTTARDUINO // Use (patched) esp-mqtt-arduino library (+4k8 code, +4k mem) - non-TLS only +// -- MQTT ---------------------------------------- +#define MQTT_TELE_RETAIN 0 // Tele messages may send retain flag (0 = off, 1 = on) + // -- MQTT - Domoticz ----------------------------- #define USE_DOMOTICZ // Enable Domoticz (+6k code, +0.3k mem) #define DOMOTICZ_IN_TOPIC "domoticz/in" // Domoticz Input Topic diff --git a/sonoff/xdrv_10_rules.ino b/sonoff/xdrv_10_rules.ino index 2697f3d32..afe6baa18 100644 --- a/sonoff/xdrv_10_rules.ino +++ b/sonoff/xdrv_10_rules.ino @@ -63,7 +63,9 @@ #define MAX_RULE_TIMERS 8 +#ifndef ULONG_MAX #define ULONG_MAX 0xffffffffUL +#endif #define D_CMND_RULE "Rule" #define D_CMND_RULETIMER "RuleTimer" From 07a14fe8962e56e84d3da18fe68628c2bd78bffe Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Wed, 25 Apr 2018 14:42:54 +0200 Subject: [PATCH 2/4] Updated using common section --- platformio.ini | 627 ++++++++++++++++--------------------------------- 1 file changed, 206 insertions(+), 421 deletions(-) diff --git a/platformio.ini b/platformio.ini index 39a9e974d..e37162bf1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -31,11 +31,14 @@ src_dir = sonoff ;env_default = sonoff-RU ;env_default = sonoff-TW -[env:sonoff] +[common] ; ************************************************************ +; *** Esp8266 core for Arduino version ;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 +;platform = espressif8266@1.6.0 ; v2.4.0 ;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 +;platform = https://github.com/platformio/platform-espressif8266.git#feature/stage +platform = espressif8266 + framework = arduino board = esp01_1m board_flash_mode = dout @@ -56,464 +59,246 @@ extra_scripts = pio/strip-floats.py monitor_baud = 115200 ; *** Upload Serial reset method for Wemos and NodeMCU -;upload_port = COM5 ;upload_speed = 115200 -;upload_resetmethod = nodemcu +upload_speed = 512000 +upload_resetmethod = nodemcu +;upload_port = COM5 ; *** Upload file to OTA server using SCP ;upload_port = user@host:/path ;extra_scripts = pio/strip-floats.py, pio/sftp-uploader.py ; *** Upload file to OTA server using HTTP -;upload_port = domus1:80/api/upload-arduino.php -;extra_scripts = pio/strip-floats.py, pio/http-uploader.py +upload_port = domus1:80/api/upload-arduino.php +extra_scripts = pio/strip-floats.py, pio/http-uploader.py + +; ********************************************************************* + +[env:sonoff] +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_resetmethod = ${common.upload_resetmethod} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-minimal] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DBE_MINIMAL -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DBE_MINIMAL +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-classic] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DUSE_CLASSIC -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DUSE_CLASSIC +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-knx] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DUSE_KNX_NO_EMULATION -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DUSE_KNX_NO_EMULATION +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-allsensors] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DUSE_ALL_SENSORS -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DUSE_ALL_SENSORS +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-BG] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=bg-BG -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=bg-BG +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-CN] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=zh-CN -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=zh-CN +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-CZ] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=cs-CZ -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=cs-CZ +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-DE] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=de-DE -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=de-DE +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-ES] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=es-AR -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=es-AR +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-FR] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=fr-FR -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=fr-FR +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-GR] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=el-GR -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=el-GR +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-HU] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=hu-HU -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=hu-HU +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-IT] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=it-IT -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=it-IT +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-NL] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=nl-NL -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=nl-NL +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-PL] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=pl-PL -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=pl-PL +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-PT] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=pt-PT -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=pt-PT +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-RU] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=ru-RU -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=ru-RU +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} [env:sonoff-TW] -;platform = espressif8266@1.5.0 ; v2.3.0 -platform = espressif8266@1.6.0 ; v2.4.0 -;platform = espressif8266@1.7.0 ; v2.4.1 -;platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout - -; *** Fix espressif8266@1.7.0 induced undesired all warnings -build_unflags = -Wall - -build_flags = - -Wl,-Tesp8266.flash.1m0.ld - -DVTABLES_IN_FLASH - -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY - -DMY_LANGUAGE=zh-TW -; -DUSE_CONFIG_OVERRIDE - -; *** Fix Esp/Arduino core 2.4.x induced Tasmota unused floating point includes -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board} +board_flash_mode = ${common.board_flash_mode} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} -DMY_LANGUAGE=zh-TW +monitor_baud = ${common.monitor_baud} +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +extra_scripts = ${common.extra_scripts} From 00b08bc50912709f274bf2cea068b63ffa721019 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Wed, 25 Apr 2018 17:27:40 +0200 Subject: [PATCH 3/4] Add more timer user input checks --- sonoff/settings.h | 2 +- sonoff/webserver.ino | 4 +++ sonoff/xdrv_09_timers.ino | 70 ++++++++++++++++++++++++--------------- 3 files changed, 48 insertions(+), 28 deletions(-) diff --git a/sonoff/settings.h b/sonoff/settings.h index dec5ef2fe..313ca3c6f 100644 --- a/sonoff/settings.h +++ b/sonoff/settings.h @@ -98,7 +98,7 @@ typedef union { uint32_t days : 7; // bits 16 - 22 = week day mask uint32_t device : 4; // bits 23 - 26 = 16 devices uint32_t power : 2; // bits 27 - 28 = 4 power states - Off, On, Toggle, Blink or Rule - uint32_t mode : 2; // bits 29 - 30 = timer modes - Scheduler, Sunrise, Sunset + uint32_t mode : 2; // bits 29 - 30 = timer modes - 0 = Scheduler, 1 = Sunrise, 2 = Sunset uint32_t arm : 1; // bit 31 }; } Timer; diff --git a/sonoff/webserver.ino b/sonoff/webserver.ino index e7d9262be..f82fa2e6d 100644 --- a/sonoff/webserver.ino +++ b/sonoff/webserver.ino @@ -628,7 +628,11 @@ void HandleConfiguration() page += FPSTR(HTTP_HEAD_STYLE); page += FPSTR(HTTP_BTN_MENU_MODULE); #if defined(USE_TIMERS) && defined(USE_TIMERS_WEB) +#ifdef USE_RULES + page += FPSTR(HTTP_BTN_MENU_TIMER); +#else if (devices_present) { page += FPSTR(HTTP_BTN_MENU_TIMER); } +#endif // USE_RULES #endif // USE_TIMERS and USE_TIMERS_WEB page += FPSTR(HTTP_BTN_MENU_WIFI); if (Settings.flag.mqtt_enabled) { page += FPSTR(HTTP_BTN_MENU_MQTT); } diff --git a/sonoff/xdrv_09_timers.ino b/sonoff/xdrv_09_timers.ino index 26b23b258..981609b41 100644 --- a/sonoff/xdrv_09_timers.ino +++ b/sonoff/xdrv_09_timers.ino @@ -22,7 +22,7 @@ * Timers * * Arm a timer using one or all of the following JSON values: - * {"Arm":1,"Mode":0,"Time":"09:23","Days":"--TW--S","Repeat":1,"Output":1,"Action":1} + * {"Arm":1,"Mode":0,"Time":"09:23","Window":0,"Days":"--TW--S","Repeat":1,"Output":1,"Action":1} * * Arm 0 = Off, 1 = On * Mode 0 = Schedule, 1 = Sunrise, 2 = Sunset @@ -268,7 +268,7 @@ void TimerEverySecond() uint8_t days = 1 << (RtcTime.day_of_week -1); for (byte i = 0; i < MAX_TIMERS; i++) { - if (Settings.timer[i].device >= devices_present) Settings.timer[i].data = 0; // Reset timer due to change in devices present +// if (Settings.timer[i].device >= devices_present) Settings.timer[i].data = 0; // Reset timer due to change in devices present Timer xtimer = Settings.timer[i]; uint16_t set_time = xtimer.time; #ifdef USE_SUNRISE @@ -290,7 +290,7 @@ void TimerEverySecond() RulesProcess(); } else #endif // USE_RULES - ExecuteCommandPower(xtimer.device +1, xtimer.power); + if (devices_present) { ExecuteCommandPower(xtimer.device +1, xtimer.power); } } } } @@ -302,6 +302,7 @@ void TimerEverySecond() void PrepShowTimer(uint8_t index) { char days[8] = { 0 }; + char soutput[80]; Timer xtimer = Settings.timer[index -1]; @@ -309,16 +310,21 @@ void PrepShowTimer(uint8_t index) uint8_t mask = 1 << i; snprintf(days, sizeof(days), "%s%d", days, ((xtimer.days & mask) > 0)); } + + soutput[0] = '\0'; + if (devices_present) { + snprintf_P(soutput, sizeof(soutput), PSTR(",\"" D_JSON_TIMER_OUTPUT "\":%d"), xtimer.device +1); + } #ifdef USE_SUNRISE int16_t hour = xtimer.time / 60; if ((1 == xtimer.mode) || (2 == xtimer.mode)) { // Sunrise or Sunset if (hour > 11) { hour = (hour -12) * -1; } } - snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s\"" D_CMND_TIMER "%d\":{\"" D_JSON_TIMER_ARM "\":%d,\"" D_JSON_TIMER_MODE "\":%d,\"" D_JSON_TIMER_TIME "\":\"%02d:%02d\",\"" D_JSON_TIMER_WINDOW "\":%d,\"" D_JSON_TIMER_DAYS "\":\"%s\",\"" D_JSON_TIMER_REPEAT "\":%d,\"" D_JSON_TIMER_OUTPUT "\":%d,\"" D_JSON_TIMER_ACTION "\":%d}"), - mqtt_data, index, xtimer.arm, xtimer.mode, hour, xtimer.time % 60, xtimer.window, days, xtimer.repeat, xtimer.device +1, xtimer.power); + snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s\"" D_CMND_TIMER "%d\":{\"" D_JSON_TIMER_ARM "\":%d,\"" D_JSON_TIMER_MODE "\":%d,\"" D_JSON_TIMER_TIME "\":\"%02d:%02d\",\"" D_JSON_TIMER_WINDOW "\":%d,\"" D_JSON_TIMER_DAYS "\":\"%s\",\"" D_JSON_TIMER_REPEAT "\":%d%s,\"" D_JSON_TIMER_ACTION "\":%d}"), + mqtt_data, index, xtimer.arm, xtimer.mode, hour, xtimer.time % 60, xtimer.window, days, xtimer.repeat, soutput, xtimer.power); #else - snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s\"" D_CMND_TIMER "%d\":{\"" D_JSON_TIMER_ARM "\":%d,\"" D_JSON_TIMER_TIME "\":\"%02d:%02d\",\"" D_JSON_TIMER_WINDOW "\":%d,\"" D_JSON_TIMER_DAYS "\":\"%s\",\"" D_JSON_TIMER_REPEAT "\":%d,\"" D_JSON_TIMER_OUTPUT "\":%d,\"" D_JSON_TIMER_ACTION "\":%d}"), - mqtt_data, index, xtimer.arm, xtimer.time / 60, xtimer.time % 60, xtimer.window, days, xtimer.repeat, xtimer.device +1, xtimer.power); + snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s\"" D_CMND_TIMER "%d\":{\"" D_JSON_TIMER_ARM "\":%d,\"" D_JSON_TIMER_TIME "\":\"%02d:%02d\",\"" D_JSON_TIMER_WINDOW "\":%d,\"" D_JSON_TIMER_DAYS "\":\"%s\",\"" D_JSON_TIMER_REPEAT "\":%d%s,\"" D_JSON_TIMER_ACTION "\":%d}"), + mqtt_data, index, xtimer.arm, xtimer.time / 60, xtimer.time % 60, xtimer.window, days, xtimer.repeat, soutput, xtimer.power); #endif // USE_SUNRISE } @@ -345,7 +351,9 @@ boolean TimerCommand() Settings.timer[index -1].data = Settings.timer[XdrvMailbox.payload -1].data; // Copy timer } } else { +#ifndef USE_RULES if (devices_present) { +#endif StaticJsonBuffer<200> jsonBuffer; JsonObject& root = jsonBuffer.parseObject(dataBufUc); if (!root.success()) { @@ -408,18 +416,21 @@ boolean TimerCommand() } if (root[UpperCase_P(parm_uc, PSTR(D_JSON_TIMER_OUTPUT))].success()) { uint8_t device = ((uint8_t)root[parm_uc] -1) & 0x0F; - Settings.timer[index].device = (device < devices_present) ? device : devices_present -1; + Settings.timer[index].device = (device < devices_present) ? device : 0; } if (root[UpperCase_P(parm_uc, PSTR(D_JSON_TIMER_ACTION))].success()) { - Settings.timer[index].power = (uint8_t)root[parm_uc] & 0x03; + uint8_t action = ((uint8_t)root[parm_uc] -1) & 0x03; + Settings.timer[index].power = (devices_present) ? action : 3; // If no devices than only allow rules } index++; } +#ifndef USE_RULES } else { snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_TIMER "%d\":\"" D_JSON_TIMER_NO_DEVICE "\"}"), index); // No outputs defined so nothing to control error = 1; } +#endif } } if (!error) { @@ -527,8 +538,12 @@ const char HTTP_TIMER_SCRIPT[] PROGMEM = "m=qs('input[name=\"rd\"]:checked').value;" // Check mode "s|=(qs('input[name=\"rd\"]:checked').value<<29);" // Get mode #endif - "s|=(eb('p1').value<<27);" // Get power - "s|=(qs('#d1').selectedIndex<<23);" // Get device + "if(}1>0){" + "i=qs('#d1').selectedIndex;if(i>=0){s|=(i<<23);}" // Get output + "s|=(qs('#p1').selectedIndex<<27);" // Get action + "}else{" + "s|=3<<27;" // Get action (rule) + "}" "l=((qs('#ho').selectedIndex*60)+qs('#mi').selectedIndex)&0x7FF;" "if(m==0){s|=l;}" // Get time #ifdef USE_SUNRISE @@ -559,8 +574,10 @@ const char HTTP_TIMER_SCRIPT[] PROGMEM = #endif "q=(s>>11)&0xF;if(q<10){q='0'+q;}qs('#mw').value=q;" // Set window minutes "for(i=0;i<7;i++){p=(s>>(16+i))&1;eb('w'+i).checked=p;}" // Set weekdays - "p=(s>>23)&0xF;qs('#d1').value=p+1;" // Set device - "p=(s>>27)&3;eb('p1').value=p;" // Set power + "if(}1>0){" + "p=(s>>23)&0xF;qs('#d1').value=p+1;" // Set output + "p=(s>>27)&3;qs('#p1').selectedIndex=p;" // Set action + "}" "p=(s>>15)&1;eb('r0').checked=p;" // Set repeat "p=(s>>31)&1;eb('a0').checked=p;" // Set arm "}" @@ -569,13 +586,24 @@ const char HTTP_TIMER_SCRIPT[] PROGMEM = "pt=eb('t0').value.split(',').map(Number);" // Get parameters from hidden area to array "s='';for(i=0;i<" STR(MAX_TIMERS) ";i++){b='';if(0==i){b=\" id='dP'\";}s+=\"\"}" "eb('bt').innerHTML=s;" // Create tabs + "if(}1>0){" // Create Output and Action drop down boxes + "eb('oa').innerHTML=\"" D_TIMER_OUTPUT " " D_TIMER_ACTION " \";" + "o=qs('#p1');ce('" D_OFF "',o);ce('" D_ON "',o);ce('" D_TOGGLE "',o);" // Create offset direction select options +#ifdef USE_RULES + "ce('" D_RULE "',o);" +#else + "ce('" D_BLINK "',o);" +#endif + "}else{" + "eb('oa').innerHTML=\"" D_TIMER_ACTION " " D_RULE "\";" // No outputs but rule is allowed + "}" #ifdef USE_SUNRISE "o=qs('#dr');ce('+',o);ce('-',o);" // Create offset direction select options #endif "o=qs('#ho');for(i=0;i<=23;i++){ce((i<10)?('0'+i):i,o);}" // Create hours select options "o=qs('#mi');for(i=0;i<=59;i++){ce((i<10)?('0'+i):i,o);}" // Create minutes select options "o=qs('#mw');for(i=0;i<=15;i++){ce((i<10)?('0'+i):i,o);}" // Create window minutes select options - "o=qs('#d1');for(i=0;i<}1;i++){ce(i+1,o);}" // Create devices + "o=qs('#d1');for(i=0;i<}1;i++){ce(i+1,o);}" // Create outputs "var a='" D_DAY3LIST "';" "s='';for(i=0;i<7;i++){s+=\"\"+a.substring(i*3,(i*3)+3)+\"\"}" "eb('ds').innerHTML=s;" // Create weekdays @@ -592,19 +620,7 @@ const char HTTP_FORM_TIMER[] PROGMEM = "



" - "
" - "" D_TIMER_OUTPUT "  " - "" D_TIMER_ACTION " " - "

" + "

" "
" "" D_TIMER_ARM " " "" D_TIMER_REPEAT "" From be36218b846099fee336d03df30c5f3684fc3c42 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Wed, 25 Apr 2018 18:25:25 +0200 Subject: [PATCH 4/4] Possible 2.4.1 memory leak fix (#2544) --- sonoff/xdrv_00_mqtt.ino | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sonoff/xdrv_00_mqtt.ino b/sonoff/xdrv_00_mqtt.ino index 68b3c6a70..7d47f37b5 100644 --- a/sonoff/xdrv_00_mqtt.ino +++ b/sonoff/xdrv_00_mqtt.ino @@ -399,6 +399,11 @@ boolean MqttCheckTls() } AddLog_P(LOG_LEVEL_INFO, S_LOG_MQTT, PSTR(D_FINGERPRINT)); + +//#ifdef ARDUINO_ESP8266_RELEASE_2_4_1 + EspClient = WiFiClientSecure(); // Wifi Secure Client reconnect issue 4497 (https://github.com/esp8266/Arduino/issues/4497) +//#endif + if (!EspClient.connect(Settings.mqtt_host, Settings.mqtt_port)) { snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_MQTT D_TLS_CONNECT_FAILED_TO " %s:%d. " D_RETRY_IN " %d " D_UNIT_SECOND), Settings.mqtt_host, Settings.mqtt_port, mqtt_retry_counter); @@ -479,6 +484,14 @@ void MqttReconnect() mqtt_initial_connection_state = 1; } +//#ifdef ARDUINO_ESP8266_RELEASE_2_4_1 +#ifdef USE_MQTT_TLS + EspClient = WiFiClientSecure(); // Wifi Secure Client reconnect issue 4497 (https://github.com/esp8266/Arduino/issues/4497) +#else + EspClient = WiFiClient(); // Wifi Client reconnect issue 4497 (https://github.com/esp8266/Arduino/issues/4497) +#endif +//#endif + #if (MQTT_LIBRARY_TYPE == MQTT_PUBSUBCLIENT) MqttClient.setCallback(MqttDataHandler); MqttClient.setServer(Settings.mqtt_host, Settings.mqtt_port);