Skip to content

Commit

Permalink
v4.1.0
Browse files Browse the repository at this point in the history
4.1.0 20170325
* Change static IP addresses in user_config.h from list (using commas)
to string (using dots)
* Unify display result of commands Modules, Module and Gpios
* Rewrite Module selection web page to bring size down from 18651 to
4319 bytes (!) (#234, #240)
* Add basic support for (Lixada) H801 RGBWW controller (#252)
* Add command Prefix1 to Prefix3 to assign SUB_PREFIX, PUB_PREFIX and
PUB_PREFIX2 respectively (#255)
* Add static ip addresses to flash (#262)
* Add commands IpAddress, Gateway, Subnetmask and DnsServer to select
static ip addresses (#273)
  • Loading branch information
arendst committed Mar 25, 2017
1 parent 99b7474 commit ae27ec2
Show file tree
Hide file tree
Showing 13 changed files with 209 additions and 83 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 **4.0.8** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information.
Current version is **4.1.0** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information.

- This version provides all (Sonoff) modules in one file and starts up with Sonoff Basic.
- Once uploaded select module using the configuration webpage or the commands ```Modules``` and ```Module```.
Expand Down
Binary file modified api/arduino/sonoff-minimal.ino.bin
Binary file not shown.
Binary file modified api/arduino/sonoff.ino.bin
Binary file not shown.
11 changes: 10 additions & 1 deletion sonoff/_releasenotes.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
/* 4.0.8 20170321
/* 4.1.0 20170325
* Change static IP addresses in user_config.h from list (using commas) to string (using dots)
* Unify display result of commands Modules, Module and Gpios
* Rewrite Module selection web page to bring size down from 18651 to 4319 bytes (!) (#234, #240)
* Add basic support for (Lixada) H801 RGBWW controller (#252)
* Add command Prefix1 to Prefix3 to assign SUB_PREFIX, PUB_PREFIX and PUB_PREFIX2 respectively (#255)
* Add static ip addresses to flash (#262)
* Add commands IpAddress, Gateway, Subnetmask and DnsServer to select static ip addresses (#273)
*
* 4.0.8 20170321
* Fix entering non-numeric webpassword
* Force selection between TLS or Webserver due to memory restraint (#240)
* Allow entering empty string using "0" for selected commands (#242)
Expand Down
7 changes: 6 additions & 1 deletion sonoff/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ struct SYSCFG {
byte model; // Not used since 3.9.1
int8_t timezone;
char otaUrl[101];
char ex_friendlyname[33]; // Not used since 3.2.5 - see below

char mqtt_prefix[3][11]; // was ex_friendlyname[33] until 3.2.5

byte serial_enable;
byte seriallog_level;
Expand Down Expand Up @@ -210,6 +211,10 @@ struct SYSCFG {
// 4.0.7
uint16_t pwmvalue[5];

// 4.0.9
// uint8_t ip_address[4][4];
uint32_t ip_address[4];

} sysCfg;

struct RTCMEM {
Expand Down
37 changes: 22 additions & 15 deletions sonoff/settings.ino
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,9 @@ void CFG_DefaultSet2()
{
sysCfg.savedata = SAVE_DATA;
sysCfg.savestate = SAVE_STATE;
sysCfg.model = 0;
// sysCfg.model = 0;
sysCfg.timezone = APP_TIMEZONE;
strlcpy(sysCfg.otaUrl, OTA_URL, sizeof(sysCfg.otaUrl));
strlcpy(sysCfg.ex_friendlyname, FRIENDLY_NAME, sizeof(sysCfg.ex_friendlyname));

sysCfg.seriallog_level = SERIAL_LOG_LEVEL;
sysCfg.sta_active = 0;
Expand Down Expand Up @@ -451,14 +450,11 @@ void CFG_DefaultSet2()
sysCfg.mqtt_power_retain = MQTT_POWER_RETAIN;
sysCfg.value_units = 0;
sysCfg.button_restrict = 0;
// sysCfg.message_format = 0;
sysCfg.tele_period = TELE_PERIOD;

sysCfg.power = APP_POWER;
sysCfg.poweronstate = APP_POWERON_STATE;
// sysCfg.pulsetime = APP_PULSETIME;
sysCfg.ledstate = APP_LEDSTATE;
// sysCfg.switchmode = SWITCH_MODE;
sysCfg.blinktime = APP_BLINKTIME;
sysCfg.blinkcount = APP_BLINKCOUNT;
sysCfg.sleep = APP_SLEEP;
Expand Down Expand Up @@ -495,7 +491,7 @@ void CFG_DefaultSet2()
sysCfg.hlw_mkwhs = 0; // MaxEnergyStart

CFG_DefaultSet_3_2_4();

strlcpy(sysCfg.friendlyname[0], FRIENDLY_NAME, sizeof(sysCfg.friendlyname[0]));
strlcpy(sysCfg.friendlyname[1], FRIENDLY_NAME"2", sizeof(sysCfg.friendlyname[1]));
strlcpy(sysCfg.friendlyname[2], FRIENDLY_NAME"3", sizeof(sysCfg.friendlyname[2]));
Expand All @@ -514,8 +510,11 @@ void CFG_DefaultSet2()
CFG_DefaultSet_4_0_4();
sysCfg.pulsetime[0] = APP_PULSETIME;

// v4.0.7
// 4.0.7
for (byte i = 0; i < 5; i++) sysCfg.pwmvalue[i] = 0;

// 4.0.9
CFG_DefaultSet_4_0_9();
}

void CFG_DefaultSet_3_2_4()
Expand Down Expand Up @@ -564,6 +563,17 @@ void CFG_DefaultSet_4_0_4()
for (byte i = 1; i < MAX_PULSETIMERS; i++) sysCfg.pulsetime[i] = 0;
}

void CFG_DefaultSet_4_0_9()
{
strlcpy(sysCfg.mqtt_prefix[0], SUB_PREFIX, sizeof(sysCfg.mqtt_prefix[0]));
strlcpy(sysCfg.mqtt_prefix[1], PUB_PREFIX, sizeof(sysCfg.mqtt_prefix[1]));
strlcpy(sysCfg.mqtt_prefix[2], PUB_PREFIX2, sizeof(sysCfg.mqtt_prefix[2]));
parseIP(&sysCfg.ip_address[0], WIFI_IP_ADDRESS);
parseIP(&sysCfg.ip_address[1], WIFI_GATEWAY);
parseIP(&sysCfg.ip_address[2], WIFI_SUBNETMASK);
parseIP(&sysCfg.ip_address[3], WIFI_DNS);
}

void CFG_Default()
{
addLog_P(LOG_LEVEL_NONE, PSTR("Config: Use default configuration"));
Expand Down Expand Up @@ -600,7 +610,7 @@ void CFG_Migrate_Part2()
strlcpy(sysCfg.mqtt_client, sysCfg2.mqtt_client, sizeof(sysCfg.mqtt_client));
strlcpy(sysCfg.mqtt_user, sysCfg2.mqtt_user, sizeof(sysCfg.mqtt_user));
strlcpy(sysCfg.mqtt_pwd, sysCfg2.mqtt_pwd, sizeof(sysCfg.mqtt_pwd));
strlcpy(sysCfg.ex_friendlyname, sysCfg2.mqtt_client, sizeof(sysCfg.ex_friendlyname));
strlcpy(sysCfg.friendlyname[0], sysCfg2.mqtt_client, sizeof(sysCfg.friendlyname[0]));
}
if (sysCfg2.version >= 0x01001700) { // 1.0.23
sysCfg.webserver = sysCfg2.webserver;
Expand Down Expand Up @@ -691,19 +701,13 @@ void CFG_Delta()
if (sysCfg.version < 0x03000600) { // 3.0.6 - Add parameter
sysCfg.ex_pulsetime = APP_PULSETIME;
}
if (sysCfg.version < 0x03010100) { // 3.1.1 - Add parameter
sysCfg.poweronstate = APP_POWERON_STATE;
}
if (sysCfg.version < 0x03010200) { // 3.1.2 - Add parameter
if (sysCfg.poweronstate == 2) sysCfg.poweronstate = 3;
sysCfg.poweronstate = APP_POWERON_STATE;
}
if (sysCfg.version < 0x03010600) { // 3.1.6 - Add parameter
sysCfg.blinktime = APP_BLINKTIME;
sysCfg.blinkcount = APP_BLINKCOUNT;
}
if (sysCfg.version < 0x03011000) { // 3.1.16 - Add parameter
getClient(sysCfg.friendlyname[0], sysCfg.mqtt_client, sizeof(sysCfg.friendlyname[0]));
}
if (sysCfg.version < 0x03020400) { // 3.2.4 - Add parameter
CFG_DefaultSet_3_2_4();
}
Expand Down Expand Up @@ -746,6 +750,9 @@ void CFG_Delta()
if (sysCfg.version < 0x04000700) {
for (byte i = 0; i < 5; i++) sysCfg.pwmvalue[i] = 0;
}
if (sysCfg.version < 0x04000804) {
CFG_DefaultSet_4_0_9();
}
sysCfg.version = VERSION;
}
}
Expand Down
Loading

0 comments on commit ae27ec2

Please sign in to comment.