From d629b8ce2a4ba1288793b97474fe63fb429adc8e Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Tue, 1 May 2018 11:28:36 +0200 Subject: [PATCH 1/2] v5.13.0a - Fix JSON buffer size 5.13.0a * Fix JSON buffers size too small for execution in some situations (#2580) --- README.md | 2 +- sonoff/_releasenotes.ino | 5 ++++- sonoff/sonoff.ino | 2 +- sonoff/xdrv_09_timers.ino | 2 +- sonoff/xdrv_10_rules.ino | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7b38ad191..19bf193a6 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you like **Sonoff-Tasmota**, give it a star, or fork it and contribute! ### Development: [![Build Status](https://img.shields.io/travis/arendst/Sonoff-Tasmota.svg)](https://travis-ci.org/arendst/Sonoff-Tasmota) -Current version is **5.13.0** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. +Current version is **5.13.0a** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. ### Quick install Download one of the released binaries from https://github.com/arendst/Sonoff-Tasmota/releases and flash it to your hardware as documented in the wiki. diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index d08e1bb39..3bb2238c9 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,4 +1,7 @@ -/* 5.13.0 20180430 +/* 5.13.0a + * Fix JSON buffers size too small for execution in some situations (#2580) + * + * 5.13.0 20180430 * Change platformio option sonoff-ds18x20 to sonoff-allsensors enabling ds18x20 and all other sensors in one image * Change status display of Ssid and SetOption * Change default option SetOption15 from 0 to 1 providing better initial PWM experience diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index a3f7b2866..554a4858e 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -25,7 +25,7 @@ - Select IDE Tools - Flash Size: "1M (no SPIFFS)" ====================================================*/ -#define VERSION 0x050D0000 // 5.13.0 +#define VERSION 0x050D0001 // 5.13.0a // Location specific includes #include // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0) diff --git a/sonoff/xdrv_09_timers.ino b/sonoff/xdrv_09_timers.ino index aa1287f20..e85349da7 100644 --- a/sonoff/xdrv_09_timers.ino +++ b/sonoff/xdrv_09_timers.ino @@ -354,7 +354,7 @@ boolean TimerCommand() #ifndef USE_RULES if (devices_present) { #endif - StaticJsonBuffer<200> jsonBuffer; + StaticJsonBuffer<256> jsonBuffer; JsonObject& root = jsonBuffer.parseObject(dataBufUc); if (!root.success()) { snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_TIMER "%d\":\"" D_JSON_INVALID_JSON "\"}"), index); // JSON decode failed diff --git a/sonoff/xdrv_10_rules.ino b/sonoff/xdrv_10_rules.ino index f92edcf55..b07bea5b7 100644 --- a/sonoff/xdrv_10_rules.ino +++ b/sonoff/xdrv_10_rules.ino @@ -181,7 +181,7 @@ bool RulesRuleMatch(String &event, String &rule) } // Step2: Search rule_task and rule_name - StaticJsonBuffer<400> jsonBuf; + StaticJsonBuffer<1024> jsonBuf; JsonObject &root = jsonBuf.parseObject(event); if (!root.success()) { return false; } // No valid JSON data From 1fb9c0e531b87d83d8d7f279dab705f85d677bef Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Tue, 1 May 2018 12:42:17 +0200 Subject: [PATCH 2/2] v5.13.0a - Add optional module select not to be used 5.13.0a * Add define MODULE for user selecting default model although it preferably should not be changed (#569, #2589) --- README.md | 2 +- sonoff/_releasenotes.ino | 1 + sonoff/sonoff.h | 2 -- sonoff/sonoff_post.h | 4 ++++ sonoff/user_config.h | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 19bf193a6..5c369b928 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ If you like **Sonoff-Tasmota**, give it a star, or fork it and contribute! [![GitHub stars](https://img.shields.io/github/stars/arendst/Sonoff-Tasmota.svg?style=social&label=Star)](https://github.com/arendst/Sonoff-Tasmota/stargazers) [![GitHub forks](https://img.shields.io/github/forks/arendst/Sonoff-Tasmota.svg?style=social&label=Fork)](https://github.com/arendst/Sonoff-Tasmota/network) -### Development: +### Development [![Build Status](https://img.shields.io/travis/arendst/Sonoff-Tasmota.svg)](https://travis-ci.org/arendst/Sonoff-Tasmota) Current version is **5.13.0a** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 3bb2238c9..0bbf1e7bf 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,5 +1,6 @@ /* 5.13.0a * Fix JSON buffers size too small for execution in some situations (#2580) + * Add define MODULE for user selecting default model (#569, #2589) * * 5.13.0 20180430 * Change platformio option sonoff-ds18x20 to sonoff-allsensors enabling ds18x20 and all other sensors in one image diff --git a/sonoff/sonoff.h b/sonoff/sonoff.h index 296046c85..a2eecea4f 100644 --- a/sonoff/sonoff.h +++ b/sonoff/sonoff.h @@ -52,8 +52,6 @@ typedef unsigned long power_t; // Power (Relay) type #define MAX_KNX_CB 10 // Max number of KNX Group Addresses to write that can be set #define MAX_RULE_SIZE 512 // Max number of characters in rules -#define MODULE SONOFF_BASIC // [Module] Select default model - #define MQTT_TOKEN_PREFIX "%prefix%" // To be substituted by mqtt_prefix[x] #define MQTT_TOKEN_TOPIC "%topic%" // To be substituted by mqtt_topic, mqtt_grptopic, mqtt_buttontopic, mqtt_switchtopic diff --git a/sonoff/sonoff_post.h b/sonoff/sonoff_post.h index 1d6ba7878..ef1dfbfd9 100644 --- a/sonoff/sonoff_post.h +++ b/sonoff/sonoff_post.h @@ -46,6 +46,10 @@ void KNX_CB_Action(message_t const &msg, void *arg); * Default global defines \*********************************************************************************************/ +#ifndef MODULE +#define MODULE SONOFF_BASIC // [Module] Select default model +#endif + #define USE_DHT // Default DHT11 sensor needs no external library /*********************************************************************************************\ diff --git a/sonoff/user_config.h b/sonoff/user_config.h index 6bfa6e1cd..83b9a346f 100644 --- a/sonoff/user_config.h +++ b/sonoff/user_config.h @@ -48,6 +48,7 @@ // -- Project ------------------------------------- #define PROJECT "sonoff" // PROJECT is used as the default topic delimiter +#define MODULE SONOFF_BASIC // [Module] Select default model from sonoff_template.h (Should not be changed) #define SAVE_DATA 1 // [SaveData] Save changed parameters to Flash (0 = disable, 1 - 3600 seconds) #define SAVE_STATE 1 // [SetOption0] Save changed power state to Flash (0 = disable, 1 = enable)