From 09bb1ecb8ed29020c1e11c0a83ae65fb23e9ba3e Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 20 Dec 2020 16:40:49 +0100 Subject: [PATCH] Fix ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` Fix ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` (#9506) --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + tasmota/my_user_config.h | 2 +- tasmota/settings.ino | 3 ++- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a0a25998..049f29d73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file. - Redesign syslog and mqttlog using log buffer (#10164) - Shelly Dimmer power on state (#10154, #10182) - Wemo emulation for single devices (#10165, #10194) +- ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` (#9506) ## [Released] diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 56113519b..efd15218d 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -67,3 +67,4 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - Redesign syslog and mqttlog using log buffer (#10164) - Shelly Dimmer power on state (#10154, #10182) - Wemo emulation for single devices (#10165, #10194) +- ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` (#9506) diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 421210f2e..7e101b144 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -53,7 +53,7 @@ //#define MODULE SONOFF_BASIC // [Module] Select default module from tasmota_template.h #ifdef ESP8266 #define FALLBACK_MODULE SONOFF_BASIC // [Module2] Select default module on fast reboot where USER_MODULE is user template -//#define USER_TEMPLATE "{\"NAME\":\"Generic\",\"GPIO\":[255,255,255,255,255,255,255,255,255,255,255,255,255],\"FLAG\":15,\"BASE\":18}" // [Template] Set JSON template +//#define USER_TEMPLATE "{\"NAME\":\"Generic\",\"GPIO\":[1,1,1,1,1,1,1,1,1,1,1,1,1,1],\"FLAG\":0,\"BASE\":18}" // [Template] Set JSON template #endif // ESP8266 #ifdef ESP32 #define FALLBACK_MODULE WEMOS // [Module2] Select default module on fast reboot where USER_MODULE is user template diff --git a/tasmota/settings.ino b/tasmota/settings.ino index 2ce535710..859960472 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -1049,7 +1049,8 @@ void SettingsDefaultSet2(void) flag4.mqtt_no_retain |= MQTT_NO_RETAIN; #ifdef USER_TEMPLATE - JsonTemplate((char *)USER_TEMPLATE); + String user_template = USER_TEMPLATE; + JsonTemplate((char*)user_template.c_str()); #endif Settings.flag = flag;