Skip to content

Commit

Permalink
v5.8.0
Browse files Browse the repository at this point in the history
5.8.0 20170918
 * Remove the need for NeoPixelBus library for Hue
support
 * Consolidate WS2812 into Sonoff Led for flexible future led
strip library changes
 * Invert WS2812 fade speed to align with Sonoff
led (Speed 1 = fast, Speed 8 = slow)
 * Remove upper case MQTT receive
buffer
 * Reduce code and string length for output of commands Modules
and GPIOs
 * Add Sonoff SC debug information
 * Change syslog service
 *
Removed webserver syslog disable as now no longer needed
 * Increased
default MQTT message size from 368 to 405 bytes while keeping
MQTT_MAX_PACKET_SIZE = 512 (because we can)
 * Fix MQTT Offline or
Remove MQTT retained topic code
 * Fix Domoticz loop when Emulation is
selected
 * Add blink to WS2812 and Sonoff Led (#643)
 * Add option
WIFI_WAIT (5) to command WifiConfig to allow connection retry to same AP
without restart or update flash (#772, #869)
 * Add support for Witty
Cloud (#794)
 * Add GPIO14 to Sonoff Dual (#797, #839)
 * Add support
for Yunshan Wifi Relay (#802)
 * Add GPIO16 input pulldown (#827)
 * Add
timeout to DHT and DS18B20 sensors (#852)
 * Fix watchdog timeout caused
by lack of stack space by moving to heap (#853)
 * Allow LogPort and
MqttPort up to 65535 and add LogPort tot Status 3 (#859)
 * Allow
command SwitchTopic in group mode (#861)
 * Allow command SwitchMode if
no switches are defined (#861)
 * Add optional dimmer parameter to
command Wakeup for WS2812, AiLight, Sonoff B1, Led and BN-SZ01 (#867)
 *
Fix basic On, Off, Toggle, Blink and BlinkOff commands when other
language is selected (#874)
  • Loading branch information
arendst committed Sep 18, 2017
1 parent 41f1004 commit af942a2
Show file tree
Hide file tree
Showing 27 changed files with 1,161 additions and 1,272 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.7.1** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information.
Current version is **5.8.0** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information.

### ATTENTION All versions

Expand Down
28 changes: 27 additions & 1 deletion sonoff/_releasenotes.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
/* 5.7.1 20170909
/* 5.8.0 20170918
* Remove the need for NeoPixelBus library for Hue support
* Consolidate WS2812 into Sonoff Led for flexible future led strip library changes
* Invert WS2812 fade speed to align with Sonoff led (Speed 1 = fast, Speed 8 = slow)
* Remove upper case MQTT receive buffer
* Reduce code and string length for output of commands Modules and GPIOs
* Add Sonoff SC debug information
* Change syslog service
* Removed webserver syslog disable as now no longer needed
* Increased default MQTT message size from 368 to 405 bytes while keeping MQTT_MAX_PACKET_SIZE = 512 (because we can)
* Fix MQTT Offline or Remove MQTT retained topic code
* Fix Domoticz loop when Emulation is selected
* Add blink to WS2812 and Sonoff Led (#643)
* Add option WIFI_WAIT (5) to command WifiConfig to allow connection retry to same AP without restart or update flash (#772, #869)
* Add support for Witty Cloud (#794)
* Add GPIO14 to Sonoff Dual (#797, #839)
* Add support for Yunshan Wifi Relay (#802)
* Add GPIO16 input pulldown (#827)
* Add timeout to DHT and DS18B20 sensors (#852)
* Fix watchdog timeout caused by lack of stack space by moving to heap (#853)
* Allow LogPort and MqttPort up to 65535 and add LogPort tot Status 3 (#859)
* Allow command SwitchTopic in group mode (#861)
* Allow command SwitchMode if no switches are defined (#861)
* Add optional dimmer parameter to command Wakeup for WS2812, AiLight, Sonoff B1, Led and BN-SZ01 (#867)
* Fix basic On, Off, Toggle, Blink and BlinkOff commands when other language is selected (#874)
*
* 5.7.1 20170909
* Remove leading spaces from MQTT data
* Fix webconsole special character entry
* Allow # as prefix for color value
Expand Down
5 changes: 3 additions & 2 deletions sonoff/i18n.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ const char commands[MAX_BUTTON_COMMANDS][14] PROGMEM = {
D_CMND_WIFICONFIG " 3", // Press button five times
D_CMND_RESTART " 1", // Press button six times
D_CMND_UPGRADE " 1" }; // Press button seven times
const char wificfg[5][WCFG_MAX_STRING_LENGTH] PROGMEM = {
const char wificfg[MAX_WIFI_OPTION][WCFG_MAX_STRING_LENGTH] PROGMEM = {
D_WCFG_0_RESTART,
D_WCFG_1_SMARTCONFIG,
D_WCFG_2_WIFIMANAGER,
D_WCFG_3_WPSCONFIG,
D_WCFG_4_RETRY };
D_WCFG_4_RETRY,
D_WCFG_5_WAIT };
const char PREFIXES[3][PRFX_MAX_STRING_LENGTH] PROGMEM = {
D_CMND,
D_STAT,
Expand Down
5 changes: 4 additions & 1 deletion sonoff/language/en-GB.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
#define D_TOGGLE "Toggle"
#define D_TOPIC "Topic"
#define D_TOTAL "Total"
#define D_TRANSMIT "Transmit"
#define D_TRUE "True"
#define D_TYPE "Type"
#define D_UNKNOWN "Unknown"
Expand Down Expand Up @@ -478,7 +479,7 @@
#define D_LOG_APPLICATION "APP: "
#define D_LOG_BRIDGE "BRG: "
#define D_LOG_CONFIG "CFG: "
#define D_LOG_COMMAND "CND: "
#define D_LOG_COMMAND "CMD: "
#define D_LOG_DHT "DHT: "
#define D_LOG_DOMOTICZ "DOM: "
#define D_LOG_DSB "DSB: "
Expand All @@ -494,6 +495,7 @@
#define D_LOG_UPLOAD "UPL: "
#define D_LOG_UPNP "UPP: "
#define D_LOG_WIFI "WIF: "
#define D_LOG_SERIAL "SER: "

// Result
#define D_RSLT_RESULT "RESULT"
Expand Down Expand Up @@ -587,6 +589,7 @@
#define D_WCFG_2_WIFIMANAGER "WifiManager"
#define D_WCFG_3_WPSCONFIG "WPSConfig"
#define D_WCFG_4_RETRY "Retry"
#define D_WCFG_5_WAIT "Wait"
#define D_CMND_FRIENDLYNAME "FriendlyName"
#define D_CMND_SWITCHMODE "SwitchMode"
#define D_CMND_WEBSERVER "Webserver"
Expand Down
5 changes: 4 additions & 1 deletion sonoff/language/nl-NL.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
#define D_TOGGLE "Toggle" // Wissel, Tuimel
#define D_TOPIC "Topic" // Onderwerp
#define D_TOTAL "Totaal"
#define D_TRANSMIT "Verzend"
#define D_TRUE "Waar"
#define D_TYPE "Soort"
#define D_UNKNOWN "Onbekend"
Expand Down Expand Up @@ -478,7 +479,7 @@
#define D_LOG_APPLICATION "APP: "
#define D_LOG_BRIDGE "BRG: "
#define D_LOG_CONFIG "CFG: "
#define D_LOG_COMMAND "CND: "
#define D_LOG_COMMAND "CMD: "
#define D_LOG_DHT "DHT: "
#define D_LOG_DOMOTICZ "DOM: "
#define D_LOG_DSB "DSB: "
Expand All @@ -494,6 +495,7 @@
#define D_LOG_UPLOAD "UPL: "
#define D_LOG_UPNP "UPP: "
#define D_LOG_WIFI "WIF: "
#define D_LOG_SERIAL "SER: "

// Result
#define D_RSLT_RESULT "RESULTAAT"
Expand Down Expand Up @@ -587,6 +589,7 @@
#define D_WCFG_2_WIFIMANAGER "WifiManager"
#define D_WCFG_3_WPSCONFIG "WPSConfig"
#define D_WCFG_4_RETRY "Opnieuw"
#define D_WCFG_5_WAIT "Wacht"
#define D_CMND_FRIENDLYNAME "FriendlyName"
#define D_CMND_SWITCHMODE "SwitchMode"
#define D_CMND_WEBSERVER "Webserver"
Expand Down
91 changes: 55 additions & 36 deletions sonoff/settings.ino
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void RTC_Dump()
{
#define CFG_COLS 16

char log[LOGSZ];
uint16_t idx;
uint16_t maxrow;
uint16_t row;
Expand All @@ -93,22 +92,22 @@ void RTC_Dump()

for (row = 0; row < maxrow; row++) {
idx = row * CFG_COLS;
snprintf_P(log, sizeof(log), PSTR("%04X:"), idx);
snprintf_P(log_data, sizeof(log_data), PSTR("%04X:"), idx);
for (col = 0; col < CFG_COLS; col++) {
if (!(col%4)) {
snprintf_P(log, sizeof(log), PSTR("%s "), log);
snprintf_P(log_data, sizeof(log_data), PSTR("%s "), log_data);
}
snprintf_P(log, sizeof(log), PSTR("%s %02X"), log, buffer[idx + col]);
snprintf_P(log_data, sizeof(log_data), PSTR("%s %02X"), log_data, buffer[idx + col]);
}
snprintf_P(log, sizeof(log), PSTR("%s |"), log);
snprintf_P(log_data, sizeof(log_data), PSTR("%s |"), log_data);
for (col = 0; col < CFG_COLS; col++) {
// if (!(col%4)) {
// snprintf_P(log, sizeof(log), PSTR("%s "), log);
// snprintf_P(log_data, sizeof(log_data), PSTR("%s "), log_data);
// }
snprintf_P(log, sizeof(log), PSTR("%s%c"), log, ((buffer[idx + col] > 0x20) && (buffer[idx + col] < 0x7F)) ? (char)buffer[idx + col] : ' ');
snprintf_P(log_data, sizeof(log_data), PSTR("%s%c"), log_data, ((buffer[idx + col] > 0x20) && (buffer[idx + col] < 0x7F)) ? (char)buffer[idx + col] : ' ');
}
snprintf_P(log, sizeof(log), PSTR("%s|"), log);
addLog(LOG_LEVEL_INFO, log);
snprintf_P(log_data, sizeof(log_data), PSTR("%s|"), log_data);
addLog(LOG_LEVEL_INFO);
}
}
#endif // DEBUG_THEO
Expand Down Expand Up @@ -193,8 +192,6 @@ void CFG_Save(byte rotate)
* stop_flash_rotate 0 = Allow flash slot rotation (SetOption12 0)
* stop_flash_rotate 1 = Allow only eeprom flash slot use (SetOption12 1)
*/
char log[LOGSZ];

#ifndef BE_MINIMAL
if ((getHash() != _cfgHash) || rotate) {
if (1 == rotate) { // Use eeprom flash slot only and disable flash rotate from now on (upgrade)
Expand Down Expand Up @@ -224,9 +221,9 @@ void CFG_Save(byte rotate)
delay(1);
}
}
snprintf_P(log, sizeof(log), PSTR(D_LOG_CONFIG D_SAVED_TO_FLASH_AT " %X, " D_COUNT " %d, " D_BYTES " %d"),
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_CONFIG D_SAVED_TO_FLASH_AT " %X, " D_COUNT " %d, " D_BYTES " %d"),
_cfgLocation, sysCfg.saveFlag, sizeof(SYSCFG));
addLog(LOG_LEVEL_DEBUG, log);
addLog(LOG_LEVEL_DEBUG);
_cfgHash = getHash();
}
#endif // BE_MINIMAL
Expand All @@ -237,8 +234,6 @@ void CFG_Load()
{
/* Load configuration from eeprom or one of 7 slots below if first load does not stop_flash_rotate
*/
char log[LOGSZ];

struct SYSCFGH {
unsigned long cfg_holder;
unsigned long saveFlag;
Expand All @@ -252,17 +247,17 @@ void CFG_Load()
spi_flash_read((_cfgLocation -1) * SPI_FLASH_SEC_SIZE, (uint32*)&_sysCfgH, sizeof(SYSCFGH));
interrupts();

// snprintf_P(log, sizeof(log), PSTR("Cnfg: Check at %X with count %d and holder %X"), _cfgLocation -1, _sysCfgH.saveFlag, _sysCfgH.cfg_holder);
// addLog(LOG_LEVEL_DEBUG, log);
// snprintf_P(log_data, sizeof(log_data), PSTR("Cnfg: Check at %X with count %d and holder %X"), _cfgLocation -1, _sysCfgH.saveFlag, _sysCfgH.cfg_holder);
// addLog(LOG_LEVEL_DEBUG);

if (((sysCfg.version > 0x05000200) && sysCfg.flag.stop_flash_rotate) || (sysCfg.cfg_holder != _sysCfgH.cfg_holder) || (sysCfg.saveFlag > _sysCfgH.saveFlag)) {
break;
}
delay(1);
}
snprintf_P(log, sizeof(log), PSTR(D_LOG_CONFIG D_LOADED_FROM_FLASH_AT " %X, " D_COUNT " %d"),
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_CONFIG D_LOADED_FROM_FLASH_AT " %X, " D_COUNT " %d"),
_cfgLocation, sysCfg.saveFlag);
addLog(LOG_LEVEL_DEBUG, log);
addLog(LOG_LEVEL_DEBUG);
if (sysCfg.cfg_holder != CFG_HOLDER) {
// Auto upgrade
noInterrupts();
Expand All @@ -283,15 +278,14 @@ void CFG_Load()

void CFG_Erase()
{
char log[LOGSZ];
SpiFlashOpResult result;

uint32_t _sectorStart = (ESP.getSketchSize() / SPI_FLASH_SEC_SIZE) + 1;
uint32_t _sectorEnd = ESP.getFlashChipRealSize() / SPI_FLASH_SEC_SIZE;
boolean _serialoutput = (LOG_LEVEL_DEBUG_MORE <= seriallog_level);

snprintf_P(log, sizeof(log), PSTR(D_LOG_APPLICATION D_ERASE " %d " D_UNIT_SECTORS), _sectorEnd - _sectorStart);
addLog(LOG_LEVEL_DEBUG, log);
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_APPLICATION D_ERASE " %d " D_UNIT_SECTORS), _sectorEnd - _sectorStart);
addLog(LOG_LEVEL_DEBUG);

for (uint32_t _sector = _sectorStart; _sector < _sectorEnd; _sector++) {
noInterrupts();
Expand All @@ -314,7 +308,6 @@ void CFG_Dump(char* parms)
{
#define CFG_COLS 16

char log[LOGSZ];
uint16_t idx;
uint16_t maxrow;
uint16_t row;
Expand All @@ -327,8 +320,8 @@ void CFG_Dump(char* parms)
uint16_t srow = strtol(parms, &p, 16) / CFG_COLS;
uint16_t mrow = strtol(p, &p, 10);

// snprintf_P(log, sizeof(log), PSTR("Cnfg: Parms %s, Start row %d, rows %d"), parms, srow, mrow);
// addLog(LOG_LEVEL_DEBUG, log);
// snprintf_P(log_data, sizeof(log_data), PSTR("Cnfg: Parms %s, Start row %d, rows %d"), parms, srow, mrow);
// addLog(LOG_LEVEL_DEBUG);

if (0 == mrow) { // Default only 8 lines
mrow = 8;
Expand All @@ -342,22 +335,22 @@ void CFG_Dump(char* parms)

for (row = srow; row < maxrow; row++) {
idx = row * CFG_COLS;
snprintf_P(log, sizeof(log), PSTR("%04X:"), idx);
snprintf_P(log_data, sizeof(log_data), PSTR("%04X:"), idx);
for (col = 0; col < CFG_COLS; col++) {
if (!(col%4)) {
snprintf_P(log, sizeof(log), PSTR("%s "), log);
snprintf_P(log_data, sizeof(log_data), PSTR("%s "), log_data);
}
snprintf_P(log, sizeof(log), PSTR("%s %02X"), log, buffer[idx + col]);
snprintf_P(log_data, sizeof(log_data), PSTR("%s %02X"), log_data, buffer[idx + col]);
}
snprintf_P(log, sizeof(log), PSTR("%s |"), log);
snprintf_P(log_data, sizeof(log_data), PSTR("%s |"), log_data);
for (col = 0; col < CFG_COLS; col++) {
// if (!(col%4)) {
// snprintf_P(log, sizeof(log), PSTR("%s "), log);
// snprintf_P(log_data, sizeof(log_data), PSTR("%s "), log_data);
// }
snprintf_P(log, sizeof(log), PSTR("%s%c"), log, ((buffer[idx + col] > 0x20) && (buffer[idx + col] < 0x7F)) ? (char)buffer[idx + col] : ' ');
snprintf_P(log_data, sizeof(log_data), PSTR("%s%c"), log_data, ((buffer[idx + col] > 0x20) && (buffer[idx + col] < 0x7F)) ? (char)buffer[idx + col] : ' ');
}
snprintf_P(log, sizeof(log), PSTR("%s|"), log);
addLog(LOG_LEVEL_INFO, log);
snprintf_P(log_data, sizeof(log_data), PSTR("%s|"), log_data);
addLog(LOG_LEVEL_INFO);
delay(1);
}
}
Expand Down Expand Up @@ -507,6 +500,8 @@ void CFG_DefaultSet2()
// 5.4.1
memcpy_P(sysCfg.sfb_code[0], sfb_codeDefault, 9);

// 5.8.0
sysCfg.led_pixels = 1;
}

/********************************************************************************************/
Expand Down Expand Up @@ -540,7 +535,7 @@ void CFG_DefaultSet_3_9_3()
sysCfg.my_module.gp.io[i] = 0;
}

sysCfg.led_pixels = 0;
sysCfg.led_pixels = WS2812_LEDS;
for (byte i = 0; i < 5; i++) {
sysCfg.led_color[i] = 255;
}
Expand All @@ -549,9 +544,9 @@ void CFG_DefaultSet_3_9_3()
sysCfg.led_dimmer[i] = 10;
}
sysCfg.led_fade = 0;
sysCfg.led_speed = 0;
sysCfg.led_speed = 1;
sysCfg.led_scheme = 0;
sysCfg.led_width = 0;
sysCfg.led_width = 1;
sysCfg.led_wakeup = 0;
}

Expand Down Expand Up @@ -715,6 +710,30 @@ void CFG_Delta()
}
memcpy_P(sysCfg.sfb_code[0], sfb_codeDefault, 9);
}
if (sysCfg.version < 0x05080000) {
uint8_t cfg_wsflg = 0;
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
if (GPIO_WS2812 == sysCfg.my_module.gp.io[i]) {
cfg_wsflg = 1;
}
}
if (!sysCfg.led_pixels && cfg_wsflg) {
sysCfg.led_pixels = sysCfg.ws_pixels;
sysCfg.led_color[0] = sysCfg.ws_red;
sysCfg.led_color[1] = sysCfg.ws_green;
sysCfg.led_color[2] = sysCfg.ws_blue;
sysCfg.led_dimmer[0] = sysCfg.ws_dimmer;
sysCfg.led_table = sysCfg.ws_ledtable;
sysCfg.led_fade = sysCfg.ws_fade;
sysCfg.led_speed = sysCfg.ws_speed;
sysCfg.led_scheme = sysCfg.ws_scheme;
sysCfg.led_width = sysCfg.ws_width;
sysCfg.led_wakeup = sysCfg.ws_wakeup;
} else {
sysCfg.led_pixels = 1;
sysCfg.led_width = 1;
}
}

sysCfg.version = VERSION;
CFG_Save(1);
Expand Down
Loading

0 comments on commit af942a2

Please sign in to comment.