diff --git a/tasmota/settings.h b/tasmota/settings.h index 6d7962723..02ce55123 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -516,7 +516,6 @@ struct SYSCFG { uint8_t wifi_bssid[6]; // F0A uint8_t as3935_sensor_cfg[5]; // F10 As3935IntCfg as3935_functions; // F15 - //uint8_t free_f35; As3935Param as3935_parameter; // F16 uint64_t zb_ext_panid; // F18 uint64_t zb_precfgkey_l; // F20 @@ -525,8 +524,9 @@ struct SYSCFG { uint8_t zb_channel; // F32 uint8_t zb_free_byte; // F33 uint16_t pms_wake_interval; // F34 + uint8_t config_version; // F36 - uint8_t free_f36[70]; // F36 - Decrement if adding new Setting variables just above and below + uint8_t free_f37[69]; // F37 - Decrement if adding new Setting variables just above and below // Only 32 bit boundary variables below uint8_t time_output_delay; // F7C diff --git a/tasmota/settings.ino b/tasmota/settings.ino index ed2dd021f..b63c533f9 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -1365,6 +1365,15 @@ void SettingsDelta(void) } #endif // ESP8266 + if (Settings.version < 0x08020004) { +#ifdef ESP8266 + Settings.config_version = 0; // ESP8266 (Has been 0 for long time) +#endif // ESP8266 +#ifdef ESP32 + Settings.config_version = 1; // ESP32 +#endif // ESP32 + } + Settings.version = VERSION; SettingsSave(1); } diff --git a/tasmota/tasmota_version.h b/tasmota/tasmota_version.h index 3b8314f65..4014ea4d5 100644 --- a/tasmota/tasmota_version.h +++ b/tasmota/tasmota_version.h @@ -20,7 +20,7 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x08020003; +const uint32_t VERSION = 0x08020004; // Lowest compatible version const uint32_t VERSION_COMPATIBLE = 0x07010006; diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 8b5806938..5660a231d 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -2509,6 +2509,16 @@ void HandleUploadLoop(void) } else { valid_settings = (settings_buffer[0] == CONFIG_FILE_SIGN); } + + if (valid_settings) { +#ifdef ESP8266 + valid_settings = (0 == settings_buffer[0xF36]); // Settings.config_version +#endif // ESP8266 +#ifdef ESP32 + valid_settings = (1 == settings_buffer[0xF36]); // Settings.config_version +#endif // ESP32 + } + if (valid_settings) { SettingsDefaultSet2(); memcpy((char*)&Settings +16, settings_buffer +16, sizeof(Settings) -16);