Skip to content

Commit

Permalink
v5.5.0
Browse files Browse the repository at this point in the history
5.5.0 20170730
* Reduce code space by removing the following commands as they are
replaced by SetOption alternatives:
*   SaveState = SetOption0
*   ButtonRestrict = SetOption1
*   Units = SetOption2
*   MQTT = SetOption3
*   MQTTResponse = SetOption4
*   TempUnit = SetOption8
* Smoothing WS2812 animation poll, invert fade speed and max allowed
wakeup time down to 3000 seconds
* Fix initial button press detection
* Add support for Sonoff RF Bridge 433 using command RfKey
* Fix regression from 5.0.7 by increasing message buffer size from 360
to 368 to accomodate 4 x DS18x20 sensors (#637)
* Add GroupTopic to Topic test when using ButtonTopic/SwitchTopic to
send either ON/OFF or TOGGLE (#642)
* Adjust HLW calibration limits to accomodate HuaFan device and add
commands HlwPSet, HlwUSet and HlwISet (#654)
  • Loading branch information
arendst committed Jul 30, 2017
1 parent 22ef93a commit 0a9ec10
Show file tree
Hide file tree
Showing 13 changed files with 351 additions and 166 deletions.
10 changes: 4 additions & 6 deletions 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.4.0** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information.
Current version is **5.5.0** - 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 ****

Expand Down Expand Up @@ -41,17 +41,15 @@ The following devices are supported:
- [iTead Sonoff SC](http://sonoff.itead.cc/en/products/residential/sonoff-sc)
- [iTead Sonoff Led](http://sonoff.itead.cc/en/products/appliances/sonoff-led)
- [iTead Sonoff BN-SZ01 Ceiling Led](http://sonoff.itead.cc/en/products/appliances/bn-sz01)
- [iTead Sonoff RF Bridge 433](http://sonoff.itead.cc/en/products/appliances/sonoff-rf-bridge-433)
- [iTead Sonoff Dev](https://www.itead.cc/sonoff-dev.html)
- [iTead 1 Channel Switch 5V / 12V](https://www.itead.cc/smart-home/inching-self-locking-wifi-wireless-switch.html)
- [iTead Motor Clockwise/Anticlockwise](https://www.itead.cc/smart-home/motor-reversing-wifi-wireless-switch.html)
- [Electrodragon IoT Relay Board](http://www.electrodragon.com/product/wifi-iot-relay-board-based-esp8266/)

Planned support:
- [iTead Sonoff T1](https://www.itead.cc/smart-home/sonoff-t1.html)
- [iTead Sonoff B1](https://www.itead.cc/smart-home/sonoff-b1.html)

Optional future support:
- iTead RF Bridge
- [iTead Sonoff T1](http://sonoff.itead.cc/en/products/residential/sonoff-t1)
- [iTead Sonoff B1](http://sonoff.itead.cc/en/products/residential/sonoff-b1)

<img src="https://github.com/arendst/arendst.github.io/blob/master/media/sonofftoucheu.jpg" height="280" align="left" />
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/sonoff4ch.jpg" height="250" align="right" />
17 changes: 16 additions & 1 deletion sonoff/_releasenotes.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
/* 5.4.0 20170725
/* 5.5.0 20170730
* Reduce code space by removing the following commands as they are replaced by SetOption alternatives:
* SaveState = SetOption0
* ButtonRestrict = SetOption1
* Units = SetOption2
* MQTT = SetOption3
* MQTTResponse = SetOption4
* TempUnit = SetOption8
* Smoothing WS2812 animation poll, invert fade speed and max allowed wakeup time down to 3000 seconds
* Fix initial button press detection
* Add support for Sonoff RF Bridge 433 using command RfKey
* Fix regression from 5.0.7 by increasing message buffer size from 360 to 368 to accomodate 4 x DS18x20 sensors (#637)
* Add GroupTopic to Topic test when using ButtonTopic/SwitchTopic to send either ON/OFF or TOGGLE (#642)
* Adjust HLW calibration limits to accomodate HuaFan device and add commands HlwPSet, HlwUSet and HlwISet (#654)
*
* 5.4.0 20170725
* Fix command reset regression introduced in 5.2.0
* Increase polling from 0.1 second to 0.05 second
* Add multipress to all buttons
Expand Down
3 changes: 3 additions & 0 deletions sonoff/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ struct SYSCFG {
uint16_t pCounterType;
uint16_t pCounterDebounce;

// 5.4.1
uint8_t sfb_code[17][9];

} sysCfg;

struct RTCMEM {
Expand Down
57 changes: 26 additions & 31 deletions sonoff/settings.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

const uint8_t sfb_codeDefault[9] PROGMEM = { 0x21, 0x16, 0x01, 0x0E, 0x03, 0x48, 0x2E, 0x1A, 0x00 };

/*********************************************************************************************\
* RTC memory
\*********************************************************************************************/
Expand Down Expand Up @@ -269,30 +271,7 @@ void CFG_Load()
}
snprintf_P(log, sizeof(log), PSTR("Cnfg: Load from flash at %X and count %d"), _cfgLocation, sysCfg.saveFlag);
addLog(LOG_LEVEL_DEBUG, log);
/*
if (sysCfg.cfg_holder != CFG_HOLDER) {
CFG_Default();
}
*/
if (sysCfg.cfg_holder != CFG_HOLDER) {
/*
// Auto upgrade
if ((sysCfg.version < 0x04020000) || (sysCfg.version > VERSION)) {
noInterrupts();
spi_flash_read((CFG_LOCATION_3) * SPI_FLASH_SEC_SIZE, (uint32*)&sysCfg, sizeof(SYSCFG));
spi_flash_read((CFG_LOCATION_3 + 1) * SPI_FLASH_SEC_SIZE, (uint32*)&_sysCfgH, sizeof(SYSCFGH));
if (sysCfg.saveFlag < _sysCfgH.saveFlag)
spi_flash_read((CFG_LOCATION_3 + 1) * SPI_FLASH_SEC_SIZE, (uint32*)&sysCfg, sizeof(SYSCFG));
interrupts();
if (sysCfg.cfg_holder != CFG_HOLDER) {
CFG_Default();
} else {
sysCfg.saveFlag = 0;
}
} else {
CFG_Default();
}
*/
// Auto upgrade
noInterrupts();
spi_flash_read((CFG_LOCATION_3) * SPI_FLASH_SEC_SIZE, (uint32*)&sysCfg, sizeof(SYSCFG));
Expand Down Expand Up @@ -339,7 +318,7 @@ void CFG_Erase()
}
}

void CFG_Dump(uint16_t srow, uint16_t mrow)
void CFG_Dump(char* parms)
{
#define CFG_COLS 16

Expand All @@ -348,18 +327,25 @@ void CFG_Dump(uint16_t srow, uint16_t mrow)
uint16_t maxrow;
uint16_t row;
uint16_t col;
char *p;

uint8_t *buffer = (uint8_t *) &sysCfg;
row = 0;
maxrow = ((sizeof(SYSCFG)+CFG_COLS)/CFG_COLS);
if ((srow > 0) && (srow < maxrow)) {
row = srow;

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);

if (0 == mrow) { // Default only 8 lines
mrow = 8;
}
if (0 == mrow) { // Default only four lines
mrow = 4;
if (srow > maxrow) {
srow = maxrow - mrow;
}
if ((mrow > 0) && (mrow < (maxrow - row))) {
maxrow = row + mrow;
if (mrow < (maxrow - srow)) {
maxrow = srow + mrow;
}

for (row = srow; row < maxrow; row++) {
Expand Down Expand Up @@ -525,6 +511,9 @@ void CFG_DefaultSet2()
// 5.2.0
sysCfg.param[P_MAX_POWER_RETRY] = MAX_POWER_RETRY;

// 5.4.1
memcpy_P(sysCfg.sfb_code[0], sfb_codeDefault, 9);

}

/********************************************************************************************/
Expand Down Expand Up @@ -727,6 +716,12 @@ void CFG_Delta()
if (sysCfg.version < 0x05020000) {
sysCfg.param[P_MAX_POWER_RETRY] = MAX_POWER_RETRY;
}
if (sysCfg.version < 0x05050000) {
for (byte i = 0; i < 17; i++) {
sysCfg.sfb_code[i][0] = 0;
}
memcpy_P(sysCfg.sfb_code[0], sfb_codeDefault, 9);
}

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

0 comments on commit 0a9ec10

Please sign in to comment.