Merge pull request #78 from arendst/development

update
This commit is contained in:
Jason2866 2020-05-15 08:33:39 +02:00 committed by GitHub
commit 1d5cf38897
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 361 additions and 445 deletions

View File

@ -20,7 +20,7 @@ In addition to the [release webpage](https://github.com/arendst/Tasmota/releases
## Development
[![Dev Version](https://img.shields.io/badge/development%20version-v8.2.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Dev Version](https://img.shields.io/badge/development%20version-v8.3.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://thehackbox.org/tasmota/)
[![Tasmota CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22)
[![Tasmota ESP32 CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20ESP32%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22)

View File

@ -21,7 +21,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.6.3 + e64cb61** 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.1** due to reported security and stability issues on previous Core version. This will also support gzipped binaries.
Although it might still compile on previous Core versions all support will be removed in the near future.
@ -35,7 +35,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.6.3 + e64cb61**.
The following binary downloads have been compiled with ESP8266/Arduino library core version **2.7.1**.
- **tasmota.bin** = The Tasmota version with most drivers. **RECOMMENDED RELEASE BINARY**
- **tasmota-BG.bin** to **tasmota-TW.bin** = The Tasmota version in different languages.
@ -52,57 +52,6 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
## Changelog
### Version 8.2.0.6
### Version 8.3.0.1
- Breaking Change Device Groups multicast address and port (#8270)
- Change PWM implementation to Arduino #7231 removing support for Core versions before 2.6.3
- Change default PWM Frequency to 977 Hz from 880 Hz
- Change minimum PWM Frequency from 100 Hz to 40 Hz
- Change flash access removing support for any Core before 2.6.3
- Change HM-10 sensor type detection and add features (#7962)
- Change light scheme 2,3,4 cycle time speed from 24,48,72,... seconds to 4,6,12,24,36,48,... seconds (#8034)
- Change remove floating point libs from IRAM
- Change remove MQTT Info messages on restart for DeepSleep Wake (#8044)
- Change IRremoteESP8266 library updated to v2.7.6
- Change HAss discovery by Federico Leoni (#8370)
- Fix possible Relay toggle on (OTA) restart
- Fix PWM flickering during wifi connection (#8046)
- Fix Zigbee sending wrong Sat value with Hue emulation
- Fix Zigbee crash with Occupancy sensor (#8089)
- Add Zigbee command ``ZbRestore`` to restore device configuration dumped with ``ZbStatus 2``
- Add Zigbee command ``ZbUnbind``
- Add Zigbee command ``ZbBindState`` and ``manuf``attribute
- Add Zigbee command ``ZbConfig`` and configuration in Settings
- Add commands ``CounterDebounceLow`` and ``CounterDebounceHigh`` to control debouncing (#8021)
- Add commands ``NrfPage``, ``NrfIgnore``, ``NrfScan`` and ``NrfBeacon`` to NRF24 Bluetooth driver (#8075)
- Add commands ``GlobalTemp`` and ``GlobalHum`` to init sensor data (#8152)
- Add command ``SO`` as shortcut for command ``SetOption``
- Add command ``SetOption41 <x>`` to force sending gratuitous ARP every <x> seconds
- Add command ``SetOption73 1`` for button decoupling and send multi-press and hold MQTT messages by Federico Leoni (#8235)
- Add command ``SetOption90 1`` to disable non-json MQTT messages (#8044)
- Add command ``SetOption91 1`` to enable fading at startup / power on
- Add command ``SetOption92 1`` to set PWM Mode from regular PWM to ColorTemp control (Xiaomi Philips ...)
- Add command ``SetOption93 1`` to control caching of compressed rules
- Add command ``Sensor10 0/1/2`` to control BH1750 resolution - 0 = High (default), 1 = High2, 2 = Low (#8016)
- Add command ``Sensor10 31..254`` to control BH1750 measurement time which defaults to 69 (#8016)
- Add command ``Sensor18 0..32000`` to control PMS5003 sensor interval to extend lifetime by Gene Ruebsamen (#8128)
- Add command ``DevGroupName`` to specify up to four Device Group Names (#8087)
- Add command ``DevGroupSend`` to send an update to a Device Group (#8093)
- Add command ``Ping`` (#7176)
- Add command ``Palette`` to add the ability to specify a palette of colors (#8150)
- Add support for unreachable (unplugged) Zigbee devices in Philips Hue emulation and Alexa
- Add support for 64x48 SSD1306 OLED (#6740)
- Add support for Seven Segment display using HT16K33 (#8116)
- Add support for up to four MQTT GroupTopics (#8014)
- Add support for longer template names
- Add support for an iAQ sensor (#8107)
- Add support for AS3935 Lightning Sensor by device111 (#8130)
- Add console command history (#7483, #8015)
- Add quick wifi reconnect using saved AP parameters when ``SetOption56 0`` (#3189)
- Add more accuracy to GPS NTP server (#8088)
- Add support for analog anemometer by Matteo Albinola (#8283)
- Add support for OpenTherm by Yuriy Sannikov (#8373)
- Add support for Thermostat control by arijav (#8212)
- Add experimental basic support for Tasmota on ESP32 based on work by Jörg Schüler-Maroldt
- Add automatic compression of Rules to achieve ~60% compression by Stefan Hadinger
- Add rule trigger at root level like ``on loadavg<50 do power 2 endon`` after ``state`` command
- Fix default state of ``SetOption73 0`` for button decoupling and send multi-press and hold MQTT messages

View File

@ -6,10 +6,10 @@
menu.BoardModel=Model
menu.ESPModule=Module
menu.led=Builtin Led
menu.UploadTool=Upload Using
menu.led=Builtin Led
menu.baud=Upload Speed
menu.xtal=CPU Frequency
menu.CrystalFreq=Crystal Frequency
@ -635,6 +635,63 @@ esp8285.menu.eesz.1M.build.flash_ld=eagle.flash.1m.ld
esp8285.menu.eesz.1M.build.spiffs_pagesize=256
esp8285.menu.eesz.1M.upload.maximum_size=1023984
esp8285.menu.eesz.1M.build.rfcal_addr=0xFC000
esp8285.menu.eesz.2M64=2MB (FS:64KB OTA:~992KB)
esp8285.menu.eesz.2M64.build.flash_size=2M
esp8285.menu.eesz.2M64.build.flash_size_bytes=0x200000
esp8285.menu.eesz.2M64.build.flash_ld=eagle.flash.2m64.ld
esp8285.menu.eesz.2M64.build.spiffs_pagesize=256
esp8285.menu.eesz.2M64.upload.maximum_size=1044464
esp8285.menu.eesz.2M64.build.rfcal_addr=0x1FC000
esp8285.menu.eesz.2M64.build.spiffs_start=0x1F0000
esp8285.menu.eesz.2M64.build.spiffs_end=0x1FB000
esp8285.menu.eesz.2M64.build.spiffs_blocksize=4096
esp8285.menu.eesz.2M128=2MB (FS:128KB OTA:~960KB)
esp8285.menu.eesz.2M128.build.flash_size=2M
esp8285.menu.eesz.2M128.build.flash_size_bytes=0x200000
esp8285.menu.eesz.2M128.build.flash_ld=eagle.flash.2m128.ld
esp8285.menu.eesz.2M128.build.spiffs_pagesize=256
esp8285.menu.eesz.2M128.upload.maximum_size=1044464
esp8285.menu.eesz.2M128.build.rfcal_addr=0x1FC000
esp8285.menu.eesz.2M128.build.spiffs_start=0x1E0000
esp8285.menu.eesz.2M128.build.spiffs_end=0x1FB000
esp8285.menu.eesz.2M128.build.spiffs_blocksize=4096
esp8285.menu.eesz.2M256=2MB (FS:256KB OTA:~896KB)
esp8285.menu.eesz.2M256.build.flash_size=2M
esp8285.menu.eesz.2M256.build.flash_size_bytes=0x200000
esp8285.menu.eesz.2M256.build.flash_ld=eagle.flash.2m256.ld
esp8285.menu.eesz.2M256.build.spiffs_pagesize=256
esp8285.menu.eesz.2M256.upload.maximum_size=1044464
esp8285.menu.eesz.2M256.build.rfcal_addr=0x1FC000
esp8285.menu.eesz.2M256.build.spiffs_start=0x1C0000
esp8285.menu.eesz.2M256.build.spiffs_end=0x1FB000
esp8285.menu.eesz.2M256.build.spiffs_blocksize=4096
esp8285.menu.eesz.2M512=2MB (FS:512KB OTA:~768KB)
esp8285.menu.eesz.2M512.build.flash_size=2M
esp8285.menu.eesz.2M512.build.flash_size_bytes=0x200000
esp8285.menu.eesz.2M512.build.flash_ld=eagle.flash.2m512.ld
esp8285.menu.eesz.2M512.build.spiffs_pagesize=256
esp8285.menu.eesz.2M512.upload.maximum_size=1044464
esp8285.menu.eesz.2M512.build.rfcal_addr=0x1FC000
esp8285.menu.eesz.2M512.build.spiffs_start=0x180000
esp8285.menu.eesz.2M512.build.spiffs_end=0x1FA000
esp8285.menu.eesz.2M512.build.spiffs_blocksize=8192
esp8285.menu.eesz.2M1M=2MB (FS:1MB OTA:~512KB)
esp8285.menu.eesz.2M1M.build.flash_size=2M
esp8285.menu.eesz.2M1M.build.flash_size_bytes=0x200000
esp8285.menu.eesz.2M1M.build.flash_ld=eagle.flash.2m1m.ld
esp8285.menu.eesz.2M1M.build.spiffs_pagesize=256
esp8285.menu.eesz.2M1M.upload.maximum_size=1044464
esp8285.menu.eesz.2M1M.build.rfcal_addr=0x1FC000
esp8285.menu.eesz.2M1M.build.spiffs_start=0x100000
esp8285.menu.eesz.2M1M.build.spiffs_end=0x1FA000
esp8285.menu.eesz.2M1M.build.spiffs_blocksize=8192
esp8285.menu.eesz.2M=2MB (FS:none OTA:~1019KB)
esp8285.menu.eesz.2M.build.flash_size=2M
esp8285.menu.eesz.2M.build.flash_size_bytes=0x200000
esp8285.menu.eesz.2M.build.flash_ld=eagle.flash.2m.ld
esp8285.menu.eesz.2M.build.spiffs_pagesize=256
esp8285.menu.eesz.2M.upload.maximum_size=1044464
esp8285.menu.eesz.2M.build.rfcal_addr=0x1FC000
esp8285.menu.led.2=2
esp8285.menu.led.2.build.led=-DLED_BUILTIN=2
esp8285.menu.led.0=0
@ -4913,7 +4970,7 @@ espinotee.menu.baud.3000000.upload.speed=3000000
wifinfo.name=WifInfo
wifinfo.build.board=WIFINFO
wifinfo.build.variant=wifinfo
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K SPIFFS)
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K FS)
wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07
wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld
wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M
@ -4921,7 +4978,7 @@ wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096
wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000
wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000
wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M SPIFFS)
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M FS)
wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12
wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld
wifinfo.menu.ESPModule.ESP12.build.flash_size=4M
@ -6645,20 +6702,213 @@ espectro.menu.baud.921600.upload.speed=921600
espectro.menu.baud.3000000=3000000
espectro.menu.baud.3000000.upload.speed=3000000
##############################################################
eduinowifi.name=Schirmilabs Eduino WiFi
eduinowifi.build.board=ESP8266_SCHIRMILABS_EDUINO_WIFI
eduinowifi.build.variant=eduinowifi
eduinowifi.upload.tool=esptool
eduinowifi.upload.maximum_data_size=81920
eduinowifi.upload.wait_for_upload_port=true
eduinowifi.upload.erase_cmd=
eduinowifi.serial.disableDTR=true
eduinowifi.serial.disableRTS=true
eduinowifi.build.mcu=esp8266
eduinowifi.build.core=esp8266
eduinowifi.build.spiffs_pagesize=256
eduinowifi.build.debug_port=
eduinowifi.build.debug_level=
eduinowifi.menu.xtal.80=80 MHz
eduinowifi.menu.xtal.80.build.f_cpu=80000000L
eduinowifi.menu.xtal.160=160 MHz
eduinowifi.menu.xtal.160.build.f_cpu=160000000L
eduinowifi.menu.vt.flash=Flash
eduinowifi.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH
eduinowifi.menu.vt.heap=Heap
eduinowifi.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM
eduinowifi.menu.vt.iram=IRAM
eduinowifi.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM
eduinowifi.menu.exception.legacy=Legacy (new can return nullptr)
eduinowifi.menu.exception.legacy.build.exception_flags=-fno-exceptions
eduinowifi.menu.exception.legacy.build.stdcpp_lib=-lstdc++
eduinowifi.menu.exception.disabled=Disabled (new can abort)
eduinowifi.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT
eduinowifi.menu.exception.disabled.build.stdcpp_lib=-lstdc++
eduinowifi.menu.exception.enabled=Enabled
eduinowifi.menu.exception.enabled.build.exception_flags=-fexceptions
eduinowifi.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc
eduinowifi.menu.ssl.all=All SSL ciphers (most compatible)
eduinowifi.menu.ssl.all.build.sslflags=
eduinowifi.menu.ssl.basic=Basic SSL ciphers (lower ROM use)
eduinowifi.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC
eduinowifi.upload.resetmethod=--before default_reset --after hard_reset
eduinowifi.build.flash_mode=dio
eduinowifi.build.flash_flags=-DFLASHMODE_DIO
eduinowifi.build.flash_freq=40
eduinowifi.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB)
eduinowifi.menu.eesz.4M2M.build.flash_size=4M
eduinowifi.menu.eesz.4M2M.build.flash_size_bytes=0x400000
eduinowifi.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld
eduinowifi.menu.eesz.4M2M.build.spiffs_pagesize=256
eduinowifi.menu.eesz.4M2M.upload.maximum_size=1044464
eduinowifi.menu.eesz.4M2M.build.rfcal_addr=0x3FC000
eduinowifi.menu.eesz.4M2M.build.spiffs_start=0x200000
eduinowifi.menu.eesz.4M2M.build.spiffs_end=0x3FA000
eduinowifi.menu.eesz.4M2M.build.spiffs_blocksize=8192
eduinowifi.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB)
eduinowifi.menu.eesz.4M3M.build.flash_size=4M
eduinowifi.menu.eesz.4M3M.build.flash_size_bytes=0x400000
eduinowifi.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld
eduinowifi.menu.eesz.4M3M.build.spiffs_pagesize=256
eduinowifi.menu.eesz.4M3M.upload.maximum_size=1044464
eduinowifi.menu.eesz.4M3M.build.rfcal_addr=0x3FC000
eduinowifi.menu.eesz.4M3M.build.spiffs_start=0x100000
eduinowifi.menu.eesz.4M3M.build.spiffs_end=0x3FA000
eduinowifi.menu.eesz.4M3M.build.spiffs_blocksize=8192
eduinowifi.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB)
eduinowifi.menu.eesz.4M1M.build.flash_size=4M
eduinowifi.menu.eesz.4M1M.build.flash_size_bytes=0x400000
eduinowifi.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld
eduinowifi.menu.eesz.4M1M.build.spiffs_pagesize=256
eduinowifi.menu.eesz.4M1M.upload.maximum_size=1044464
eduinowifi.menu.eesz.4M1M.build.rfcal_addr=0x3FC000
eduinowifi.menu.eesz.4M1M.build.spiffs_start=0x300000
eduinowifi.menu.eesz.4M1M.build.spiffs_end=0x3FA000
eduinowifi.menu.eesz.4M1M.build.spiffs_blocksize=8192
eduinowifi.menu.eesz.4M=4MB (FS:none OTA:~1019KB)
eduinowifi.menu.eesz.4M.build.flash_size=4M
eduinowifi.menu.eesz.4M.build.flash_size_bytes=0x400000
eduinowifi.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld
eduinowifi.menu.eesz.4M.build.spiffs_pagesize=256
eduinowifi.menu.eesz.4M.upload.maximum_size=1044464
eduinowifi.menu.eesz.4M.build.rfcal_addr=0x3FC000
eduinowifi.menu.ip.lm2f=v2 Lower Memory
eduinowifi.menu.ip.lm2f.build.lwip_include=lwip2/include
eduinowifi.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat
eduinowifi.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0
eduinowifi.menu.ip.hb2f=v2 Higher Bandwidth
eduinowifi.menu.ip.hb2f.build.lwip_include=lwip2/include
eduinowifi.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat
eduinowifi.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0
eduinowifi.menu.ip.lm2n=v2 Lower Memory (no features)
eduinowifi.menu.ip.lm2n.build.lwip_include=lwip2/include
eduinowifi.menu.ip.lm2n.build.lwip_lib=-llwip2-536
eduinowifi.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0
eduinowifi.menu.ip.hb2n=v2 Higher Bandwidth (no features)
eduinowifi.menu.ip.hb2n.build.lwip_include=lwip2/include
eduinowifi.menu.ip.hb2n.build.lwip_lib=-llwip2-1460
eduinowifi.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0
eduinowifi.menu.ip.lm6f=v2 IPv6 Lower Memory
eduinowifi.menu.ip.lm6f.build.lwip_include=lwip2/include
eduinowifi.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat
eduinowifi.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1
eduinowifi.menu.ip.hb6f=v2 IPv6 Higher Bandwidth
eduinowifi.menu.ip.hb6f.build.lwip_include=lwip2/include
eduinowifi.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat
eduinowifi.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1
eduinowifi.menu.ip.hb1=v1.4 Higher Bandwidth
eduinowifi.menu.ip.hb1.build.lwip_lib=-llwip_gcc
eduinowifi.menu.ip.hb1.build.lwip_flags=-DLWIP_OPEN_SRC
eduinowifi.menu.ip.src=v1.4 Compile from source
eduinowifi.menu.ip.src.build.lwip_lib=-llwip_src
eduinowifi.menu.ip.src.build.lwip_flags=-DLWIP_OPEN_SRC
eduinowifi.menu.ip.src.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
eduinowifi.menu.dbg.Disabled=Disabled
eduinowifi.menu.dbg.Disabled.build.debug_port=
eduinowifi.menu.dbg.Serial=Serial
eduinowifi.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
eduinowifi.menu.dbg.Serial1=Serial1
eduinowifi.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
eduinowifi.menu.lvl.None____=None
eduinowifi.menu.lvl.None____.build.debug_level=
eduinowifi.menu.lvl.SSL=SSL
eduinowifi.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL
eduinowifi.menu.lvl.TLS_MEM=TLS_MEM
eduinowifi.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
eduinowifi.menu.lvl.HTTP_CLIENT=HTTP_CLIENT
eduinowifi.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
eduinowifi.menu.lvl.HTTP_SERVER=HTTP_SERVER
eduinowifi.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
eduinowifi.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM
eduinowifi.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
eduinowifi.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
eduinowifi.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
eduinowifi.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER
eduinowifi.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
eduinowifi.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
eduinowifi.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
eduinowifi.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
eduinowifi.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
eduinowifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
eduinowifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
eduinowifi.menu.lvl.CORE=CORE
eduinowifi.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE
eduinowifi.menu.lvl.WIFI=WIFI
eduinowifi.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
eduinowifi.menu.lvl.HTTP_UPDATE=HTTP_UPDATE
eduinowifi.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
eduinowifi.menu.lvl.UPDATER=UPDATER
eduinowifi.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
eduinowifi.menu.lvl.OTA=OTA
eduinowifi.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA
eduinowifi.menu.lvl.OOM=OOM
eduinowifi.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM
eduinowifi.menu.lvl.MDNS=MDNS
eduinowifi.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS
eduinowifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS
eduinowifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS
eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS
eduinowifi.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG
eduinowifi.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
eduinowifi.menu.wipe.none=Only Sketch
eduinowifi.menu.wipe.none.upload.erase_cmd=
eduinowifi.menu.wipe.sdk=Sketch + WiFi Settings
eduinowifi.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000
eduinowifi.menu.wipe.all=All Flash Contents
eduinowifi.menu.wipe.all.upload.erase_cmd=erase_flash
eduinowifi.menu.baud.512000.windows=512000
eduinowifi.menu.baud.512000.upload.speed=512000
eduinowifi.menu.baud.57600=57600
eduinowifi.menu.baud.57600.upload.speed=57600
eduinowifi.menu.baud.115200=115200
eduinowifi.menu.baud.115200.upload.speed=115200
eduinowifi.menu.baud.230400.linux=230400
eduinowifi.menu.baud.230400.macosx=230400
eduinowifi.menu.baud.230400.upload.speed=230400
eduinowifi.menu.baud.256000.windows=256000
eduinowifi.menu.baud.256000.upload.speed=256000
eduinowifi.menu.baud.460800.linux=460800
eduinowifi.menu.baud.460800.macosx=460800
eduinowifi.menu.baud.460800.upload.speed=460800
eduinowifi.menu.baud.921600=921600
eduinowifi.menu.baud.921600.upload.speed=921600
eduinowifi.menu.baud.3000000=3000000
eduinowifi.menu.baud.3000000.upload.speed=3000000
##############################################################
sonoff.name=ITEAD Sonoff
sonoff.build.board=SONOFF_SV
sonoff.build.board=ESP8266_SONOFF_SV
sonoff.build.extra_flags=-DESP8266
sonoff.build.flash_size=1M
sonoff.build.variant=itead
sonoff.menu.BoardModel.sonoffBasic=ITEAD Sonoff Basic
sonoff.menu.BoardModel.sonoffBasic.build.board=SONOFF_BASIC
sonoff.menu.BoardModel.sonoffBasic.build.board=ESP8266_SONOFF_BASIC
sonoff.menu.BoardModel.sonoffS20=ITEAD Sonoff S20
sonoff.menu.BoardModel.sonoffS20.build.board=SONOFF_S20
sonoff.menu.BoardModel.sonoffS20.build.board=ESP8266_SONOFF_S20
sonoff.menu.BoardModel.sonoffSV=ITEAD Sonoff SV
sonoff.menu.BoardModel.sonoffSV.build.board=SONOFF_SV
sonoff.menu.BoardModel.sonoffSV.build.board=ESP8266_SONOFF_SV
sonoff.menu.BoardModel.sonoffTH=ITEAD Sonoff TH
sonoff.menu.BoardModel.sonoffTH.build.board=SONOFF_TH
sonoff.menu.BoardModel.sonoffTH.build.board=ESP8266_SONOFF_TH
sonoff.upload.tool=esptool
sonoff.upload.maximum_data_size=81920
sonoff.upload.wait_for_upload_port=true

View File

@ -5,8 +5,8 @@
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
name=ESP8266 Boards (2.6.3)
version=2.6.3
name=ESP8266 Boards (2.7.1)
version=2.7.1
# These will be removed by the packager script when doing a JSON release
@ -37,7 +37,7 @@ build.exception_flags=-fno-exceptions
build.stdcpp_lib=-lstdc++
build.stdcpp_level=-std=gnu++11
#build.float=-u _printf_float -u _scanf_float
# build.float=-u _printf_float -u _scanf_float
build.float=
build.led=

View File

@ -1,5 +1,15 @@
## Unreleased (development)
### 8.3.0.1 20200514
- Fix default state of ``SetOption73 0`` for button decoupling and send multi-press and hold MQTT messages
## Released
### 8.3.0 20200514
- Release Fred
### 8.2.0.6 20200501
- Add experimental basic support for Tasmota on ESP32 based on work by Jörg Schüler-Maroldt

View File

@ -1391,6 +1391,7 @@ void SettingsDelta(void)
#endif // ESP8266
if (Settings.version < 0x08020004) {
Settings.flag3.mqtt_buttons = 0; // SetOption73 (0) - Decouple button from relay and send just mqtt topic
#ifdef ESP8266
Settings.config_version = 0; // ESP8266 (Has been 0 for long time)
#endif // ESP8266

View File

@ -1,7 +1,7 @@
/*
support_button.ino - button support for Tasmota
Copyright (C) 2020 Theo Arends
Copyright (C) 2020 Federico Leoni and Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -17,16 +17,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//#define BUTTON_V1
#ifdef BUTTON_V1
#define BUTTON_V2
#ifdef BUTTON_V2
/*********************************************************************************************\
* Button support
\*********************************************************************************************/
#define MAX_BUTTON_COMMANDS 5 // Max number of button commands supported
#define MAX_RELAY_BUTTON1 5 // Max number of relay controlled by BUTTON1
const char kCommands[] PROGMEM =
D_CMND_WIFICONFIG " 2|" D_CMND_WIFICONFIG " 2|" D_CMND_WIFICONFIG " 2|" D_CMND_RESTART " 1|" D_CMND_UPGRADE " 1";
const char kMultiPress[] PROGMEM =
"|SINGLE|DOUBLE|TRIPLE|QUAD|PENTA|";
struct BUTTON {
unsigned long debounce = 0; // Button debounce timer
@ -99,11 +99,10 @@ uint8_t ButtonSerial(uint8_t serial_in_byte)
* Button handler with single press only or multi-press and hold on all buttons
*
* ButtonDebounce (50) - Debounce time in mSec
* SetOption1 (0) - If set do not execute config commands
* SetOption11 (0) - If set perform single press action on double press and reverse
* SetOption1 (0) - If set do not execute commands WifiConfig and Reset
* SetOption11 (0) - If set perform single press action on double press and reverse (on two relay devices only)
* SetOption13 (0) - If set act on single press only
* SetOption32 (40) - Max button hold time in Seconds
* SetOption40 (0) - Number of 0.1 seconds until hold is discarded if SetOption1 1 and SetOption13 0
* SetOption73 (0) - Decouple button from relay and send just mqtt topic
\*********************************************************************************************/
void ButtonHandler(void)
@ -114,8 +113,6 @@ void ButtonHandler(void)
uint16_t loops_per_second = 1000 / Settings.button_debounce; // ButtonDebounce (50)
char scmnd[20];
// uint8_t maxdev = (devices_present > MAX_KEYS) ? MAX_KEYS : devices_present;
// for (uint32_t button_index = 0; button_index < maxdev; button_index++) {
for (uint32_t button_index = 0; button_index < MAX_KEYS; button_index++) {
uint8_t button = NOT_PRESSED;
uint8_t button_present = 0;
@ -172,19 +169,28 @@ void ButtonHandler(void)
if (!Button.hold_timer[button_index]) { button_pressed = true; } // Do not allow within 1 second
}
if (button_pressed) {
if (!Settings.flag3.mqtt_buttons) {
if (!SendKey(KEY_BUTTON, button_index +1, POWER_TOGGLE)) { // Execute Toggle command via MQTT if ButtonTopic is set
ExecuteCommandPower(button_index +1, POWER_TOGGLE, SRC_BUTTON); // Execute Toggle command internally
}
} else {
MqttButtonTopic(button_index +1, 1, 0); // SetOption73 (0) - Decouple button from relay and send just mqtt topic
}
}
}
#endif // ESP8266
else {
if ((PRESSED == button) && (NOT_PRESSED == Button.last_state[button_index])) {
if (Settings.flag.button_single) { // SetOption13 (0) - Allow only single button press for immediate action
if (Settings.flag.button_single) { // SetOption13 (0) - Allow only single button press for immediate action,
if (!Settings.flag3.mqtt_buttons) { // SetOption73 (0) - Decouple button from relay and send just mqtt topic
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_BUTTON "%d " D_IMMEDIATE), button_index +1);
if (!SendKey(KEY_BUTTON, button_index +1, POWER_TOGGLE)) { // Execute Toggle command via MQTT if ButtonTopic is set
ExecuteCommandPower(button_index +1, POWER_TOGGLE, SRC_BUTTON); // Execute Toggle command internally
}
} else {
MqttButtonTopic(button_index +1, 1, 0); // SetOption73 1 - Decouple button from relay and send just mqtt topic
}
} else {
Button.press_counter[button_index] = (Button.window_timer[button_index]) ? Button.press_counter[button_index] +1 : 1;
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_BUTTON "%d " D_MULTI_PRESS " %d"), button_index +1, Button.press_counter[button_index]);
@ -199,25 +205,20 @@ void ButtonHandler(void)
Button.hold_timer[button_index]++;
if (Settings.flag.button_single) { // SetOption13 (0) - Allow only single button press for immediate action
if (Button.hold_timer[button_index] == loops_per_second * hold_time_extent * Settings.param[P_HOLD_TIME] / 10) { // SetOption32 (40) - Button held for factor times longer
// Settings.flag.button_single = 0;
snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_SETOPTION "13 0")); // Disable single press only
ExecuteCommand(scmnd, SRC_BUTTON);
}
} else {
if (Settings.flag.button_restrict) { // SetOption1 (0) - Button restriction
if (Settings.param[P_HOLD_IGNORE] > 0) { // SetOption40 (0) - Do not ignore button hold
if (Button.hold_timer[button_index] > loops_per_second * Settings.param[P_HOLD_IGNORE] / 10) {
Button.hold_timer[button_index] = 0; // Reset button hold counter to stay below hold trigger
Button.press_counter[button_index] = 0; // Discard button press to disable functionality
DEBUG_CORE_LOG(PSTR("BTN: " D_BUTTON "%d cancel by " D_CMND_SETOPTION "40 %d"), button_index +1, Settings.param[P_HOLD_IGNORE]);
}
}
if (Button.hold_timer[button_index] == loops_per_second * Settings.param[P_HOLD_TIME] / 10) { // SetOption32 (40) - Button hold
Button.press_counter[button_index] = 0;
if (Settings.flag3.mqtt_buttons) { // SetOption73 (0) - Decouple button from relay and send just mqtt topic
MqttButtonTopic(button_index +1, 3, 1);
} else {
SendKey(KEY_BUTTON, button_index +1, POWER_HOLD); // Execute Hold command via MQTT if ButtonTopic is set
}
} else {
if (Button.hold_timer[button_index] == loops_per_second * hold_time_extent * Settings.param[P_HOLD_TIME] / 10) { // SetOption32 (40) - Button held for factor times longer
if (!Settings.flag.button_restrict) {
if ((Button.hold_timer[button_index] == loops_per_second * hold_time_extent * Settings.param[P_HOLD_TIME] / 10)) { // SetOption32 (40) - Button held for factor times longer
Button.press_counter[button_index] = 0;
snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_RESET " 1"));
ExecuteCommand(scmnd, SRC_BUTTON);
@ -225,12 +226,14 @@ void ButtonHandler(void)
}
}
}
}
if (!Settings.flag.button_single) { // SetOption13 (0) - Allow multi-press
if (Button.window_timer[button_index]) {
Button.window_timer[button_index]--;
} else {
if (!restart_flag && !Button.hold_timer[button_index] && (Button.press_counter[button_index] > 0) && (Button.press_counter[button_index] < MAX_BUTTON_COMMANDS +3)) {
if (!restart_flag && !Button.hold_timer[button_index] && (Button.press_counter[button_index] > 0) && (Button.press_counter[button_index] < 7)) {
bool single_press = false;
if (Button.press_counter[button_index] < 3) { // Single or Double press
#ifdef ESP8266
@ -244,29 +247,44 @@ void ButtonHandler(void)
if (Settings.flag.button_swap) { // SetOption11 (0)
Button.press_counter[button_index] = (single_press) ? 1 : 2;
}
} else {
Button.press_counter[button_index] = 1;
}
}
}
#if defined(USE_LIGHT) && defined(ROTARY_V1)
if (!((0 == button_index) && RotaryButtonPressed())) {
#endif
if (single_press && SendKey(KEY_BUTTON, button_index + Button.press_counter[button_index], POWER_TOGGLE)) { // Execute Toggle command via MQTT if ButtonTopic is set
if (!Settings.flag3.mqtt_buttons && single_press && SendKey(KEY_BUTTON, button_index + Button.press_counter[button_index], POWER_TOGGLE)) { // Execute Toggle command via MQTT if ButtonTopic is set
// Success
} else {
if (Button.press_counter[button_index] < 3) { // Single or Double press
if (Button.press_counter[button_index] < 6) { // Single to Penta press
if (WifiState() > WIFI_RESTART) { // Wifimanager active
restart_flag = 1;
} else {
ExecuteCommandPower(button_index + Button.press_counter[button_index], POWER_TOGGLE, SRC_BUTTON); // Execute Toggle command internally
}
} else { // 3 - 7 press
if (!Settings.flag.button_restrict) { // SetOption1 (0)
GetTextIndexed(scmnd, sizeof(scmnd), Button.press_counter[button_index] -3, kCommands);
if (!Settings.flag3.mqtt_buttons) {
if (Button.press_counter[button_index] == 1) { // By default first press always send a TOGGLE (2)
ExecuteCommandPower(button_index + Button.press_counter[button_index], POWER_TOGGLE, SRC_BUTTON);
} else {
SendKey(KEY_BUTTON, button_index +1, Button.press_counter[button_index] +9); // 2,3,4 and 5 press send just the key value (11,12,13 and 14) for rules
if (0 == button_index) { // BUTTON1 can toggle up to 5 relays if present. If a relay is not present will send out the key value (2,11,12,13 and 14) for rules
if ((Button.press_counter[button_index] > 1 && PinUsed(GPIO_REL1, Button.press_counter[button_index]-1)) && Button.press_counter[button_index] <= MAX_RELAY_BUTTON1) {
ExecuteCommandPower(button_index + Button.press_counter[button_index], POWER_TOGGLE, SRC_BUTTON); // Execute Toggle command internally
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("DBG: Relay%d found on GPIO%d"), Button.press_counter[button_index], Pin(GPIO_REL1, Button.press_counter[button_index]-1));
}
}
}
}
} else { // 6 press start wificonfig 2
if (!Settings.flag.button_restrict) {
snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_WIFICONFIG " 2"));
ExecuteCommand(scmnd, SRC_BUTTON);
}
}
if (Settings.flag3.mqtt_buttons) { // SetOption73 (0) - Decouple button from relay and send just mqtt topic
if (Button.press_counter[button_index] >= 1 && Button.press_counter[button_index] <= 5) {
MqttButtonTopic(button_index +1, Button.press_counter[button_index], 0);
}
}
}
#if defined(USE_LIGHT) && defined(ROTARY_V1)
}
@ -275,12 +293,30 @@ void ButtonHandler(void)
}
}
}
}
}
Button.last_state[button_index] = button;
}
}
void MqttButtonTopic(uint8_t button_id, uint8_t action, uint8_t hold)
{
char scommand[CMDSZ];
char stopic[TOPSZ];
char mqttstate[7];
SendKey(KEY_BUTTON, button_id, (hold) ? 3 : action +9);
if (!Settings.flag.hass_discovery) {
GetTextIndexed(mqttstate, sizeof(mqttstate), action, kMultiPress);
snprintf_P(scommand, sizeof(scommand), PSTR("BUTTON%d"), button_id);
GetTopic_P(stopic, STAT, mqtt_topic, scommand);
Response_P(S_JSON_COMMAND_SVALUE, "ACTION", (hold) ? SettingsText(SET_STATE_TXT4) : mqttstate);
MqttPublish(stopic);
}
}
void ButtonLoop(void)
{
if (Button.present) {
@ -291,4 +327,4 @@ void ButtonLoop(void)
}
}
#endif // BUTTON_V1
#endif // BUTTON_V2

View File

@ -1,330 +0,0 @@
/*
support_button_v2.ino - button support for Tasmota
Copyright (C) 2020 Federico Leoni and Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define BUTTON_V2
#ifdef BUTTON_V2
/*********************************************************************************************\
* Button support
\*********************************************************************************************/
#define MAX_RELAY_BUTTON1 5 // Max number of relay controlled by BUTTON1
const char kMultiPress[] PROGMEM =
"|SINGLE|DOUBLE|TRIPLE|QUAD|PENTA|";
struct BUTTON {
unsigned long debounce = 0; // Button debounce timer
uint16_t hold_timer[MAX_KEYS] = { 0 }; // Timer for button hold
uint16_t dual_code = 0; // Sonoff dual received code
uint8_t last_state[MAX_KEYS] = { NOT_PRESSED, NOT_PRESSED, NOT_PRESSED, NOT_PRESSED }; // Last button states
uint8_t window_timer[MAX_KEYS] = { 0 }; // Max time between button presses to record press count
uint8_t press_counter[MAX_KEYS] = { 0 }; // Number of button presses within Button.window_timer
uint8_t dual_receive_count = 0; // Sonoff dual input flag
uint8_t no_pullup_mask = 0; // key no pullup flag (1 = no pullup)
uint8_t inverted_mask = 0; // Key inverted flag (1 = inverted)
uint8_t present = 0; // Number of buttons found flag
uint8_t adc = 99; // ADC0 button number
} Button;
/********************************************************************************************/
void ButtonPullupFlag(uint8 button_bit)
{
bitSet(Button.no_pullup_mask, button_bit);
}
void ButtonInvertFlag(uint8 button_bit)
{
bitSet(Button.inverted_mask, button_bit);
}
void ButtonInit(void)
{
Button.present = 0;
for (uint32_t i = 0; i < MAX_KEYS; i++) {
if (PinUsed(GPIO_KEY1, i)) {
Button.present++;
pinMode(Pin(GPIO_KEY1, i), bitRead(Button.no_pullup_mask, i) ? INPUT : ((16 == Pin(GPIO_KEY1, i)) ? INPUT_PULLDOWN_16 : INPUT_PULLUP));
}
#ifndef USE_ADC_VCC
else if ((99 == Button.adc) && ((ADC0_BUTTON == my_adc0) || (ADC0_BUTTON_INV == my_adc0))) {
Button.present++;
Button.adc = i;
}
#endif // USE_ADC_VCC
}
}
uint8_t ButtonSerial(uint8_t serial_in_byte)
{
if (Button.dual_receive_count) {
Button.dual_receive_count--;
if (Button.dual_receive_count) {
Button.dual_code = (Button.dual_code << 8) | serial_in_byte;
serial_in_byte = 0;
} else {
if (serial_in_byte != 0xA1) {
Button.dual_code = 0; // 0xA1 - End of Sonoff dual button code
}
}
}
if (0xA0 == serial_in_byte) { // 0xA0 - Start of Sonoff dual button code
serial_in_byte = 0;
Button.dual_code = 0;
Button.dual_receive_count = 3;
}
return serial_in_byte;
}
/*********************************************************************************************\
* Button handler with single press only or multi-press and hold on all buttons
*
* ButtonDebounce (50) - Debounce time in mSec
* SetOption1 (0) - If set do not execute commands WifiConfig and Reset
* SetOption11 (0) - If set perform single press action on double press and reverse (on two relay devices only)
* SetOption13 (0) - If set act on single press only
* SetOption73 (0) - Decouple button from relay and send just mqtt topic
\*********************************************************************************************/
void ButtonHandler(void)
{
if (uptime < 4) { return; } // Block GPIO for 4 seconds after poweron to workaround Wemos D1 / Obi RTS circuit
uint8_t hold_time_extent = IMMINENT_RESET_FACTOR; // Extent hold time factor in case of iminnent Reset command
uint16_t loops_per_second = 1000 / Settings.button_debounce; // ButtonDebounce (50)
char scmnd[20];
for (uint32_t button_index = 0; button_index < MAX_KEYS; button_index++) {
uint8_t button = NOT_PRESSED;
uint8_t button_present = 0;
#ifdef ESP8266
if (!button_index && ((SONOFF_DUAL == my_module_type) || (CH4 == my_module_type))) {
button_present = 1;
if (Button.dual_code) {
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_BUTTON " " D_CODE " %04X"), Button.dual_code);
button = PRESSED;
if (0xF500 == Button.dual_code) { // Button hold
Button.hold_timer[button_index] = (loops_per_second * Settings.param[P_HOLD_TIME] / 10) -1; // SetOption32 (40)
hold_time_extent = 1;
}
Button.dual_code = 0;
}
}
else
#endif // ESP8266
if (PinUsed(GPIO_KEY1, button_index)) {
button_present = 1;
button = (digitalRead(Pin(GPIO_KEY1, button_index)) != bitRead(Button.inverted_mask, button_index));
}
#ifndef USE_ADC_VCC
if (Button.adc == button_index) {
button_present = 1;
if (ADC0_BUTTON_INV == my_adc0) {
button = (AdcRead(1) < 128);
}
else if (ADC0_BUTTON == my_adc0) {
button = (AdcRead(1) > 128);
}
}
#endif // USE_ADC_VCC
if (button_present) {
XdrvMailbox.index = button_index;
XdrvMailbox.payload = button;
if (XdrvCall(FUNC_BUTTON_PRESSED)) {
// Serviced
}
#ifdef ESP8266
else if (SONOFF_4CHPRO == my_module_type) {
if (Button.hold_timer[button_index]) { Button.hold_timer[button_index]--; }
bool button_pressed = false;
if ((PRESSED == button) && (NOT_PRESSED == Button.last_state[button_index])) {
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_BUTTON "%d " D_LEVEL_10), button_index +1);
Button.hold_timer[button_index] = loops_per_second;
button_pressed = true;
}
if ((NOT_PRESSED == button) && (PRESSED == Button.last_state[button_index])) {
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_BUTTON "%d " D_LEVEL_01), button_index +1);
if (!Button.hold_timer[button_index]) { button_pressed = true; } // Do not allow within 1 second
}
if (button_pressed) {
if (!Settings.flag3.mqtt_buttons) {
if (!SendKey(KEY_BUTTON, button_index +1, POWER_TOGGLE)) { // Execute Toggle command via MQTT if ButtonTopic is set
ExecuteCommandPower(button_index +1, POWER_TOGGLE, SRC_BUTTON); // Execute Toggle command internally
}
} else {
MqttButtonTopic(button_index +1, 1, 0); // SetOption73 (0) - Decouple button from relay and send just mqtt topic
}
}
}
#endif // ESP8266
else {
if ((PRESSED == button) && (NOT_PRESSED == Button.last_state[button_index])) {
if (Settings.flag.button_single) { // SetOption13 (0) - Allow only single button press for immediate action, SetOption73 (0) - Decouple button from relay and send just mqtt topic
if (!Settings.flag3.mqtt_buttons) {
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_BUTTON "%d " D_IMMEDIATE), button_index +1);
if (!SendKey(KEY_BUTTON, button_index +1, POWER_TOGGLE)) { // Execute Toggle command via MQTT if ButtonTopic is set
ExecuteCommandPower(button_index +1, POWER_TOGGLE, SRC_BUTTON); // Execute Toggle command internally
}
} else {
MqttButtonTopic(button_index +1, 1, 0); // SetOption73 (0) - Decouple button from relay and send just mqtt topic
}
} else {
Button.press_counter[button_index] = (Button.window_timer[button_index]) ? Button.press_counter[button_index] +1 : 1;
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_BUTTON "%d " D_MULTI_PRESS " %d"), button_index +1, Button.press_counter[button_index]);
Button.window_timer[button_index] = loops_per_second / 2; // 0.5 second multi press window
}
blinks = 201;
}
if (NOT_PRESSED == button) {
Button.hold_timer[button_index] = 0;
} else {
Button.hold_timer[button_index]++;
if (Settings.flag.button_single) { // SetOption13 (0) - Allow only single button press for immediate action
if (Button.hold_timer[button_index] == loops_per_second * hold_time_extent * Settings.param[P_HOLD_TIME] / 10) { // SetOption32 (40) - Button held for factor times longer
snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_SETOPTION "13 0")); // Disable single press only
ExecuteCommand(scmnd, SRC_BUTTON);
}
} else {
if (Button.hold_timer[button_index] == loops_per_second * Settings.param[P_HOLD_TIME] / 10) { // SetOption32 (40) - Button hold
Button.press_counter[button_index] = 0;
if (Settings.flag3.mqtt_buttons) { // SetOption73 (0) - Decouple button from relay and send just mqtt topic
MqttButtonTopic(button_index +1, 3, 1);
} else {
SendKey(KEY_BUTTON, button_index +1, POWER_HOLD); // Execute Hold command via MQTT if ButtonTopic is set
}
} else {
if (!Settings.flag.button_restrict) {
if ((Button.hold_timer[button_index] == loops_per_second * hold_time_extent * Settings.param[P_HOLD_TIME] / 10)) { // SetOption32 (40) - Button held for factor times longer
Button.press_counter[button_index] = 0;
snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_RESET " 1"));
ExecuteCommand(scmnd, SRC_BUTTON);
}
}
}
}
}
if (!Settings.flag.button_single) { // SetOption13 (0) - Allow multi-press
if (Button.window_timer[button_index]) {
Button.window_timer[button_index]--;
} else {
if (!restart_flag && !Button.hold_timer[button_index] && (Button.press_counter[button_index] > 0) && (Button.press_counter[button_index] < 7)) {
bool single_press = false;
if (Button.press_counter[button_index] < 3) { // Single or Double press
#ifdef ESP8266
if ((SONOFF_DUAL_R2 == my_module_type) || (SONOFF_DUAL == my_module_type) || (CH4 == my_module_type)) {
single_press = true;
} else
#endif // ESP8266
{
single_press = (Settings.flag.button_swap +1 == Button.press_counter[button_index]); // SetOption11 (0)
if ((1 == Button.present) && (2 == devices_present)) { // Single Button with two devices only
if (Settings.flag.button_swap) { // SetOption11 (0)
Button.press_counter[button_index] = (single_press) ? 1 : 2;
}
}
}
}
#if defined(USE_LIGHT) && defined(ROTARY_V1)
if (!((0 == button_index) && RotaryButtonPressed())) {
#endif
if (!Settings.flag3.mqtt_buttons && single_press && SendKey(KEY_BUTTON, button_index + Button.press_counter[button_index], POWER_TOGGLE)) { // Execute Toggle command via MQTT if ButtonTopic is set
// Success
} else {
if (Button.press_counter[button_index] < 6) { // Single to Penta press
if (WifiState() > WIFI_RESTART) { // Wifimanager active
restart_flag = 1;
}
if (!Settings.flag3.mqtt_buttons) {
if (Button.press_counter[button_index] == 1) { // By default first press always send a TOGGLE (2)
ExecuteCommandPower(button_index + Button.press_counter[button_index], POWER_TOGGLE, SRC_BUTTON);
} else {
SendKey(KEY_BUTTON, button_index +1, Button.press_counter[button_index] +9); // 2,3,4 and 5 press send just the key value (11,12,13 and 14) for rules
if (0 == button_index) { // BUTTON1 can toggle up to 5 relays if present. If a relay is not present will send out the key value (2,11,12,13 and 14) for rules
if ((Button.press_counter[button_index] > 1 && PinUsed(GPIO_REL1, Button.press_counter[button_index]-1)) && Button.press_counter[button_index] <= MAX_RELAY_BUTTON1) {
ExecuteCommandPower(button_index + Button.press_counter[button_index], POWER_TOGGLE, SRC_BUTTON); // Execute Toggle command internally
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("DBG: Relay%d found on GPIO%d"), Button.press_counter[button_index], Pin(GPIO_REL1, Button.press_counter[button_index]-1));
}
}
}
}
} else { // 6 press start wificonfig 2
if (!Settings.flag.button_restrict) {
snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_WIFICONFIG " 2"));
ExecuteCommand(scmnd, SRC_BUTTON);
}
}
if (Settings.flag3.mqtt_buttons) { // SetOption73 (0) - Decouple button from relay and send just mqtt topic
if (Button.press_counter[button_index] >= 1 && Button.press_counter[button_index] <= 5) {
MqttButtonTopic(button_index +1, Button.press_counter[button_index], 0);
}
}
}
#if defined(USE_LIGHT) && defined(ROTARY_V1)
}
#endif
Button.press_counter[button_index] = 0;
}
}
}
}
}
Button.last_state[button_index] = button;
}
}
void MqttButtonTopic(uint8_t button_id, uint8_t action, uint8_t hold)
{
char scommand[CMDSZ];
char stopic[TOPSZ];
char mqttstate[7];
SendKey(KEY_BUTTON, button_id, (hold) ? 3 : action +9);
if (!Settings.flag.hass_discovery) {
GetTextIndexed(mqttstate, sizeof(mqttstate), action, kMultiPress);
snprintf_P(scommand, sizeof(scommand), PSTR("BUTTON%d"), button_id);
GetTopic_P(stopic, STAT, mqtt_topic, scommand);
Response_P(S_JSON_COMMAND_SVALUE, "ACTION", (hold) ? SettingsText(SET_STATE_TXT4) : mqttstate);
MqttPublish(stopic);
}
}
void ButtonLoop(void)
{
if (Button.present) {
if (TimeReached(Button.debounce)) {
SetNextTimeInterval(Button.debounce, Settings.button_debounce); // ButtonDebounce (50)
ButtonHandler();
}
}
}
#endif // BUTTON_V2

View File

@ -20,7 +20,7 @@
#ifndef _TASMOTA_VERSION_H_
#define _TASMOTA_VERSION_H_
const uint32_t VERSION = 0x08020006;
const uint32_t VERSION = 0x08030001;
// Lowest compatible version
const uint32_t VERSION_COMPATIBLE = 0x07010006;