mirror of https://github.com/arendst/Tasmota.git
Merge branch 'development' into release
This commit is contained in:
commit
089a6c66bd
|
@ -49,3 +49,6 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
|
||||||
### Version 8.1.0 Doris
|
### Version 8.1.0 Doris
|
||||||
|
|
||||||
- Change Settings text handling allowing variable length text within a total text pool of 699 characters
|
- Change Settings text handling allowing variable length text within a total text pool of 699 characters
|
||||||
|
- Change Smoother ``Fade`` using 100Hz instead of 20Hz animation (#7179)
|
||||||
|
- Change max number of rule ``Mem``s from 5 to 16 (#4933)
|
||||||
|
- Add support for max 150 characters in command parameter strings (#3686, #4754)
|
||||||
|
|
|
@ -10,10 +10,13 @@
|
||||||
|
|
||||||
- Change Settings text handling allowing variable length text within a total text pool of 699 characters
|
- Change Settings text handling allowing variable length text within a total text pool of 699 characters
|
||||||
- Change Smoother ``Fade`` using 100Hz instead of 20Hz animation (#7179)
|
- Change Smoother ``Fade`` using 100Hz instead of 20Hz animation (#7179)
|
||||||
|
- Change max number of rule ``Mem``s from 5 to 16 (#4933)
|
||||||
|
- Add support for max 150 characters in most command parameter strings (#3686, #4754)
|
||||||
|
|
||||||
### 7.2.0 20191221
|
### 7.2.0 20191221
|
||||||
|
|
||||||
- Release
|
- Release
|
||||||
|
- Change basic version string to lite (#7291)
|
||||||
- Fix Arduino IDE compile error (#7277)
|
- Fix Arduino IDE compile error (#7277)
|
||||||
- Fix restore ShutterAccuracy, MqttLog, WifiConfig, WifiPower and SerialConfig (#7281)
|
- Fix restore ShutterAccuracy, MqttLog, WifiConfig, WifiPower and SerialConfig (#7281)
|
||||||
- Fix no AP on initial install (#7282)
|
- Fix no AP on initial install (#7282)
|
||||||
|
|
|
@ -419,7 +419,7 @@ struct SYSCFG {
|
||||||
unsigned long weight_calibration; // 7C4
|
unsigned long weight_calibration; // 7C4
|
||||||
unsigned long energy_frequency_calibration; // 7C8 also used by HX711 to save last weight
|
unsigned long energy_frequency_calibration; // 7C8 also used by HX711 to save last weight
|
||||||
uint16_t web_refresh; // 7CC
|
uint16_t web_refresh; // 7CC
|
||||||
char mems[MAX_RULE_MEMS][10]; // 7CE - Used by scripter as script_pram
|
char mems[5][10]; // 7CE - Used by scripter as script_pram
|
||||||
|
|
||||||
char rules[MAX_RULE_SETS][MAX_RULE_SIZE]; // 800 uses 512 bytes in v5.12.0m, 3 x 512 bytes in v5.14.0b
|
char rules[MAX_RULE_SETS][MAX_RULE_SIZE]; // 800 uses 512 bytes in v5.12.0m, 3 x 512 bytes in v5.14.0b
|
||||||
|
|
||||||
|
|
|
@ -533,7 +533,7 @@ bool SettingsUpdateText(uint32_t index, const char* replace_me)
|
||||||
|
|
||||||
int too_long = (char_len + diff) - settings_text_size;
|
int too_long = (char_len + diff) - settings_text_size;
|
||||||
if (too_long > 0) {
|
if (too_long > 0) {
|
||||||
// AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_CONFIG "Text too long by %d char(s)"), too_long);
|
AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_CONFIG "Text overflow by %d char(s)"), too_long);
|
||||||
return false; // Replace text too long
|
return false; // Replace text too long
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -326,7 +326,7 @@ void CmndStatus(void)
|
||||||
|
|
||||||
uint32_t option = STAT;
|
uint32_t option = STAT;
|
||||||
char stemp[200];
|
char stemp[200];
|
||||||
char stemp2[100];
|
char stemp2[TOPSZ];
|
||||||
|
|
||||||
// Workaround MQTT - TCP/IP stack queueing when SUB_PREFIX = PUB_PREFIX
|
// Workaround MQTT - TCP/IP stack queueing when SUB_PREFIX = PUB_PREFIX
|
||||||
if (!strcmp(SettingsText(SET_MQTTPREFIX1), SettingsText(SET_MQTTPREFIX2)) && (!payload)) { option++; } // TELE
|
if (!strcmp(SettingsText(SET_MQTTPREFIX1), SettingsText(SET_MQTTPREFIX2)) && (!payload)) { option++; } // TELE
|
||||||
|
|
|
@ -546,7 +546,7 @@ void MqttShowPWMState(void)
|
||||||
|
|
||||||
void MqttShowState(void)
|
void MqttShowState(void)
|
||||||
{
|
{
|
||||||
char stemp1[33];
|
char stemp1[TOPSZ];
|
||||||
|
|
||||||
ResponseAppendTime();
|
ResponseAppendTime();
|
||||||
ResponseAppend_P(PSTR(",\"" D_JSON_UPTIME "\":\"%s\",\"UptimeSec\":%u"), GetUptime().c_str(), UpTime());
|
ResponseAppend_P(PSTR(",\"" D_JSON_UPTIME "\":\"%s\",\"UptimeSec\":%u"), GetUptime().c_str(), UpTime());
|
||||||
|
|
|
@ -70,10 +70,10 @@ const uint8_t MAX_XSNS_DRIVERS = 96; // Max number of allowed sensor driv
|
||||||
const uint8_t MAX_I2C_DRIVERS = 96; // Max number of allowed i2c drivers
|
const uint8_t MAX_I2C_DRIVERS = 96; // Max number of allowed i2c drivers
|
||||||
const uint8_t MAX_SHUTTERS = 4; // Max number of shutters
|
const uint8_t MAX_SHUTTERS = 4; // Max number of shutters
|
||||||
const uint8_t MAX_PCF8574 = 8; // Max number of PCF8574 devices
|
const uint8_t MAX_PCF8574 = 8; // Max number of PCF8574 devices
|
||||||
const uint8_t MAX_RULE_MEMS = 5; // Max number of saved vars
|
|
||||||
const uint8_t MAX_RULE_SETS = 3; // Max number of rule sets of size 512 characters
|
const uint8_t MAX_RULE_SETS = 3; // Max number of rule sets of size 512 characters
|
||||||
const uint16_t MAX_RULE_SIZE = 512; // Max number of characters in rules
|
const uint16_t MAX_RULE_SIZE = 512; // Max number of characters in rules
|
||||||
|
|
||||||
|
const uint8_t MAX_RULE_MEMS = 16; // Max number of saved vars
|
||||||
const uint8_t MAX_HUE_DEVICES = 15; // Max number of Philips Hue device per emulation
|
const uint8_t MAX_HUE_DEVICES = 15; // Max number of Philips Hue device per emulation
|
||||||
|
|
||||||
const char MQTT_TOKEN_PREFIX[] PROGMEM = "%prefix%"; // To be substituted by mqtt_prefix[x]
|
const char MQTT_TOKEN_PREFIX[] PROGMEM = "%prefix%"; // To be substituted by mqtt_prefix[x]
|
||||||
|
@ -118,7 +118,7 @@ const uint8_t OTA_ATTEMPTS = 5; // Number of times to try fetching t
|
||||||
const uint16_t INPUT_BUFFER_SIZE = 520; // Max number of characters in (serial and http) command buffer
|
const uint16_t INPUT_BUFFER_SIZE = 520; // Max number of characters in (serial and http) command buffer
|
||||||
const uint16_t FLOATSZ = 16; // Max number of characters in float result from dtostrfd (max 32)
|
const uint16_t FLOATSZ = 16; // Max number of characters in float result from dtostrfd (max 32)
|
||||||
const uint16_t CMDSZ = 24; // Max number of characters in command
|
const uint16_t CMDSZ = 24; // Max number of characters in command
|
||||||
const uint16_t TOPSZ = 100; // Max number of characters in topic string
|
const uint16_t TOPSZ = 151; // Max number of characters in topic string
|
||||||
const uint16_t LOGSZ = 700; // Max number of characters in log
|
const uint16_t LOGSZ = 700; // Max number of characters in log
|
||||||
const uint16_t MIN_MESSZ = 893; // Min number of characters in MQTT message
|
const uint16_t MIN_MESSZ = 893; // Min number of characters in MQTT message
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
// Structs
|
// Structs
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
const char kCodeImage[] PROGMEM = "tasmota|minimal|sensors|knx|basic|display|ir";
|
const char kCodeImage[] PROGMEM = "tasmota|minimal|sensors|knx|lite|display|ir";
|
||||||
|
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* Global variables
|
* Global variables
|
||||||
|
@ -161,8 +161,8 @@ StateBitfield global_state; // Global states (currently Wifi and
|
||||||
char my_version[33]; // Composed version string
|
char my_version[33]; // Composed version string
|
||||||
char my_image[33]; // Code image and/or commit
|
char my_image[33]; // Code image and/or commit
|
||||||
char my_hostname[33]; // Composed Wifi hostname
|
char my_hostname[33]; // Composed Wifi hostname
|
||||||
char mqtt_client[33]; // Composed MQTT Clientname
|
char mqtt_client[TOPSZ]; // Composed MQTT Clientname
|
||||||
char mqtt_topic[33]; // Composed MQTT topic
|
char mqtt_topic[TOPSZ]; // Composed MQTT topic
|
||||||
char serial_in_buffer[INPUT_BUFFER_SIZE]; // Receive buffer
|
char serial_in_buffer[INPUT_BUFFER_SIZE]; // Receive buffer
|
||||||
char mqtt_data[MESSZ]; // MQTT publish buffer and web page ajax buffer
|
char mqtt_data[MESSZ]; // MQTT publish buffer and web page ajax buffer
|
||||||
char log_data[LOGSZ]; // Logging
|
char log_data[LOGSZ]; // Logging
|
||||||
|
|
|
@ -1694,7 +1694,7 @@ void HandleWifiConfiguration(void)
|
||||||
|
|
||||||
void WifiSaveSettings(void)
|
void WifiSaveSettings(void)
|
||||||
{
|
{
|
||||||
char tmp[100]; // Max length is currently 65
|
char tmp[TOPSZ]; // Max length is currently 150
|
||||||
|
|
||||||
WebGetArg("h", tmp, sizeof(tmp));
|
WebGetArg("h", tmp, sizeof(tmp));
|
||||||
SettingsUpdateText(SET_HOSTNAME, (!strlen(tmp)) ? WIFI_HOSTNAME : tmp);
|
SettingsUpdateText(SET_HOSTNAME, (!strlen(tmp)) ? WIFI_HOSTNAME : tmp);
|
||||||
|
@ -1757,7 +1757,7 @@ void HandleLoggingConfiguration(void)
|
||||||
|
|
||||||
void LoggingSaveSettings(void)
|
void LoggingSaveSettings(void)
|
||||||
{
|
{
|
||||||
char tmp[100]; // Max length is currently 33
|
char tmp[TOPSZ]; // Max length is currently 33
|
||||||
|
|
||||||
WebGetArg("l0", tmp, sizeof(tmp));
|
WebGetArg("l0", tmp, sizeof(tmp));
|
||||||
SetSeriallog((!strlen(tmp)) ? SERIAL_LOG_LEVEL : atoi(tmp));
|
SetSeriallog((!strlen(tmp)) ? SERIAL_LOG_LEVEL : atoi(tmp));
|
||||||
|
@ -1843,7 +1843,7 @@ void HandleOtherConfiguration(void)
|
||||||
|
|
||||||
void OtherSaveSettings(void)
|
void OtherSaveSettings(void)
|
||||||
{
|
{
|
||||||
char tmp[128];
|
char tmp[TOPSZ];
|
||||||
char webindex[5];
|
char webindex[5];
|
||||||
char friendlyname[TOPSZ];
|
char friendlyname[TOPSZ];
|
||||||
|
|
||||||
|
@ -1890,7 +1890,7 @@ void HandleBackupConfiguration(void)
|
||||||
WiFiClient myClient = WebServer->client();
|
WiFiClient myClient = WebServer->client();
|
||||||
WebServer->setContentLength(sizeof(Settings));
|
WebServer->setContentLength(sizeof(Settings));
|
||||||
|
|
||||||
char attachment[100];
|
char attachment[TOPSZ];
|
||||||
|
|
||||||
// char friendlyname[TOPSZ];
|
// char friendlyname[TOPSZ];
|
||||||
// snprintf_P(attachment, sizeof(attachment), PSTR("attachment; filename=Config_%s_%s.dmp"), NoAlNumToUnderscore(friendlyname, SettingsText(SET_FRIENDLYNAME1)), my_version);
|
// snprintf_P(attachment, sizeof(attachment), PSTR("attachment; filename=Config_%s_%s.dmp"), NoAlNumToUnderscore(friendlyname, SettingsText(SET_FRIENDLYNAME1)), my_version);
|
||||||
|
@ -2095,12 +2095,12 @@ void HandleUpgradeFirmwareStart(void)
|
||||||
{
|
{
|
||||||
if (!HttpCheckPriviledgedAccess()) { return; }
|
if (!HttpCheckPriviledgedAccess()) { return; }
|
||||||
|
|
||||||
char command[128]; // OtaUrl
|
char command[TOPSZ + 10]; // OtaUrl
|
||||||
|
|
||||||
AddLog_P(LOG_LEVEL_DEBUG, PSTR(D_LOG_HTTP D_UPGRADE_STARTED));
|
AddLog_P(LOG_LEVEL_DEBUG, PSTR(D_LOG_HTTP D_UPGRADE_STARTED));
|
||||||
WifiConfigCounter();
|
WifiConfigCounter();
|
||||||
|
|
||||||
char otaurl[101];
|
char otaurl[TOPSZ];
|
||||||
WebGetArg("o", otaurl, sizeof(otaurl));
|
WebGetArg("o", otaurl, sizeof(otaurl));
|
||||||
if (strlen(otaurl)) {
|
if (strlen(otaurl)) {
|
||||||
snprintf_P(command, sizeof(command), PSTR(D_CMND_OTAURL " %s"), otaurl);
|
snprintf_P(command, sizeof(command), PSTR(D_CMND_OTAURL " %s"), otaurl);
|
||||||
|
@ -2637,7 +2637,7 @@ int WebSend(char *buffer)
|
||||||
if (user) {
|
if (user) {
|
||||||
user = strtok_r(user, ":", &password); // user = |admin|, password = |joker|
|
user = strtok_r(user, ":", &password); // user = |admin|, password = |joker|
|
||||||
if (user && password) {
|
if (user && password) {
|
||||||
char userpass[128];
|
char userpass[200];
|
||||||
snprintf_P(userpass, sizeof(userpass), PSTR("user=%s&password=%s&"), user, password);
|
snprintf_P(userpass, sizeof(userpass), PSTR("user=%s&password=%s&"), user, password);
|
||||||
url += userpass; // url = |http://192.168.178.86/cm?user=admin&password=joker&|
|
url += userpass; // url = |http://192.168.178.86/cm?user=admin&password=joker&|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1190,7 +1190,7 @@ void HandleMqttConfiguration(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
char str[33];
|
char str[TOPSZ];
|
||||||
|
|
||||||
WSContentStart_P(S_CONFIGURE_MQTT);
|
WSContentStart_P(S_CONFIGURE_MQTT);
|
||||||
WSContentSendStyle();
|
WSContentSendStyle();
|
||||||
|
@ -1209,7 +1209,7 @@ void HandleMqttConfiguration(void)
|
||||||
|
|
||||||
void MqttSaveSettings(void)
|
void MqttSaveSettings(void)
|
||||||
{
|
{
|
||||||
char tmp[100];
|
char tmp[TOPSZ];
|
||||||
char stemp[TOPSZ];
|
char stemp[TOPSZ];
|
||||||
char stemp2[TOPSZ];
|
char stemp2[TOPSZ];
|
||||||
|
|
||||||
|
|
|
@ -174,8 +174,8 @@ char rules_vars[MAX_RULE_VARS][33] = {{ 0 }};
|
||||||
#if (MAX_RULE_VARS>16)
|
#if (MAX_RULE_VARS>16)
|
||||||
#error MAX_RULE_VARS is bigger than 16
|
#error MAX_RULE_VARS is bigger than 16
|
||||||
#endif
|
#endif
|
||||||
#if (MAX_RULE_MEMS>5)
|
#if (MAX_RULE_MEMS>16)
|
||||||
#error MAX_RULE_MEMS is bigger than 5
|
#error MAX_RULE_MEMS is bigger than 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*******************************************************************************************/
|
/*******************************************************************************************/
|
||||||
|
|
|
@ -56,7 +56,7 @@ keywords if then else endif, or, and are better readable for beginners (others m
|
||||||
#define SCRIPT_MAXSSIZE 48
|
#define SCRIPT_MAXSSIZE 48
|
||||||
#define SCRIPT_EOL '\n'
|
#define SCRIPT_EOL '\n'
|
||||||
#define SCRIPT_FLOAT_PRECISION 2
|
#define SCRIPT_FLOAT_PRECISION 2
|
||||||
#define SCRIPT_MAXPERM (MAX_RULE_MEMS*10)-4/sizeof(float)
|
#define SCRIPT_MAXPERM (5*10)-4/sizeof(float)
|
||||||
#define MAX_SCRIPT_SIZE MAX_RULE_SIZE*MAX_RULE_SETS
|
#define MAX_SCRIPT_SIZE MAX_RULE_SIZE*MAX_RULE_SETS
|
||||||
|
|
||||||
// offsets epoch readings by 1.1.2019 00:00:00 to fit into float with second resolution
|
// offsets epoch readings by 1.1.2019 00:00:00 to fit into float with second resolution
|
||||||
|
@ -1041,7 +1041,7 @@ char *isvar(char *lp, uint8_t *vtype,struct T_INDEX *tind,float *fp,char *sp,Jso
|
||||||
if (sp) strlcpy(sp,str_value,SCRIPT_MAXSSIZE);
|
if (sp) strlcpy(sp,str_value,SCRIPT_MAXSSIZE);
|
||||||
return lp+len;
|
return lp+len;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (fp) {
|
if (fp) {
|
||||||
if (!strncmp(vn.c_str(),"Epoch",5)) {
|
if (!strncmp(vn.c_str(),"Epoch",5)) {
|
||||||
|
@ -1575,7 +1575,7 @@ chknext:
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
if (!strncmp(vname,"ram",3)) {
|
if (!strncmp(vname,"ram",3)) {
|
||||||
fvar=glob_script_mem.script_mem_size+(glob_script_mem.script_size)+(MAX_RULE_MEMS*10);
|
fvar=glob_script_mem.script_mem_size+(glob_script_mem.script_size)+(5*10);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2995,7 +2995,7 @@ void ScripterEvery100ms(void) {
|
||||||
if (fast_script==99) Run_Scripter(">F",2,0);
|
if (fast_script==99) Run_Scripter(">F",2,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//mems[MAX_RULE_MEMS] is 50 bytes in 6.5
|
//mems[5] is 50 bytes in 6.5
|
||||||
// can hold 11 floats or floats + strings
|
// can hold 11 floats or floats + strings
|
||||||
// should report overflow later
|
// should report overflow later
|
||||||
void Scripter_save_pvars(void) {
|
void Scripter_save_pvars(void) {
|
||||||
|
@ -3007,7 +3007,7 @@ void Scripter_save_pvars(void) {
|
||||||
if (vtp[count].bits.is_permanent && !vtp[count].bits.is_string) {
|
if (vtp[count].bits.is_permanent && !vtp[count].bits.is_string) {
|
||||||
uint8_t index=vtp[count].index;
|
uint8_t index=vtp[count].index;
|
||||||
mlen+=sizeof(float);
|
mlen+=sizeof(float);
|
||||||
if (mlen>MAX_RULE_MEMS*10) {
|
if (mlen>5*10) {
|
||||||
vtp[count].bits.is_permanent=0;
|
vtp[count].bits.is_permanent=0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3021,7 +3021,7 @@ void Scripter_save_pvars(void) {
|
||||||
char *sp=glob_script_mem.glob_snp+(index*glob_script_mem.max_ssize);
|
char *sp=glob_script_mem.glob_snp+(index*glob_script_mem.max_ssize);
|
||||||
uint8_t slen=strlen(sp);
|
uint8_t slen=strlen(sp);
|
||||||
mlen+=slen+1;
|
mlen+=slen+1;
|
||||||
if (mlen>MAX_RULE_MEMS*10) {
|
if (mlen>5*10) {
|
||||||
vtp[count].bits.is_permanent=0;
|
vtp[count].bits.is_permanent=0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4755,7 +4755,7 @@ bool Xdrv10(uint8_t function)
|
||||||
glob_script_mem.script_size=MAX_SCRIPT_SIZE;
|
glob_script_mem.script_size=MAX_SCRIPT_SIZE;
|
||||||
glob_script_mem.flags=0;
|
glob_script_mem.flags=0;
|
||||||
glob_script_mem.script_pram=(uint8_t*)Settings.mems[0];
|
glob_script_mem.script_pram=(uint8_t*)Settings.mems[0];
|
||||||
glob_script_mem.script_pram_size=MAX_RULE_MEMS*10;
|
glob_script_mem.script_pram_size=5*10;
|
||||||
|
|
||||||
#ifdef USE_BUTTON_EVENT
|
#ifdef USE_BUTTON_EVENT
|
||||||
for (uint32_t cnt=0;cnt<MAX_KEYS;cnt++) {
|
for (uint32_t cnt=0;cnt<MAX_KEYS;cnt++) {
|
||||||
|
|
Loading…
Reference in New Issue