diff --git a/README.md b/README.md index 6e30dd0f9..a5ad618e8 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.1.4** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information. +Current version is **5.1.5** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information. ### **** ATTENTION Version 5.x.x specific information **** diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index dcbf8d359..36a3d3617 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,9 +1,13 @@ -/* 5.1.4 20170601 +/* 5.1.5 20170604 + * Shrink code in preparation to ESP8266-Arduino 2.4.0-rc1 + * Add effect parameter to HUE Device (#464) + * + * 5.1.4 20170601 * Removed pre-compiled versions from repository as they are available within the release * Changed HUE Device type to color supporting version (#464) * Fix compile error when BE_MINIMAL is selected (#467, #476) * Add multiple compiled versions to release using updated Travis script and platformio.ini (#467) - * + * * 5.1.3 20170520 * Add Domoticz Counter * diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index e7528ecf7..b4a3bc623 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -24,7 +24,7 @@ - Select IDE Tools - Flash size: "1M (no SPIFFS)" ====================================================*/ -#define VERSION 0x05010400 // 5.1.4 +#define VERSION 0x05010500 // 5.1.5 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}; @@ -165,6 +165,7 @@ enum butt_t {PRESSED, NOT_PRESSED}; #include // MQTT, Ota, WifiManager #include // MQTT, Ota #include // Ota +#include // Webserver, Updater #include // WemoHue, IRremote, Domoticz #ifdef USE_WEBSERVER #include // WifiManager, Webserver diff --git a/sonoff/webserver.ino b/sonoff/webserver.ino index 12f2c630c..1f62a2987 100644 --- a/sonoff/webserver.ino +++ b/sonoff/webserver.ino @@ -81,6 +81,7 @@ const char HTTP_HEAD[] PROGMEM = "td{padding:0px;}" "button{border:0;border-radius:0.3rem;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%;-webkit-transition-duration:0.4s;transition-duration:0.4s;}" "button:hover{background-color:#006cba;}" + ".q{float:right;width:200px;text-align:right;}" "" "" @@ -131,12 +132,6 @@ const char HTTP_SCRIPT_MODULE[] PROGMEM = "}" "function sl(){" "var o0=\""; -const char HTTP_LNK_STYLE[] PROGMEM = - ".q{float:right;width:64px;text-align:right;}" - ".l{background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAALVBMVEX///8EBwfBwsLw8PAzNjaCg4NTVVUjJiZDRUUUFxdiZGSho6O" - "Sk5Pg4eFydHTCjaf3AAAAZElEQVQ4je2NSw7AIAhEBamKn97/uMXEGBvozkWb9C2Zx4xzWykBhFAeYp9gkLyZE0zIMno9n4g19hmdY39scwqVkOXaxph0ZCXQcqxSpgQpONa59wkRDOL93eA" - "XvimwlbPbwwVAegLS1HGfZAAAAABJRU5ErkJggg==') no-repeat left center;background-size:1em;}" - ""; const char HTTP_MSG_RSTRT[] PROGMEM = "
Device will restart in a few seconds

"; const char HTTP_BTN_MENU1[] PROGMEM = @@ -170,7 +165,7 @@ const char HTTP_FORM_MODULE[] PROGMEM = "" "
Module type ({mt})

"; #ifdef USE_EMULATION -const char HTTP_FORM_OTHER3[] PROGMEM = - "
 Emulation " - "
None" - "
Belkin WeMo single device" - "
Hue Bridge multi devices
"; +const char HTTP_FORM_OTHER3a[] PROGMEM = + "
 Emulation "; +const char HTTP_FORM_OTHER3b[] PROGMEM = + "
{3{4"; #endif // USE_EMULATION const char HTTP_FORM_END[] PROGMEM = "
"; @@ -668,7 +662,6 @@ void handleWifi(boolean scan) String page = FPSTR(HTTP_HEAD); page.replace(F("{v}"), F("Configure Wifi")); - page.replace(F(""), FPSTR(HTTP_LNK_STYLE)); if (scan) { #ifdef USE_EMULATION @@ -729,11 +722,8 @@ void handleWifi(boolean scan) rssiQ += quality; item.replace(F("{v}"), WiFi.SSID(indices[i])); item.replace(F("{r}"), rssiQ); - if (WiFi.encryptionType(indices[i]) != ENC_TYPE_NONE) { - item.replace(F("{i}"), F("l")); - } else { - item.replace(F("{i}"), ""); - } + uint8_t auth = WiFi.encryptionType(indices[i]); + item.replace(F("{i}"), (ENC_TYPE_WEP == auth) ? F("WEP") : (ENC_TYPE_TKIP == auth) ? F("WPA PSK") : (ENC_TYPE_CCMP == auth) ? F("WPA2 PSK") : (ENC_TYPE_AUTO == auth) ? F("AUTO") : F("")); page += item; delay(0); } else { @@ -853,10 +843,15 @@ void handleOther() page.replace(F("{2"), FRIENDLY_NAME); page.replace(F("{3"), sysCfg.friendlyname[0]); #ifdef USE_EMULATION - page += FPSTR(HTTP_FORM_OTHER3); - page.replace(F("{r2}"), (EMUL_NONE == sysCfg.flag.emulation) ? F(" checked") : F("")); - page.replace(F("{r3}"), (EMUL_WEMO == sysCfg.flag.emulation) ? F(" checked") : F("")); - page.replace(F("{r4}"), (EMUL_HUE == sysCfg.flag.emulation) ? F(" checked") : F("")); + page += FPSTR(HTTP_FORM_OTHER3a); + for (byte i = 0; i < EMUL_MAX; i++) { + page += FPSTR(HTTP_FORM_OTHER3b); + page.replace(F("{1"), String(i)); + page.replace(F("{2"), (i == sysCfg.flag.emulation) ? F(" checked") : F("")); + page.replace(F("{3"), (i == EMUL_NONE) ? F("None") : (i == EMUL_WEMO) ? F("Belkin WeMo") : F("Hue Bridge")); + page.replace(F("{4"), (i == EMUL_NONE) ? F("") : (i == EMUL_WEMO) ? F(" single device") : F(" multi devices")); + } + page += F("
"); for (int i = 1; i < Maxdevice; i++) { page += FPSTR(HTTP_FORM_OTHER2); page.replace(F("{1"), String(i +1)); @@ -1131,25 +1126,21 @@ void handleUploadDone() page += F("
Upload "); if (_uploaderror) { page += F("failed

"); + if (!_uploadfiletype && Update.hasError()) { + StreamString str; + Update.printError(str); + snprintf_P(error, sizeof(error), str.c_str()); + } else { + snprintf_P(error, sizeof(error), PSTR("Upload error code %d"), _uploaderror); + } switch (_uploaderror) { case 1: strcpy_P(error, PSTR("No file selected")); break; - case 2: strcpy_P(error, PSTR("File size is larger than available free space")); break; - case 3: strcpy_P(error, PSTR("File magic header does not start with 0xE9")); break; - case 4: strcpy_P(error, PSTR("File flash size is larger than device flash size")); break; - case 5: strcpy_P(error, PSTR("File upload buffer miscompare")); break; - case 6: strcpy_P(error, PSTR("Upload failed. Enable logging option 3 for more information")); break; case 7: strcpy_P(error, PSTR("Upload aborted")); break; case 8: strcpy_P(error, PSTR("Invalid configuration file")); break; case 9: strcpy_P(error, PSTR("Configuration file too large")); break; - default: - snprintf_P(error, sizeof(error), PSTR("Upload error code %d"), _uploaderror); } page += error; - if (!_uploadfiletype && Update.hasError()) { - page += F("

Update error code (see Updater.cpp) "); - page += String(Update.getError()); - } - snprintf_P(log, sizeof(log), PSTR("Upload: Error - %s"), error); + snprintf_P(log, sizeof(log), PSTR("Upload: %s"), error); addLog(LOG_LEVEL_DEBUG, log); } else { page += F("successful

Device will restart in a few seconds"); @@ -1196,9 +1187,6 @@ void handleUploadLoop() } uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000; if (!Update.begin(maxSketchSpace)) { //start with max available size - if (_serialoutput) { - Update.printError(Serial); - } _uploaderror = 2; return; } @@ -1244,9 +1232,6 @@ void handleUploadLoop() } } else { // firmware if (!_uploaderror && (Update.write(upload.buf, upload.currentSize) != upload.currentSize)) { - if (_serialoutput) { - Update.printError(Serial); - } _uploaderror = 5; return; } @@ -1264,9 +1249,6 @@ void handleUploadLoop() } if (!_uploadfiletype) { if (!Update.end(true)) { // true to set the size to the current progress - if (_serialoutput) { - Update.printError(Serial); - } _uploaderror = 6; return; } diff --git a/sonoff/xdrv_wemohue.ino b/sonoff/xdrv_wemohue.ino index 3d4c3c4c0..d4cffd8d0 100644 --- a/sonoff/xdrv_wemohue.ino +++ b/sonoff/xdrv_wemohue.ino @@ -305,6 +305,7 @@ const char HUE_LIGHT_STATUS_JSON[] PROGMEM = "\"ct\":500," "\"xy\":[0.5, 0.5]," "\"alert\":\"none\"," + "\"effect\":\"none\"," "\"colormode\":\"hs\"," "\"reachable\":true" "},"