From fa0b7d778498784c4ec34abf9323ec78ac9e9751 Mon Sep 17 00:00:00 2001 From: arendst Date: Fri, 18 Aug 2017 14:52:57 +0200 Subject: [PATCH] v5.6.0 5.6.0 20170818 * Fix Sonoff Pow intermittent exception 0 * Change Sonoff Pow sending Domoticz telemetry data only * Add Ai-Thinker RGBW led (AiLight) (experimental) * Add NeoPixelBus library to Sonoff Led for Hue support * Add user configurable GPIO4 and GPIO5 to module Sonoff Bridge * Add Sonoff B1 RGBCW led support with command Color RRGGBBCCWW (#676) * Add command CT 152..500 to Sonoff Led and Sonoff B1 to control Color Temperature * Add Cold-Warm slider to web page for Sonoff Led and Sonoff B1 * Add CT parameter to Hue * Add Sonoff T1 support (#582) * Add AnalogInput0 if configured as Analog Input to webpage (#697, #746) * Add command SetOption14 0|1 to enable interlock mode (#719, #721) * Fix Mitsubishi HVAC IR power controll (#740) --- README.md | 4 ++-- sonoff/_releasenotes.ino | 12 ++++++------ sonoff/sonoff.ino | 9 ++------- sonoff/support.ino | 10 ++++++++++ sonoff/webserver.ino | 8 +++++++- 5 files changed, 27 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 36513d374..272975e3b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## Sonoff-Tasmota Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE. -Current version is **5.5.2k** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information. +Current version is **5.6.0** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information. ### ATTENTION All versions @@ -9,7 +9,7 @@ Only Flash Mode DOUT is supported. Do not use Flash Mode DIO / QIO / QOUT as it See [Wiki](https://github.com/arendst/Sonoff-Tasmota/wiki/Theo's-Tasmota-Tips) for background information. -### ATTENTION Version 5.x.x specific information +### ATTENTION Version 5 specific information This version uses a new linker script to free flash memory for future code additions. It moves the settings from Spiffs to Eeprom. If you compile your own firmware download the new linker to your IDE or Platformio base folder. See [Wiki > Prerequisite](https://github.com/arendst/Sonoff-Tasmota/wiki/Prerequisite). diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 046deffe6..64fbef156 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,17 +1,17 @@ -/* 5.5.2k +/* 5.6.0 20170818 * Fix Sonoff Pow intermittent exception 0 * Change Sonoff Pow sending Domoticz telemetry data only + * Add Ai-Thinker RGBW led (AiLight) (experimental) + * Add NeoPixelBus library to Sonoff Led for Hue support + * Add user configurable GPIO4 and GPIO5 to module Sonoff Bridge * Add Sonoff B1 RGBCW led support with command Color RRGGBBCCWW (#676) * Add command CT 152..500 to Sonoff Led and Sonoff B1 to control Color Temperature * Add Cold-Warm slider to web page for Sonoff Led and Sonoff B1 * Add CT parameter to Hue - * Add Ai-Thinker RGBW led (AiLight) (experimental) - * Add NeoPixelBus library to Sonoff Led for Hue support (saves 1k code space) - * Add user configurable GPIO4 and GPIO5 to module Sonoff Bridge - * Fix Mitsubishi HVAC IR power controll (#740) * Add Sonoff T1 support (#582) - * Change Sonoff T1 command Ledstate functionality by turning led on if power is off + * Add AnalogInput0 if configured as Analog Input to webpage (#697, #746) * Add command SetOption14 0|1 to enable interlock mode (#719, #721) + * Fix Mitsubishi HVAC IR power controll (#740) * * 5.5.2 20170808 * Extent max number of WS2812 pixels from 256 to 512 (#667) diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 48df04fb2..25f79ab64 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -25,7 +25,7 @@ - Select IDE Tools - Flash Size: "1M (no SPIFFS)" ====================================================*/ -#define VERSION 0x0505020B // 5.5.2k +#define VERSION 0x05060000 // 5.6.0 enum log_t {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE, LOG_LEVEL_ALL}; enum week_t {Last, First, Second, Third, Fourth}; @@ -1887,12 +1887,7 @@ void sensors_mqttPresent(char* svalue, uint16_t ssvalue, uint8_t* djson) counter_mqttPresent(svalue, ssvalue, djson); #ifndef USE_ADC_VCC if (pin[GPIO_ADC0] < 99) { - uint16_t alr = 0; - for (byte i = 0; i < 32; i++) { - alr += analogRead(A0); - delay(1); - } - snprintf_P(svalue, ssvalue, PSTR("%s, \"AnalogInput0\":%d"), svalue, alr >> 5); + snprintf_P(svalue, ssvalue, PSTR("%s, \"AnalogInput0\":%d"), svalue, getAdc0()); *djson = 1; } #endif diff --git a/sonoff/support.ino b/sonoff/support.ino index e7e98783e..cdf7047a8 100644 --- a/sonoff/support.ino +++ b/sonoff/support.ino @@ -1047,6 +1047,16 @@ char tempUnit() return (sysCfg.flag.temperature_conversion) ? 'F' : 'C'; } +uint16_t getAdc0() +{ + uint16_t alr = 0; + for (byte i = 0; i < 32; i++) { + alr += analogRead(A0); + delay(1); + } + return alr >> 5; +} + /*********************************************************************************************\ * Syslog \*********************************************************************************************/ diff --git a/sonoff/webserver.ino b/sonoff/webserver.ino index a8bf0bba2..4455a7dfa 100644 --- a/sonoff/webserver.ino +++ b/sonoff/webserver.ino @@ -474,7 +474,7 @@ void handleRoot() void handleAjax2() { - char svalue[16]; + char svalue[50]; if (strlen(webServer->arg("o").c_str())) { do_cmnd_power(atoi(webServer->arg("o").c_str()), 2); @@ -494,6 +494,12 @@ void handleAjax2() String tpage = ""; tpage += counter_webPresent(); +#ifndef USE_ADC_VCC + if (pin[GPIO_ADC0] < 99) { + snprintf_P(svalue, sizeof(svalue), PSTR("AnalogInput0%d"), getAdc0()); + tpage += svalue; + } +#endif if (hlw_flg) { tpage += hlw_webPresent(); }