diff --git a/README.md b/README.md
index 0084c7286..3ab25ac17 100644
--- a/README.md
+++ b/README.md
@@ -13,13 +13,13 @@ If you like **Sonoff-Tasmota**, give it a star, or fork it and contribute!
[![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://paypal.me/tasmota)
### Development
-[![Dev Version](https://img.shields.io/badge/development%20version-6.1.1.13-blue.svg)](https://github.com/arendst/Sonoff-Tasmota)
+[![Dev Version](https://img.shields.io/badge/development%20version-6.2.0.x-blue.svg)](https://github.com/arendst/Sonoff-Tasmota)
[![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://thehackbox.org/tasmota/)
[![Build Status](https://img.shields.io/travis/arendst/Sonoff-Tasmota.svg)](https://travis-ci.org/arendst/Sonoff-Tasmota)
See [RELEASENOTES.md](https://github.com/arendst/Sonoff-Tasmota/blob/development/RELEASENOTES.md) for release information and [sonoff/_changelog.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_changelog.ino) for detailed change information.
-The compiled development versions from current codebase are built around 6AM GMT+2 everyday and posted at http://thehackbox.org/tasmota/ (this web address can be used for OTA too).
+The development codebase is checked hourly for changes and if new commits have been merged and compile successfuly they will be posted at http://thehackbox.org/tasmota/ (this web address can be used for OTA too). It is important to note that these are based on the current development codebase and it is not recommended to flash it to devices used in production or which are hard to reach in the event that you need to manually flash the device if OTA failed. The last compiled commit number is also posted on the same page along with the current build status (if a firmware rebuild is in progress).
### Disclaimer
:warning: **DANGER OF ELECTROCUTION** :warning:
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index a55440abe..7cacefa47 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -140,6 +140,7 @@ Version 6.2.0 20180901
* Fix Sonoff Bridge data reception when using Portisch EFM8 firmware using in data buffer length (#3605)
* Add read sensor retry to DS18B20, DS18x20, DHT, SHT1X and HTU21
* Add user selection of Wifi Smartconfig as define USE_SMARTCONFIG in user_config.h
+ * Add boot loop detection and perform some solutions
* Add wifi and mqtt status led blinkyblinky to be disabled by SetOption31 1. Does not work when LedPower is On (deliberate) (#871, #2230, #3114, #3155)
* Add support for TM1638 switch (#2226)
* Add GPIO options ButtonXn, SwitchXn and CounterXn to select INPUT mode instead of INPUT_PULLUP (#2525)
diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino
index 0629de523..a59ba99cb 100644
--- a/sonoff/_changelog.ino
+++ b/sonoff/_changelog.ino
@@ -1,110 +1,74 @@
-/* 6.1.1.13 20180828
- * Fix 6.1.1.12 regression of Mem and Var default handling (#3618)
- * Optimizations
- * Change define USE_ALL_SENSORS to USE_SENSORS as it doesn't contain all sensors due to duplicate I2C addresses
+/* 6.2.0.1 20180902
+ * Fix possible ambiguity on command parameters if StateText contains numbers only (#3656)
+ * Fix possible exception due to buffer overflow (#3659)
+ * Add Wifi channel number to state message (#3664)
+ * Fix Wemo emulation to select the first relay when more than one relay is present (#3657)
+ * Add support for Shelly 1 and basic support for Shelly 2 - No energy monitoring yet (#2789)
*
- * 6.1.1.12 20180827
- * Add commands ButtonDebounce 40..1000 and SwitchDebounce 40..1000 to have user control over debounce timing. Default is 50mS (#3594)
- * Add rule variables %sunrise%, %sunset%, %uptime% and %time% (#3608)
- * Fix handling use of default names when using names starting with shortcut character (#3392, #3600)
- * Fix Sonoff Bridge data reception when using Portisch EFM8 firmware and in data buffer length (#3605)
- * Add optional MQTT_TELE_RETAIN to Energy Margins message (#3612, 3614)
- * Add Individual HSBColorX commands (#3430, #3615)
- * Add RuleX debug options 8,9,10 (StopOnError) to control RuleX execution status after an exception restart (#3607)
- *
- * 6.1.1.11 20180826
- * Change scheduler phase 1/3 - Fixed when sleep is enabled: Uptime, Delay, PulseTime and TelePeriod (#3581)
- * Change scheduler phase 2/3 - Fixed when sleep is enabled: Blinktime (#3581)
- * Change scheduler phase 3/3 - Some sensor update timings: AdcEvery 200 -> 250, Senseair 300 -> 250, SDM120 300 -> 250, SDM630 300 -> 250
- *
- * 6.1.1.10 20180827
+ * 6.2.0 20180901
+ * Allow user override of define MAX_RULE_VARS and MAX_RULE_TIMERS (#3561)
* Disable wifi sleep for both Esp8266/Arduino core 2.4.1 and 2.4.2 to solve device freeze caused by Espressif SDK bug (#3554)
- * Rewrite GPIO options ButtonXn, SwitchXn and CounterXn to select INPUT mode instead of INPUT_PULLUP
- * Add command Publish2 for publishing retained MQTT messages (#3593)
- *
- * 6.1.1.9 20180825
- * Allow user override of define MAX_RULE_TIMERS (#3561)
- * Allow user override of define MAX_RULE_VARS
- * Add GPIO options ButtonXn, SwitchXn and CounterXn to select INPUT mode instead of INPUT_PULLUP (#2525)
- * Fix OtaMagic when file path contains a dash (-) (#3563)
- * Fix EnergyReset3 (#2723)
- * Change command sleep from restart after change to not restart after change (#3554)
- * Add all ruletimer values to command RuleTimer result message (#3571)
- * Add RGB support for Domoticz (#3547)
- *
- * 6.1.1.8 20180825
- * Fix MQTT reconnection detection when using TasmotaMqtt library (#3558)
- * Add build time setting of ButtonTopic and SwitchTopic (#3414)
- * Add display features and dynamic buffering
- *
- * 6.1.1.7 20180818
- * Add initial display support for Lcd, Oled, Matrix, Tft and e-paper - Need more docs
- * Fix SDM120 reporting wrong negative values to Domoticz (#3521)
- * Fix iFan02 power on state (#3412, #3530)
- * Add display define USE_DISPLAY_MODES1TO5 to select display modes 1 to 5
- * Add command DisplayRotate 0..3 to select persistent display rotation
- *
- * 6.1.1.6 20180813
- * Add modulo option to rules like rule1 on Time#Minute|5 do backlog power on;delay 200;power off endon (#3466)
- *
- * 6.1.1.5 20180812
- * Fix some Pow R2 and S31 checksum errors using optimized re-sync
- *
- * 6.1.1.4 20180812
- * Change version representation from 1.1.1a to 1.1.1.1 for better change reference
- *
- * 6.1.1c 20180720
- * Add iFan02 Fanspeed + and Fanspeed - command options (#3415)
- * Fix some Pow R2 and S31 checksum errors (#3425)
- * Change CounterType 1 from milliseconds to microseconds (#3437)
- * Add output support on MCP23008/MCP23017 (#3436)
- * Fix LM75AD I2C sensor detection (#3408)
- * Add message when JavaScript is not enabled in webbrowser (#3388)
- * Fix sonoff-minimal from using default settings
- * Add option + to command Rule to concatenate new rule with existing rules (#3365)
- * Add initial support for sensor MPU6050 (#3352)
- * Add command SerialSend4 to send binary serial data (#3345)
- * Add rule triggers Wifi#Connected and Wifi#Disconnected (#3359)
- * Fix unsecure main webpage update
- * Add Turkish language file (#3332)
- * Fix command TimeDst/TimeStd invalid JSON (#3322)
- * Fix possible WDT due to long MQTT publish handling (#3313)
- * Fix CCS811 temperature and humidity compensation
- * Add support for CCS811 sensor (#3309)
- * Add command Timers 0/1 to globally disable or enable armed timers (#3270)
- *
- * 6.1.1b 20180715
- * Add support for MPR121 controller in input mode for touch buttons (#3142)
- * Add support for MCP230xx for general purpose input expansion and command Sensor29 (#3188)
- * Fix command Scale buffer overflow (#3236)
- * Fix rules once regression from v6.1.0 (#3198, #3226)
- * Add default Wifi Configuration tool as define WIFI_CONFIG_NO_SSID in user_config.h if no SSID is configured (#3224)
- * Add user selection of Wifi Smartconfig as define USE_SMARTCONFIG in user_config.h
- * Add user selection of WPS as define USE_WPS in user_config.h in preparation for core v2.4.2 (#3221)
- * Change default Wifi config option from WPS to Wifi Manager if WPS is disabled
- * or Wifi Smartconfig if webserver is disabled
- * or Wifi Serial input if Smartconfig is disabled
- * Remove WPS and SmartConfig from sonoff-minimal saving 56k code space
- *
- * 6.1.1a 20180714
- * Fix TM1638 compile error (#3212)
- * Add TM1638 switch support (#2226)
- * Fix invalid response using more than 4 switches and domoticz
- * Update sensor drivers to provide instant results
- * Add read sensor retry to DS18B20, DS18x20, DHT, SHT1X and HTU21
- * Change SHT1x driver to provide better instant results
- * Fix DHT driver mixing values for different sensors (#1797)
+ * Change DS18B20 driver to provide better instant results
+ * Change some sensor drivers to provide instant results
+ * Change define USE_ALL_SENSORS to USE_SENSORS as it doesn't contain all sensors due to duplicate I2C addresses
+ * Change some sensor update timings: AdcEvery 200 -> 250, Senseair 300 -> 250, SDM120 300 -> 250, SDM630 300 -> 250
+ * Change default Wifi config option from WPS to Wifi Manager if WPS is disabled or Wifi Smartconfig if webserver is disabled or Wifi Serial input if Smartconfig is disabled
+ * Change SHT1x driver to provide better instant results and fix I2C interference
* Change DHT driver to provide better instant results and add decimals to DHT11 (#3164)
* Change DS18x20 driver to provide better instant results (#3169)
- * Change DS18B20 driver to provide better instant results
+ * Change CounterType 1 from milliseconds to microseconds (#3437)
+ * Change scheduler for better sleep support using Uptime, Delay, PulseTime and TelePeriod, Blinktime (#3581)
+ * Remove unused functionality from Sonoff-minimal to save space
+ * Remove WPS and SmartConfig from sonoff-minimal saving 56k code space
* Remove TSL2561 debug message and update library (#2415)
- * Change SHT1x sensor initialization from pre-teleperiod to once during restart to fix I2C interference
+ * Remove forced restart when sleep command is executed (#3554)
+ * Fix invalid response using more than 4 switches and domoticz
+ * Fix sonoff-minimal not using default settings
+ * Fix unsecure main webpage update
+ * Fix DHT driver mixing values for different sensors (#1797)
+ * Fix EnergyReset3 regression not clearing total energy (#2723)
+ * Fix rules once regression from v6.1.0 (#3198, #3226)
+ * Fix command Scale buffer overflow (#3236)
+ * Fix possible WDT due to long MQTT publish handling (#3313)
+ * Fix command TimeDst/TimeStd invalid JSON (#3322)
+ * Fix handling of default names when using names starting with shortcut character ",0,1 or 2 (#3392, #3600, #3618)
+ * Fix LM75AD I2C sensor detection (#3408)
+ * Fix iFan02 power on state (#3412, #3530)
+ * Fix some Pow R2 and S31 checksum errors using optimized re-sync (#3425)
+ * Fix SDM120 reporting wrong negative values to Domoticz (#3521)
+ * Fix MQTT reconnection detection when using TasmotaMqtt library (#3558)
+ * Fix OtaMagic when file path contains a dash (-) (#3563)
+ * Fix Sonoff Bridge data reception when using Portisch EFM8 firmware using in data buffer length (#3605)
+ * Add read sensor retry to DS18B20, DS18x20, DHT, SHT1X and HTU21
+ * Add user selection of Wifi Smartconfig as define USE_SMARTCONFIG in user_config.h
+ * Add boot loop detection and perform some solutions
* Add wifi and mqtt status led blinkyblinky to be disabled by SetOption31 1. Does not work when LedPower is On (deliberate) (#871, #2230, #3114, #3155)
- * Add experimental (untested) TM1638 switch support (#2226)
+ * Add support for TM1638 switch (#2226)
+ * Add GPIO options ButtonXn, SwitchXn and CounterXn to select INPUT mode instead of INPUT_PULLUP (#2525)
* Add support for APDS9960 proximity sensor (#3051)
- * Add heap and stack debug information
- * Add debug facilities using optional xdrv_99_debug.ino to enable in user_config.h
- * Remove not needed functionality from Sonoff-minimal to save space
+ * Add support for MPR121 controller in input mode for touch buttons (#3142)
+ * Add support for MCP230xx for general purpose input expansion and command Sensor29 (#3188)
+ * Add default Wifi Configuration tool as define WIFI_CONFIG_NO_SSID in user_config.h if no SSID is configured (#3224)
+ * Add command Timers 0/1 to globally disable or enable armed timers (#3270)
+ * Add support for CCS811 sensor (#3309)
+ * Add Turkish language file (#3332)
+ * Add command SerialSend4 to send binary serial data (#3345)
+ * Add initial support for sensor MPU6050 (#3352)
+ * Add rule triggers Wifi#Connected and Wifi#Disconnected (#3359)
+ * Add option + to command Rule to concatenate new rule with existing rules (#3365)
+ * Add message when JavaScript is not enabled in webbrowser (#3388)
+ * Add build time setting of ButtonTopic and SwitchTopic (#3414)
+ * Add iFan02 Fanspeed + and Fanspeed - command options (#3415)
+ * Add Individual HSBColorX commands (#3430, #3615)
+ * Add output support on MCP23008/MCP23017 (#3436)
+ * Add modulo option to rules like rule1 on Time#Minute|5 do backlog power on;delay 200;power off endon (#3466)
+ * Add RGB support for Domoticz (#3547)
+ * Add all ruletimer values to command RuleTimer result message (#3571)
+ * Add command Publish2 for publishing retained MQTT messages (#3593)
+ * Add commands ButtonDebounce 40..1000 and SwitchDebounce 40..1000 to have user control over debounce timing. Default is 50mS (#3594)
+ * Add RuleX debug options 8,9,10 (StopOnError) to control RuleX execution status after an exception restart (#3607)
+ * Add rule variables %sunrise%, %sunset%, %uptime% and %time% (#3608)
+ * Add optional MQTT_TELE_RETAIN to Energy Margins message (#3612, 3614)
*
* 6.1.1 20180714
* Revert wifi changes (#3177)
diff --git a/sonoff/i18n.h b/sonoff/i18n.h
index 3d63f73f5..5559ac6d1 100644
--- a/sonoff/i18n.h
+++ b/sonoff/i18n.h
@@ -39,7 +39,9 @@
#define D_JSON_BLOCKED_LOOP "Blocked Loop"
#define D_JSON_BOOTVERSION "Boot"
#define D_JSON_BOOTCOUNT "BootCount"
+#define D_JSON_BSSID "BSSId"
#define D_JSON_BUILDDATETIME "BuildDateTime"
+#define D_JSON_CHANNEL "Channel"
#define D_JSON_CO2 "CarbonDioxide"
#define D_JSON_COMMAND "Command"
#define D_JSON_CONNECT_FAILED "Connect failed"
@@ -236,6 +238,7 @@
#define D_CMND_SERIALSEND "SerialSend"
#define D_CMND_SERIALDELIMITER "SerialDelimiter"
#define D_CMND_BAUDRATE "Baudrate"
+#define D_LOG_SOME_SETTINGS_RESET "Some settings have been reset"
// Commands xdrv_01_mqtt.ino
#define D_CMND_MQTTHOST "MqttHost"
diff --git a/sonoff/language/bg-BG.h b/sonoff/language/bg-BG.h
index 6421441b7..b1ecd6fa6 100644
--- a/sonoff/language/bg-BG.h
+++ b/sonoff/language/bg-BG.h
@@ -28,7 +28,7 @@
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
* Use online command Prefix to translate cmnd, stat and tele.
*
- * Updated until v6.1.1.5
+ * Updated until v6.2.0.1
\*********************************************************************/
//#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
@@ -60,10 +60,12 @@
#define D_BLINKOFF "Мигане изкл."
#define D_BOOT_COUNT "Брой на стартиранията"
#define D_BRIGHTLIGHT "Яркост"
+#define D_BSSID "BSSId"
#define D_BUTTON "Бутон"
#define D_BY "от" // Written by me
#define D_BYTES "Байта"
#define D_CELSIUS "Целзий"
+#define D_CHANNEL "Канал"
#define D_CO2 "Въглероден диоксид"
#define D_CODE "код" // Button code
#define D_COLDLIGHT "Хладна"
@@ -438,12 +440,12 @@
#define D_PARTICALS_BEYOND "Частици"
// xsns_32_mpu6050.ino
-#define D_AX_AXIS "Accel. X-Axis"
-#define D_AY_AXIS "Accel. Y-Axis"
-#define D_AZ_AXIS "Accel. Z-Axis"
-#define D_GX_AXIS "Gyro X-Axis"
-#define D_GY_AXIS "Gyro Y-Axis"
-#define D_GZ_AXIS "Gyro Z-Axis"
+#define D_AX_AXIS "Ускорение - ос X"
+#define D_AY_AXIS "Ускорение - ос Y"
+#define D_AZ_AXIS "Ускорение - ос Z"
+#define D_GX_AXIS "Жироскоп - ос X"
+#define D_GY_AXIS "Жироскоп - ос Y"
+#define D_GZ_AXIS "Жироскоп - ос Z"
// sonoff_template.h
#define D_SENSOR_NONE "Няма"
diff --git a/sonoff/language/cs-CZ.h b/sonoff/language/cs-CZ.h
index d1905c103..2f51ccc93 100644
--- a/sonoff/language/cs-CZ.h
+++ b/sonoff/language/cs-CZ.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "BlikáníVyp"
#define D_BOOT_COUNT "Počítadlo spuštění"
#define D_BRIGHTLIGHT "Světlý"
+#define D_BSSID "BSSId"
#define D_BUTTON "Tlačítko"
#define D_BY "by" // Written by me
#define D_BYTES "Bytů"
#define D_CELSIUS "°C"
+#define D_CHANNEL "Channel"
#define D_CO2 "CO2"
#define D_CODE "kód" // Button code
#define D_COLDLIGHT "Studené světlo"
diff --git a/sonoff/language/de-DE.h b/sonoff/language/de-DE.h
index 302c7e55e..888345d8a 100644
--- a/sonoff/language/de-DE.h
+++ b/sonoff/language/de-DE.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "BlinkenAus"
#define D_BOOT_COUNT "Anzahl Startvorgänge"
#define D_BRIGHTLIGHT "hell"
+#define D_BSSID "BSSId"
#define D_BUTTON "Knopf"
#define D_BY "von" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
+#define D_CHANNEL "Kanal"
#define D_CO2 "CO²"
#define D_CODE "code" // Button code
#define D_COLDLIGHT "kalt"
diff --git a/sonoff/language/el-GR.h b/sonoff/language/el-GR.h
index 789d88a6f..3187eadf9 100644
--- a/sonoff/language/el-GR.h
+++ b/sonoff/language/el-GR.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "Δεν αναβοσβήνει"
#define D_BOOT_COUNT "Αριθμός εκκινήσεων"
#define D_BRIGHTLIGHT "Λαμπερό"
+#define D_BSSID "BSSId"
#define D_BUTTON "Κουμπί"
#define D_BY "από" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Κελσίου"
+#define D_CHANNEL "Channel"
#define D_CO2 "Διοξείδιο του άνθρακα"
#define D_CODE "κώδικας" // Button code
#define D_COLDLIGHT "Ψυχρός"
diff --git a/sonoff/language/en-GB.h b/sonoff/language/en-GB.h
index e8af7fab1..558877db2 100644
--- a/sonoff/language/en-GB.h
+++ b/sonoff/language/en-GB.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "BlinkOff"
#define D_BOOT_COUNT "Boot Count"
#define D_BRIGHTLIGHT "Bright"
+#define D_BSSID "BSSId"
#define D_BUTTON "Button"
#define D_BY "by" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
+#define D_CHANNEL "Channel"
#define D_CO2 "Carbon dioxide"
#define D_CODE "code" // Button code
#define D_COLDLIGHT "Cold"
diff --git a/sonoff/language/es-AR.h b/sonoff/language/es-AR.h
index 68e9141ea..986b9507f 100644
--- a/sonoff/language/es-AR.h
+++ b/sonoff/language/es-AR.h
@@ -28,7 +28,7 @@
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
* Use online command Prefix to translate cmnd, stat and tele.
*
- * Updated until v6.1.1c
+ * Updated until v6.2.0.1
\*********************************************************************/
#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
@@ -60,10 +60,12 @@
#define D_BLINKOFF "BlinkOff"
#define D_BOOT_COUNT "Conteo Reinicios"
#define D_BRIGHTLIGHT "Brillante"
+#define D_BSSID "BSSId"
#define D_BUTTON "Botón"
#define D_BY "por" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
+#define D_CHANNEL "Canal"
#define D_CO2 "CO2"
#define D_CODE "código" // Button code
#define D_COLDLIGHT "Fría"
@@ -460,7 +462,7 @@
#define D_SENSOR_RELAY "Relé" // Suffix "1i"
#define D_SENSOR_LED "Led" // Suffix "1i"
#define D_SENSOR_PWM "PWM" // Suffix "1"
-#define D_SENSOR_COUNTER "Counter" // Suffix "1"
+#define D_SENSOR_COUNTER "Contador" // Suffix "1"
#define D_SENSOR_IRRECV "IR RX"
#define D_SENSOR_MHZ_RX "MHZ Rx"
#define D_SENSOR_MHZ_TX "MHZ Tx"
diff --git a/sonoff/language/fr-FR.h b/sonoff/language/fr-FR.h
index 1e5c2b9f8..2a46f7b53 100644
--- a/sonoff/language/fr-FR.h
+++ b/sonoff/language/fr-FR.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "BlinkOff"
#define D_BOOT_COUNT "Nombre de boot"
#define D_BRIGHTLIGHT "Luminosité"
+#define D_BSSID "BSSId"
#define D_BUTTON "Bouton"
#define D_BY "par" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
+#define D_CHANNEL "Channel"
#define D_CO2 "Dioxyde de carbone"
#define D_CODE "code" // Button code
#define D_COLDLIGHT "Froid"
diff --git a/sonoff/language/hu-HU.h b/sonoff/language/hu-HU.h
index 76076427e..c57278176 100644
--- a/sonoff/language/hu-HU.h
+++ b/sonoff/language/hu-HU.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "Villogás Ki"
#define D_BOOT_COUNT "Bootolások száma"
#define D_BRIGHTLIGHT "Max. fényerő"
+#define D_BSSID "BSSId"
#define D_BUTTON "Gomb"
#define D_BY "tőle:" // Written by me
#define D_BYTES "Byte-ok"
#define D_CELSIUS "Celsius"
+#define D_CHANNEL "Channel"
#define D_CO2 "Szén-dioxid"
#define D_CODE "kód" // Button code
#define D_COLDLIGHT "Hideg"
diff --git a/sonoff/language/it-IT.h b/sonoff/language/it-IT.h
index 2beda2e79..d07a33021 100644
--- a/sonoff/language/it-IT.h
+++ b/sonoff/language/it-IT.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "BlinkOff"
#define D_BOOT_COUNT "Numero di boot"
#define D_BRIGHTLIGHT "Luminoso"
+#define D_BSSID "BSSId"
#define D_BUTTON "Pulsante"
#define D_BY "da" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
+#define D_CHANNEL "Channel"
#define D_CO2 "CO2"
#define D_CODE "codice" // Button code
#define D_COLDLIGHT "Fredda"
diff --git a/sonoff/language/nl-NL.h b/sonoff/language/nl-NL.h
index 8ef596448..05ec4666b 100644
--- a/sonoff/language/nl-NL.h
+++ b/sonoff/language/nl-NL.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "KnipperUit"
#define D_BOOT_COUNT "Herstarts"
#define D_BRIGHTLIGHT "Fel"
+#define D_BSSID "BSSId"
#define D_BUTTON "DrukKnop"
#define D_BY "door" // Written by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
+#define D_CHANNEL "Kanaal"
#define D_CO2 "Koolstofdioxide"
#define D_CODE "code" // Button code
#define D_COLDLIGHT "Koud"
diff --git a/sonoff/language/pl-PL.h b/sonoff/language/pl-PL.h
index 06d086c57..faaf8df6d 100644
--- a/sonoff/language/pl-PL.h
+++ b/sonoff/language/pl-PL.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "MiganieWył"
#define D_BOOT_COUNT "Licznik uruchomienia"
#define D_BRIGHTLIGHT "Jasny"
+#define D_BSSID "BSSId"
#define D_BUTTON "Przycisk"
#define D_BY "by" // Written by me
#define D_BYTES "Bajtow"
#define D_CELSIUS "Celsiusza"
+#define D_CHANNEL "Channel"
#define D_CO2 "Dwutlenku węgla"
#define D_CODE "kod" // Button code
#define D_COLDLIGHT "Zimny"
diff --git a/sonoff/language/pt-BR.h b/sonoff/language/pt-BR.h
index 6c5f3fceb..318f69e45 100644
--- a/sonoff/language/pt-BR.h
+++ b/sonoff/language/pt-BR.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "Pulsar desligado"
#define D_BOOT_COUNT "Contagem de inicialização"
#define D_BRIGHTLIGHT "Brilho"
+#define D_BSSID "BSSId"
#define D_BUTTON "Botão"
#define D_BY "por" // Write by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
+#define D_CHANNEL "Channel"
#define D_CO2 "Dióxido de carbono"
#define D_CODE "Código" // Button code
#define D_COLDLIGHT "Luz fria"
diff --git a/sonoff/language/pt-PT.h b/sonoff/language/pt-PT.h
index 0c93620e8..d39ec6e50 100644
--- a/sonoff/language/pt-PT.h
+++ b/sonoff/language/pt-PT.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "Piscar desligado"
#define D_BOOT_COUNT "Contagem de Inicialização"
#define D_BRIGHTLIGHT "Brilho"
+#define D_BSSID "BSSId"
#define D_BUTTON "Botão"
#define D_BY "por" // Write by me
#define D_BYTES "Bytes"
#define D_CELSIUS "Celsius"
+#define D_CHANNEL "Channel"
#define D_CO2 "Dioxido de Carbono"
#define D_CODE "Código" // Button code
#define D_COLDLIGHT "Luz Fria"
diff --git a/sonoff/language/ru-RU.h b/sonoff/language/ru-RU.h
index 2fa9d388f..5fea0468e 100644
--- a/sonoff/language/ru-RU.h
+++ b/sonoff/language/ru-RU.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "Не Мигать"
#define D_BOOT_COUNT "Количество загрузок"
#define D_BRIGHTLIGHT "Яркость"
+#define D_BSSID "BSSId"
#define D_BUTTON "Кнопка"
#define D_BY "by" // Written by me
#define D_BYTES "Байт"
#define D_CELSIUS "Цельсия"
+#define D_CHANNEL "Channel"
#define D_CO2 "Углекислый газ"
#define D_CODE "код" // Button code
#define D_COLDLIGHT "Холодный"
diff --git a/sonoff/language/tr-TR.h b/sonoff/language/tr-TR.h
index 3d88ae1a8..b133d2c80 100755
--- a/sonoff/language/tr-TR.h
+++ b/sonoff/language/tr-TR.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "BlinkOff"
#define D_BOOT_COUNT "Yeniden başlama sayısı"
#define D_BRIGHTLIGHT "Işık"
+#define D_BSSID "BSSId"
#define D_BUTTON "Buton"
#define D_BY "by" // Written by me
#define D_BYTES "Bayt"
#define D_CELSIUS "Derece"
+#define D_CHANNEL "Channel"
#define D_CO2 "Karbon dioksit"
#define D_CODE "kod" // Button code
#define D_COLDLIGHT "Soğuk"
@@ -536,4 +538,4 @@
#define D_LOG_UPNP "UPP: " // UPnP
#define D_LOG_WIFI "WIF: " // Wifi
-#endif // _LANGUAGE_TR_TR_H_
\ No newline at end of file
+#endif // _LANGUAGE_TR_TR_H_
diff --git a/sonoff/language/uk-UK.h b/sonoff/language/uk-UK.h
index a2fe05843..9cf66773b 100644
--- a/sonoff/language/uk-UK.h
+++ b/sonoff/language/uk-UK.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "Не блимати"
#define D_BOOT_COUNT "Кіл-сть завант."
#define D_BRIGHTLIGHT "Яскравість"
+#define D_BSSID "BSSId"
#define D_BUTTON "Кнопка"
#define D_BY "by" // Written by me
#define D_BYTES "Байт"
#define D_CELSIUS "Цельсія"
+#define D_CHANNEL "Channel"
#define D_CO2 "Вуглек. газ"
#define D_CODE "код" // Button code
#define D_COLDLIGHT "Холодний"
diff --git a/sonoff/language/zh-CN.h b/sonoff/language/zh-CN.h
index 70186035d..88f680f8e 100644
--- a/sonoff/language/zh-CN.h
+++ b/sonoff/language/zh-CN.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "闪烁关"
#define D_BOOT_COUNT "启动次数"
#define D_BRIGHTLIGHT "亮"
+#define D_BSSID "BSSId"
#define D_BUTTON "按钮"
#define D_BY "汉化: killadm 作者:" // Written by me
#define D_BYTES "大小:"
#define D_CELSIUS "摄氏"
+#define D_CHANNEL "Channel"
#define D_CO2 "二氧化碳"
#define D_CODE "代码" // Button code
#define D_COLDLIGHT "冷"
diff --git a/sonoff/language/zh-TW.h b/sonoff/language/zh-TW.h
index 16e6961d0..abb92d359 100644
--- a/sonoff/language/zh-TW.h
+++ b/sonoff/language/zh-TW.h
@@ -60,10 +60,12 @@
#define D_BLINKOFF "閃爍關"
#define D_BOOT_COUNT "啟動次數"
#define D_BRIGHTLIGHT "亮度"
+#define D_BSSID "BSSId"
#define D_BUTTON "按鈕"
#define D_BY "by" // Written by me
#define D_BYTES "大小:"
#define D_CELSIUS "攝氏"
+#define D_CHANNEL "Channel"
#define D_CO2 "二氧化碳"
#define D_CODE "代碼" // Button code
#define D_COLDLIGHT "冷"
diff --git a/sonoff/settings.h b/sonoff/settings.h
index 618ef0b54..ded2c140b 100644
--- a/sonoff/settings.h
+++ b/sonoff/settings.h
@@ -94,7 +94,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
uint32_t spare28 : 1;
uint32_t spare29 : 1;
uint32_t spare30 : 1;
- uint32_t spare31 : 1;
+ uint32_t user_esp8285_enable : 1; // bit 31 (v6.1.1.14)
};
} SysBitfield3;
@@ -341,7 +341,10 @@ struct RTCMEM {
unsigned long energy_kWhtotal; // 008
unsigned long pulse_counter[MAX_COUNTERS]; // 00C
power_t power; // 01C
- // 020 next free location
+ uint16_t extended_valid; // 020 Extended valid flag (v6.1.1.14)
+ uint8_t fast_reboot_count; // 022
+ uint8_t free_023[57]; // 023
+ // 05C next free location (64 (=core) + 100 (=tasmota offset) + 92 (=0x5C RTCMEM struct) = 256 bytes (max = 512))
} RtcSettings;
struct TIME_T {
diff --git a/sonoff/settings.ino b/sonoff/settings.ino
index e0a40a17c..cba043696 100644
--- a/sonoff/settings.ino
+++ b/sonoff/settings.ino
@@ -84,6 +84,7 @@ void RtcSettingsSave()
{
if (GetRtcSettingsCrc() != rtc_settings_crc) {
RtcSettings.valid = RTC_MEM_VALID;
+ RtcSettings.extended_valid = RTC_MEM_VALID;
ESP.rtcUserMemoryWrite(100, (uint32_t*)&RtcSettings, sizeof(RTCMEM));
rtc_settings_crc = GetRtcSettingsCrc();
#ifdef DEBUG_THEO
@@ -103,12 +104,14 @@ void RtcSettingsLoad()
if (RtcSettings.valid != RTC_MEM_VALID) {
memset(&RtcSettings, 0, sizeof(RTCMEM));
RtcSettings.valid = RTC_MEM_VALID;
+ RtcSettings.extended_valid = RTC_MEM_VALID;
RtcSettings.energy_kWhtoday = Settings.energy_kWhtoday;
RtcSettings.energy_kWhtotal = Settings.energy_kWhtotal;
for (byte i = 0; i < MAX_COUNTERS; i++) {
RtcSettings.pulse_counter[i] = Settings.pulse_counter[i];
}
RtcSettings.power = Settings.power;
+// RtcSettings.fast_reboot_count = 0; // Explicit by memset
RtcSettingsSave();
}
rtc_settings_crc = GetRtcSettingsCrc();
@@ -119,6 +122,11 @@ boolean RtcSettingsValid()
return (RTC_MEM_VALID == RtcSettings.valid);
}
+boolean RtcSettingsExtendedValid()
+{
+ return (RTC_MEM_VALID == RtcSettings.extended_valid);
+}
+
/*********************************************************************************************\
* Config - Flash
\*********************************************************************************************/
diff --git a/sonoff/sonoff.h b/sonoff/sonoff.h
index f93df0059..3a1dc14c6 100644
--- a/sonoff/sonoff.h
+++ b/sonoff/sonoff.h
@@ -85,6 +85,7 @@ typedef unsigned long power_t; // Power (Relay) type
#define STATES 20 // Number of states per second using 50 mSec interval
#define IMMINENT_RESET_FACTOR 10 // Factor to extent button hold time for imminent Reset to default 40 seconds using KEY_HOLD_TIME of 40
+#define BOOT_LOOP_TIME 10 // Number of seconds to stop detecting boot loops
#define SYSLOG_TIMER 600 // Seconds to restore syslog_level
#define SERIALLOG_TIMER 600 // Seconds to disable SerialLog
#define OTA_ATTEMPTS 5 // Number of times to try fetching the new firmware
diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino
index 8cd69e4cc..8d82efc18 100755
--- a/sonoff/sonoff.ino
+++ b/sonoff/sonoff.ino
@@ -442,7 +442,7 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len)
ShowFreeMem(PSTR("MqttDataHandler"));
- strncpy(topicBuf, topic, sizeof(topicBuf));
+ strlcpy(topicBuf, topic, sizeof(topicBuf));
for (i = 0; i < data_len; i++) {
if (!isspace(data[i])) break;
}
@@ -1532,8 +1532,8 @@ void MqttShowState()
MqttShowPWMState();
}
- snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_JSON_WIFI "\":{\"" D_JSON_AP "\":%d,\"" D_JSON_SSID "\":\"%s\",\"" D_JSON_RSSI "\":%d,\"" D_JSON_APMAC_ADDRESS "\":\"%s\"}}"),
- mqtt_data, Settings.sta_active +1, Settings.sta_ssid[Settings.sta_active], WifiGetRssiAsQuality(WiFi.RSSI()), WiFi.BSSIDstr().c_str());
+ snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_JSON_WIFI "\":{\"" D_JSON_AP "\":%d,\"" D_JSON_SSID "\":\"%s\",\"" D_JSON_BSSID "\":\"%s\",\"" D_JSON_CHANNEL "\":%d,\"" D_JSON_RSSI "\":%d}}"),
+ mqtt_data, Settings.sta_active +1, Settings.sta_ssid[Settings.sta_active], WiFi.BSSIDstr().c_str(), WiFi.channel(), WifiGetRssiAsQuality(WiFi.RSSI()));
}
boolean MqttShowSensor()
@@ -1567,6 +1567,11 @@ void PerformEverySecond()
{
uptime++;
+ if (BOOT_LOOP_TIME == uptime) {
+ RtcSettings.fast_reboot_count = 0;
+ RtcSettingsSave();
+ }
+
if ((4 == uptime) && (SONOFF_IFAN02 == Settings.module)) { // Microcontroller needs 3 seconds before accepting commands
SetDevicePower(1, SRC_RETRY); // Sync with default power on state microcontroller being Light ON and Fan OFF
SetDevicePower(power, SRC_RETRY); // Set required power on state
@@ -2313,7 +2318,7 @@ void GpioInit()
pin[i] = 99;
}
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
- mpin = my_module.gp.io[i];
+ mpin = ValidGPIO(i, my_module.gp.io[i]);
// snprintf_P(log_data, sizeof(log_data), PSTR("DBG: gpio pin %d, mpin %d"), i, mpin);
// AddLog(LOG_LEVEL_DEBUG);
@@ -2323,7 +2328,7 @@ void GpioInit()
bitSet(switch_no_pullup, mpin - GPIO_SWT1_NP);
mpin -= (GPIO_SWT1_NP - GPIO_SWT1);
}
- if ((mpin >= GPIO_KEY1_NP) && (mpin < (GPIO_KEY1_NP + MAX_KEYS))) {
+ else if ((mpin >= GPIO_KEY1_NP) && (mpin < (GPIO_KEY1_NP + MAX_KEYS))) {
bitSet(key_no_pullup, mpin - GPIO_KEY1_NP);
mpin -= (GPIO_KEY1_NP - GPIO_KEY1);
}
@@ -2486,6 +2491,11 @@ void setup()
{
byte idx;
+ RtcSettingsLoad();
+ if (!RtcSettingsExtendedValid()) { RtcSettings.fast_reboot_count = 0; }
+ RtcSettings.fast_reboot_count++;
+ RtcSettingsSave();
+
Serial.begin(baudrate);
delay(10);
Serial.println();
@@ -2517,10 +2527,28 @@ void setup()
save_data_counter = Settings.save_data;
sleep = Settings.sleep;
- if ((resetInfo.reason == REASON_WDT_RST) || (resetInfo.reason == REASON_EXCEPTION_RST) || (resetInfo.reason == REASON_SOFT_WDT_RST) || OsWatchBlockedLoop()) {
- for (byte i = 0; i < MAX_RULE_SETS; i++) {
- if (bitRead(Settings.rule_stop, i)) { bitWrite(Settings.rule_enabled, i, 0); }
+ // Disable functionality as possible cause of fast restart within BOOT_LOOP_TIME seconds (Exception, WDT or restarts)
+ if (RtcSettings.fast_reboot_count > 1) { // Restart twice
+ Settings.flag3.user_esp8285_enable = 0; // Disable ESP8285 Generic GPIOs interfering with flash SPI
+ if (RtcSettings.fast_reboot_count > 2) { // Restart 3 times
+ for (byte i = 0; i < MAX_RULE_SETS; i++) {
+ if (bitRead(Settings.rule_stop, i)) {
+ bitWrite(Settings.rule_enabled, i, 0); // Disable rules causing boot loop
+ }
+ }
}
+ if (RtcSettings.fast_reboot_count > 3) { // Restarted 4 times
+ Settings.rule_enabled = 0; // Disable all rules
+ }
+ if (RtcSettings.fast_reboot_count > 4) { // Restarted 5 times
+ Settings.module = SONOFF_BASIC; // Reset module to Sonoff Basic
+ Settings.last_module = SONOFF_BASIC;
+ for (byte i = 0; i < MAX_GPIO_PIN; i++) {
+ Settings.my_gp.io[i] = GPIO_NONE; // Reset user defined GPIO disabling sensors
+ }
+ }
+ snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_APPLICATION D_LOG_SOME_SETTINGS_RESET " (%d)"), RtcSettings.fast_reboot_count);
+ AddLog(LOG_LEVEL_DEBUG);
}
Settings.bootcount++;
diff --git a/sonoff/sonoff_template.h b/sonoff/sonoff_template.h
index 180c24aec..8d3fac176 100644
--- a/sonoff/sonoff_template.h
+++ b/sonoff/sonoff_template.h
@@ -136,6 +136,9 @@ enum ProgramSelectablePins {
GPIO_DI, // my92x1 PWM input
GPIO_DCKI, // my92x1 CLK input
GPIO_ARIRFRCV, // AliLux RF Receive input
+ GPIO_MCP39_TX, // MCP39F501 Serial output
+ GPIO_MCP39_RX, // MCP39F501 Serial input
+ GPIO_MCP39_RST, // MCP39F501 Serial reset
GPIO_USER, // User configurable
GPIO_MAX };
@@ -220,13 +223,15 @@ enum SupportedModules {
SONOFF_POW_R2,
SONOFF_IFAN02,
BLITZWOLF_BWSHP2,
+ SHELLY1,
+ SHELLY2,
MAXMODULE };
/********************************************************************************************/
#define MAX_GPIO_PIN 18 // Number of supported GPIO
-const char PINS_WEMOS[] PROGMEM = "D3TXD4RXD2D1flashcontrolD6D7D5D8D0A0";
+const char PINS_WEMOS[] PROGMEM = "D3TXD4RXD2D1flashcFLFLolD6D7D5D8D0A0";
typedef struct MYIO {
uint8_t io[MAX_GPIO_PIN];
@@ -271,6 +276,8 @@ const uint8_t kNiceList[MAXMODULE] PROGMEM = {
LUANIHVIO,
YUNSHAN,
WION,
+ SHELLY1,
+ SHELLY2,
BLITZWOLF_BWSHP2,
H801,
MAGICHOME,
@@ -514,7 +521,10 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
GPIO_USER, // GPIO03 RX Serial TXD and Optional sensor
GPIO_USER, // GPIO04 D2 Wemos I2C SDA
GPIO_USER, // GPIO05 D1 Wemos I2C SCL / Wemos Relay Shield (0 = Off, 1 = On) / Wemos WS2812B RGB led Shield
- 0, 0, 0, 0, 0, 0, // Flash connection
+ 0, 0, 0, // Flash connection
+ GPIO_USER, // Flash connection or GPIO09 on ESP8285 only!
+ GPIO_USER, // Flash connection or GPIO10 on ESP8285 only!
+ 0, // Flash connection
GPIO_USER, // GPIO12 D6
GPIO_USER, // GPIO13 D7
GPIO_USER, // GPIO14 D5
@@ -903,6 +913,27 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
GPIO_HLW_CF1, // GPIO14 BL0937 or HJL-01 CF1 voltage / current
GPIO_REL1, // GPIO15 Relay (0 = Off, 1 = On)
0, 0
+ },
+ { "Shelly 1", // Shelly1 Open Source (ESP8266 - 2MB) - https://shelly.cloud/shelly1-open-source/
+ 0, 0, 0, 0,
+ GPIO_REL1, // GPIO04 Relay (0 = Off, 1 = On)
+ GPIO_SWT1_NP, // GPIO05 SW pin
+ 0, 0, 0, 0, 0, 0, // Flash connection
+ 0, 0, 0, 0, 0, 0
+ },
+ { "Shelly 2", // Shelly2 (ESP8266 - 2MB) - https://shelly.cloud/shelly2/
+ 0,
+ GPIO_MCP39_RX, // GPIO01 MCP39F501 Serial input
+ 0,
+ GPIO_MCP39_TX, // GPIO03 MCP39F501 Serial output
+ GPIO_REL1, // GPIO04
+ GPIO_REL2, // GPIO05
+ 0, 0, 0, 0, 0, 0, // Flash connection
+ GPIO_SWT1_NP, // GPIO12
+ 0,
+ GPIO_SWT2_NP, // GPIO14
+ GPIO_MCP39_RST, // GPIO15 MCP39F501 Reset
+ 0, 0
}
};
@@ -985,8 +1016,7 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
GPIO_USER, // GPIO15 (D15)
GPIO_USER, // GPIO16 (D16)
0 // ADC0 Analog input (A0)
- },
-
+ }
*/
#endif // _SONOFF_TEMPLATE_H_
\ No newline at end of file
diff --git a/sonoff/sonoff_version.h b/sonoff/sonoff_version.h
index f351b547d..c3ea9381e 100644
--- a/sonoff/sonoff_version.h
+++ b/sonoff/sonoff_version.h
@@ -20,7 +20,7 @@
#ifndef _SONOFF_VERSION_H_
#define _SONOFF_VERSION_H_
-#define VERSION 0x0601010D
+#define VERSION 0x06020001
#define D_PROGRAMNAME "Sonoff-Tasmota"
#define D_AUTHOR "Theo Arends"
diff --git a/sonoff/support.ino b/sonoff/support.ino
index 87cd49edb..8aaeabf88 100644
--- a/sonoff/support.ino
+++ b/sonoff/support.ino
@@ -143,7 +143,7 @@ char* subStr(char* dest, char* str, const char *delim, int index)
int i;
// Since strtok consumes the first arg, make a copy
- strncpy(dest, str, strlen(str));
+ strlcpy(dest, str, strlen(str));
for (i = 1, act = dest; i <= index; i++, act = NULL) {
sub = strtok_r(act, delim, &ptr);
if (sub == NULL) break;
@@ -157,7 +157,7 @@ double CharToDouble(char *str)
// simple ascii to double, because atof or strtod are too large
char strbuf[24];
- strcpy(strbuf, str);
+ strlcpy(strbuf, str, sizeof(strbuf));
char *pt;
double left = atoi(strbuf);
double right = 0;
@@ -561,13 +561,13 @@ int GetStateNumber(char *state_text)
char command[CMDSZ];
int state_number = -1;
- if ((GetCommandCode(command, sizeof(command), state_text, kOptionOff) >= 0) || !strcasecmp(state_text, Settings.state_text[0])) {
+ if (GetCommandCode(command, sizeof(command), state_text, kOptionOff) >= 0) {
state_number = 0;
}
- else if ((GetCommandCode(command, sizeof(command), state_text, kOptionOn) >= 0) || !strcasecmp(state_text, Settings.state_text[1])) {
+ else if (GetCommandCode(command, sizeof(command), state_text, kOptionOn) >= 0) {
state_number = 1;
}
- else if ((GetCommandCode(command, sizeof(command), state_text, kOptionToggle) >= 0) || !strcasecmp(state_text, Settings.state_text[2])) {
+ else if (GetCommandCode(command, sizeof(command), state_text, kOptionToggle) >= 0) {
state_number = 2;
}
else if (GetCommandCode(command, sizeof(command), state_text, kOptionBlink) >= 0) {
@@ -717,6 +717,15 @@ void ShowSource(int source)
}
}
+uint8_t ValidGPIO(uint8_t pin, uint8_t gpio)
+{
+ uint8_t result = gpio;
+ if ((WEMOS == Settings.module) && (!Settings.flag3.user_esp8285_enable)) {
+ if ((pin == 9) || (pin == 10)) { result = GPIO_NONE; } // Disable possible flash GPIO9 and GPIO10
+ }
+ return result;
+}
+
/*********************************************************************************************\
* Sleep aware time scheduler functions borrowed from ESPEasy
\*********************************************************************************************/
diff --git a/sonoff/user_config.h b/sonoff/user_config.h
index f35c7f2be..a8457ff97 100644
--- a/sonoff/user_config.h
+++ b/sonoff/user_config.h
@@ -301,11 +301,11 @@
// #define USE_CCS811 // Enable CCS811 sensor (I2C address 0x5A) (+2k2 code)
// #define USE_MPU6050 // Enable MPU6050 sensor (I2C address 0x68 AD0 low or 0x69 AD0 high) (+2k6 code)
-// #define USE_DISPLAY // Add I2C Display Support for LCD, Oled and up to eigth Matrices (+19k code)
+// #define USE_DISPLAY // Add I2C Display Support (+2k code)
#define USE_DISPLAY_MODES1TO5 // Enable display mode 1 to 5 in addition to mode 0
- #define USE_DISPLAY_LCD // [DisplayModel 1] Enable Lcd display (I2C addresses 0x27 and 0x3F)
- #define USE_DISPLAY_SSD1306 // [DisplayModel 2] Enable SSD1306 Oled 128x64 display (I2C addresses 0x3C and 0x3D)
- #define USE_DISPLAY_MATRIX // [DisplayModel 3] Enable 8x8 Matrix display (I2C adresseses see below)
+ #define USE_DISPLAY_LCD // [DisplayModel 1] Enable Lcd display (I2C addresses 0x27 and 0x3F) (+6k code)
+ #define USE_DISPLAY_SSD1306 // [DisplayModel 2] Enable SSD1306 Oled 128x64 display (I2C addresses 0x3C and 0x3D) (+16k code)
+ #define USE_DISPLAY_MATRIX // [DisplayModel 3] Enable 8x8 Matrix display (I2C adresseses see below) (+11k code)
#define MTX_ADDRESS1 0x71 // [DisplayAddress1] I2C address of first 8x8 matrix module
#define MTX_ADDRESS2 0x74 // [DisplayAddress2] I2C address of second 8x8 matrix module
#define MTX_ADDRESS3 0x75 // [DisplayAddress3] I2C address of third 8x8 matrix module
@@ -324,9 +324,8 @@
#ifndef USE_DISPLAY
#define USE_DISPLAY // Add SPI Display support for 320x240 and 480x320 TFT
#endif
- #define USE_DISPLAY_ILI9341 // [DisplayModel 4] Enable ILI9341 Tft 480x320 display
-// #define USE_DISPLAY_EPAPER // [DisplayModel 5] Enable e-paper display
-
+ #define USE_DISPLAY_ILI9341 // [DisplayModel 4] Enable ILI9341 Tft 480x320 display (+19k code)
+// #define USE_DISPLAY_EPAPER // [DisplayModel 5] Enable e-paper display (+19k code)
#endif // USE_SPI
// -- Serial sensors ------------------------------
@@ -367,30 +366,15 @@
//#define USE_DEBUG_DRIVER // Use xdrv_99_debug.ino providing commands CpuChk, CfgXor, CfgDump, CfgPeek and CfgPoke
/*********************************************************************************************\
- * Select features and sensors enabled in previous version saving space
+ * Optional firmware configurations
+ * Select none or just one for optional features and sensors as configured in sonoff_post.h
+ * See RELEASENOTES.md for selected features
\*********************************************************************************************/
-//#define USE_CLASSIC // Create sonoff-classic (See sonoff_post.h for selected features)
-
-/*********************************************************************************************\
- * Select useful sensors - overrides above undefines!!
-\*********************************************************************************************/
-
-//#define USE_SENSORS // Create sonoff-sensors with useful sensors enabled (See sonoff_post.h for selected sensors)
-
-/*********************************************************************************************\
- * Select KNX without Emulation to save space
-\*********************************************************************************************/
-
-//#define USE_KNX_NO_EMULATION // Create sonoff-knx with KNX but without Emulation (See sonoff_post.h)
-
-/*********************************************************************************************\
- * Compile a minimal version if upgrade memory gets tight ONLY TO BE USED FOR UPGRADE STEP 1!
- * To be used as step 1 during upgrade.
- * Step 2 is re-compile with option BE_MINIMAL commented out.
-\*********************************************************************************************/
-
-//#define BE_MINIMAL // Minimal version if upgrade memory gets tight (-45k code, -2k mem)
+//#define USE_CLASSIC // Create sonoff-classic with initial configuration tools WPS, SmartConfig and WifiManager
+//#define USE_SENSORS // Create sonoff-sensors with useful sensors enabled
+//#define USE_KNX_NO_EMULATION // Create sonoff-knx with KNX but without Emulation
+//#define BE_MINIMAL // Create sonoff-minimal as intermediate firmware for OTA-MAGIC
/*********************************************************************************************\
* No user configurable items below
diff --git a/sonoff/xdrv_02_webserver.ino b/sonoff/xdrv_02_webserver.ino
index 64c138a56..951c25f9d 100644
--- a/sonoff/xdrv_02_webserver.ino
+++ b/sonoff/xdrv_02_webserver.ino
@@ -254,7 +254,7 @@ const char HTTP_FORM_MODULE[] PROGMEM =
""
"
" D_MODULE_TYPE " ({mt)
";
const char HTTP_LNK_ITEM[] PROGMEM =
- "
%s " D_GPIO "%d %s | |
, {m} = | , {e} = |
---|