Skip to content

Commit

Permalink
v5.11.1h - Weblog redesign saving RAM
Browse files Browse the repository at this point in the history
5.11.1h
 * Rewrite webserver argument processing gaining 5k code space
(#1705)
 * Redesign weblog storage (#1730)
 * Fix command SetOption20
(#1741)
  • Loading branch information
arendst committed Jan 30, 2018
1 parent b60ccdd commit b8f323a
Show file tree
Hide file tree
Showing 11 changed files with 442 additions and 315 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 **5.11.1g** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
Current version is **5.11.1h** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.

### ATTENTION All versions

Expand Down
7 changes: 6 additions & 1 deletion sonoff/_releasenotes.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/* 5.11.1g
/* 5.11.1h
* Rewrite webserver argument processing gaining 5k code space (#1705)
* Redesign weblog storage (#1730)
* Fix command SetOption20 (#1741)
*
* 5.11.1g
* Add support for PMS5003 and PMS7003 particle concentration sensor
* Reinstate console weblog to 20 lines after some webpage rewrite
* Add command SetOption20 to allow update of Dimmer/Color/Ct without turning power on (#1719)
Expand Down
10 changes: 4 additions & 6 deletions sonoff/sonoff.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,13 @@ typedef unsigned long power_t; // Power (Relay) type
#define TOPSZ 100 // Max number of characters in topic string
#define LOGSZ 400 // Max number of characters in log
#define MIN_MESSZ 893 // Min number of characters in MQTT message

#ifdef USE_MQTT_TLS
#define MAX_LOG_LINES 10 // Max number of lines in weblog
#define WEB_LOG_SIZE 2000 // Max number of characters in weblog
#else
// #ifdef ARDUINO_ESP8266_RELEASE_2_3_0
#define MAX_LOG_LINES 20 // Max number of lines in weblog
// #else
// #define MAX_LOG_LINES 13 // Max number of lines in weblog (less due to more memory usage which prohibits full webpage load)
// #endif
#define WEB_LOG_SIZE 4000 // Max number of characters in weblog
#endif

#define MAX_BACKLOG 16 // Max number of commands in backlog (chk backlog_index and backlog_pointer code)
#define MIN_BACKLOG_DELAY 2 // Minimal backlog delay in 0.1 seconds

Expand Down
8 changes: 4 additions & 4 deletions sonoff/sonoff.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
====================================================*/

#define VERSION 0x050B0107 // 5.11.1g
#define VERSION 0x050B0108 // 5.11.1h

// Location specific includes
#include <core_version.h> // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0)
Expand Down Expand Up @@ -190,10 +190,10 @@ boolean mdns_begun = false;
char my_version[33]; // Composed version string
char my_hostname[33]; // Composed Wifi hostname
char mqtt_client[33]; // Composed MQTT Clientname
char serial_in_buffer[INPUT_BUFFER_SIZE + 2]; // Receive buffer
char serial_in_buffer[INPUT_BUFFER_SIZE + 2]; // Receive buffer
char mqtt_data[MESSZ]; // MQTT publish buffer and web page ajax buffer
char log_data[LOGSZ]; // Logging
String web_log[MAX_LOG_LINES]; // Web log buffer
char web_log[WEB_LOG_SIZE] = {'\0'}; // Web log buffer
String backlog[MAX_BACKLOG]; // Command backlog

/********************************************************************************************/
Expand Down Expand Up @@ -999,7 +999,7 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
// type = NULL;
// }
}
else if ((CMND_SETOPTION == command_code) && ((index >= 0) && (index <= 19)) || ((index > 31) && (index <= P_MAX_PARAM8 +31))) {
else if ((CMND_SETOPTION == command_code) && ((index >= 0) && (index <= 20)) || ((index > 31) && (index <= P_MAX_PARAM8 +31))) {
if (index <= 31) {
ptype = 0; // SetOption0 .. 31
} else {
Expand Down
Loading

0 comments on commit b8f323a

Please sign in to comment.