Prep for release 6.5

Prep for release 6.5
This commit is contained in:
Theo Arends 2019-03-14 17:21:45 +01:00
parent 7a3e8a5108
commit d9aa3102a7
7 changed files with 82 additions and 106 deletions

View File

@ -195,35 +195,27 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
| USE_DISPLAY | - | - | - | - | - | - | | USE_DISPLAY | - | - | - | - | - | - |
## Changelog ## Changelog
Version 6.5.0 20190315 Version 6.5.0 20190319
* Remove commands SetOption14 and SetOption63 as it has been superseded by command Interlock
* Remove command SetOption14 as it has been superseded by command Interlock
* Remove command SetOption63 as it has been superseded by command Interlock
* Remove command SetOption35 0-255 for mDNS start-up delay (#4793) * Remove command SetOption35 0-255 for mDNS start-up delay (#4793)
* Change webserver content handling from single String to small Chunks increasing RAM * Change webserver content handling from single String to small Chunks increasing RAM
* Change logging message handling
* Change code use of boolean to bool and byte to uint8_t * Change code use of boolean to bool and byte to uint8_t
* Change code uint8_t flags to bool flags * Change code uint8_t flags to bool flags
* Change sonoff_template.h layout regarding optional module flags like ADC0 * Change sonoff_template.h layout regarding optional module flags like ADC0
* Change button driver making it modular
* Change sonoff_template.h module lay-out by removing non-configurable GPIOs * Change sonoff_template.h module lay-out by removing non-configurable GPIOs
* Change button driver making it modular
* Change switch driver making it modular and introduce input filter (#4665, #4724) * Change switch driver making it modular and introduce input filter (#4665, #4724)
* Change switch input detection by optimizing switch debounce (#4724) * Change switch input detection by optimizing switch debounce (#4724)
* Change web authentication (#4865) * Change web authentication (#4865)
* Change image name BE_MINIMAL to FIRMWARE_MINIMAL (#5106) * Change image name BE_MINIMAL to FIRMWARE_MINIMAL and USE_xyz to FIRMWARE_xyz (#5106)
* Change image names USE_xyz to FIRMWARE_xyz (#5106) * Change GUI weblog from XML to plain text solving possible empty screens (#5154)
* Change GUI weblog solving possible empty screens (#5154)
* Change PN532 support from I2C to Serial for more stability (#5162)
* Change template update by removing possibility to add user module config keeping template as defined (#5222)
* Fix most compiler warnings * Fix most compiler warnings
* Fix IR local echo
* Fix Display exception 28 when JSON value is NULL received * Fix Display exception 28 when JSON value is NULL received
* Fix HLW8012, HJL01 and BL0937 based energy sensors low Power (below 10W) measurement regression from 6.4.1.6
* Fix epaper driver (#4785) * Fix epaper driver (#4785)
* Fix Home Assistant Sensor Discovery Software Watchdog restart (#4831, #4988) * Fix HAss Sensor Discovery Software Watchdog restart (#4831, #4988)
* Fix allowable MAX_RULE_VARS to 16 (#4933) * Fix allowable MAX_RULE_VARS to 16 (#4933)
* Fix mDNS addService (#4938, #4951) * Fix mDNS addService (#4938, #4951)
* Fix Hass discovery of MHZ19(B) sensors (#4992) * Fix HAss discovery of MHZ19(B) sensors (#4992)
* Fix some exceptions and watchdogs due to lack of stack space (#5215) * Fix some exceptions and watchdogs due to lack of stack space (#5215)
* Fix GUI wifi password acception starting with asteriks (*) (#5231, #5242) * Fix GUI wifi password acception starting with asteriks (*) (#5231, #5242)
* Fix command WebSend intermittent results (#5273, #5304) * Fix command WebSend intermittent results (#5273, #5304)
@ -233,52 +225,50 @@ Version 6.5.0 20190315
* Fix float calculations in range from 0 to -1 (#5386) * Fix float calculations in range from 0 to -1 (#5386)
* Fix exception on GUI Configure Logging and Configure Other (#5424) * Fix exception on GUI Configure Logging and Configure Other (#5424)
* Add commands PowerCal, VoltageCal and CurrentCal for HLW8012, HJL01 and BL0937 based energy sensors * Add commands PowerCal, VoltageCal and CurrentCal for HLW8012, HJL01 and BL0937 based energy sensors
* Add Power status functionality to LED2 when configured leaving LED1 for Link status indication * Add command SerialDelimiter 128 to filter reception of only characters between ASCII 32 and 127 (#5131)
* Add support for Smanergy KA10 Smart Wall Socket with Energy monitoring * Add command SSerialSend5 \<hexdata\> to SerialBridge
* Add SerialBridge command SSerialSend5 \<hexdata\> * Add command Interlock 0 / 1 / 1,2 3,4 .. to control interlock ON/OFF and add up to 8 relays in 1 to 4 interlock groups (#4910, #5014)
* Add SetOption32 until SetOption49 diagnostic information to Status 3 report as replacement for second property value in SetOption property name * Add command Template 255 to copy module configuration over to current active template and store as user template named Merged (#5371)
* Add Resolution property to Status 3 report providing previous SetOption second value property * Add command WifiConfig 7 to allow reset of device in AP mode without admin password (#5297)
* Add user configuration of HLW8012 and HJL-01/BL0937 Energy Monitoring as used in Sonoff S31, Pow Ra and many Tuya based devices
* Add user configuration of MCP39F501 Energy Monitoring as used in Shelly2
* Add property LinkCount to state and status 11 message representing number of Wifi Link re-connections
* Add property MqttCount to status 6 message representing number of Mqtt re-connections
* Add property Downtime to state and status 11 message representing the duration of wifi connection loss
* Add support for commands in sensor drivers
* Add (S)SerialSend3 escape sequence \x to allow hexadecimal byte value (#3560, #4947)
* Add command SetOption36 to control boot loop default restoration (#4645, #5063) * Add command SetOption36 to control boot loop default restoration (#4645, #5063)
* Add define DS18B20_INTERNAL_PULLUP to select internal input pullup when only one DS18B20 sensor is connected eliminating external resistor (#4738) * Add command SetOption37 for RGBCW color mapping (#5326)
* Add variable %timestamp% to rules (#4749) * Add command SetOption55 0/1 and define MDNS_ENABLE to disable/enable mDNS (#4793, #4923)
* Add command SetOption62 0/1 to disable retain on Button or Switch hold messages (#5299)
* Add support for Smanergy KA10 Smart Wall Socket with Energy monitoring
* Add support for commands in sensor drivers
* Add support for MAX31855 K-Type thermocouple sensor using softSPI (#4764) * Add support for MAX31855 K-Type thermocouple sensor using softSPI (#4764)
* Add button control when no relay configured (#4682) * Add support for Near Field Communication (NFC) controller PN532 using Serial (#4791, #5162)
* Add support for Near Field Communication (NFC) controller PN532 using I2C (#4791)
* Add command SetOption55 0/1 to disable/enable mDNS (#4793)
* Add 4 seconds startup delay to button control (#4829)
* Add support for OBI Power Socket 2 (#4829) * Add support for OBI Power Socket 2 (#4829)
* Add support for YTF IR Bridge (#4855) * Add support for YTF IR Bridge (#4855)
* Add support for Mi LED Desk Lamp with rotary switch (#4887) * Add support for Mi LED Desk Lamp with rotary switch (#4887)
* Add support for Digoo DG-SP202 Smart Socket with Energy monitoring (#4891) * Add support for Digoo DG-SP202 Smart Socket with Energy monitoring (#4891)
* Add support for MAX44009 Ambient Light sensor (#4907) * Add support for MAX44009 Ambient Light sensor (#4907)
* Add split interlock (#4910)
* Add support for inverted buttons and inverted buttons without pullup (#4914) * Add support for inverted buttons and inverted buttons without pullup (#4914)
* Add core version conditional compile options to provided PWM files (#4917)
* Add support for Luminea ZX2820 Smart Socket with Energy monitoring (#4921) * Add support for Luminea ZX2820 Smart Socket with Energy monitoring (#4921)
* Add define MDNS_ENABLE to control initial mDNS state (#4923)
* Add command Interlock 0 / 1 / 1,2 3,4 .. to control interlock ON/OFF and add up to 8 relays in 1 to 4 interlock groups (#5014)
* Add resiliency to saved Settings (#5065)
* Add support for multiple ADS1115 I2C devices (#5083) * Add support for multiple ADS1115 I2C devices (#5083)
* Add rule support for "==", "!=" ">=" and "<=" (#5122)
* Add MHZ19 Temperature as Domoticz Temperature selection (#5128)
* Add command SerialDelimiter 128 to filter reception of only characters between ASCII 32 and 127 (#5131)
* Add Hass status sensor (#5139)
* Add status message to former declined group commands (#5145)
* Add support for online template change using command Template or GUI Configure Other (#5177) * Add support for online template change using command Template or GUI Configure Other (#5177)
* Add parameter CFG_HOLDER to status 1 message (#5206) * Add support for Korean language translations (#5344)
* Add rule expression enabled by define USE_EXPRESSION in my_user_config.h (#5210)
* Add Configure Template menu option to GUI (#5222)
* Add option WifiConfig 7 to allow reset of device in AP mode without admin password (#5297)
* Add command SetOption62 0/1 to disable retain on Button or Swith hold messages (#5299)
* Add command SetOption37 for RGBCW color mapping (#5326)
* Add Korean language translations (#5344)
* Add command Template 255 to copy module configuration over to current active template and store as user template named Merged (#5371)
* Add 0x to IRRemote (SetOption29) and RCSwitch (SetOption28) received hexadecimal data (#5431)
* Add support for sensor SCD30 (#5434) * Add support for sensor SCD30 (#5434)
* Add parameter CFG_HOLDER to status 1 message (#5206)
* Add SetOption32 until SetOption49 diagnostic information to Status 3 report as replacement for second property value in SetOption property name
* Add Resolution property to Status 3 report providing previous SetOption second value property
* Add property MqttCount to status 6 message representing number of Mqtt re-connections
* Add property LinkCount to state and status 11 message representing number of Wifi Link re-connections
* Add property Downtime to state and status 11 message representing the duration of wifi connection loss
* Add variable %timestamp% to rules (#4749)
* Add rule support for "==", "!=" ">=" and "<=" (#5122)
* Add rule expression enabled by define USE_EXPRESSION in my_user_config.h (#5210)
* Add Power status functionality to LED2 when configured leaving LED1 for Link status indication
* Add user configuration of HLW8012 and HJL-01/BL0937 Energy Monitoring as used in Sonoff Pow and many Tuya based devices
* Add user configuration of MCP39F501 Energy Monitoring as used in Shelly2
* Add online template configuration using both commands and Configure Template menu option in GUI
* Add (S)SerialSend3 escape sequence \x to allow hexadecimal byte value (#3560, #4947)
* Add define DS18B20_INTERNAL_PULLUP to select internal input pullup when only one DS18B20 sensor is connected eliminating external resistor (#4738)
* Add button control when no relay configured (#4682)
* Add startup delay of 4 seconds to button control (#4829)
* Add core version conditional compile options to provided PWM files (#4917)
* Add resiliency to saved Settings (#5065)
* Add MHZ19 Temperature as Domoticz Temperature selection (#5128)
* Add HAss status sensor (#5139)
* Add status message to former declined group commands (#5145)
* Add 0x to IRRemote (SetOption29) and RCSwitch (SetOption28) received hexadecimal data (#5431)

View File

@ -1,4 +1,5 @@
/* 6.5.0 20190315 /* 6.5.0 20190319
* New Release
* *
* 6.4.1.21 20190309 * 6.4.1.21 20190309
* Fix exception on GUI Configure Logging and Configure Other (#5424) * Fix exception on GUI Configure Logging and Configure Other (#5424)

View File

@ -200,8 +200,8 @@ struct SYSCFG {
uint8_t seriallog_level; // 09E uint8_t seriallog_level; // 09E
uint8_t sta_config; // 09F uint8_t sta_config; // 09F
uint8_t sta_active; // 0A0 uint8_t sta_active; // 0A0
char sta_ssid[2][33]; // 0A1 - Keep together with sta_pwd as being copied as one chunck with reset 4/5 char sta_ssid[2][33]; // 0A1 - Keep together with sta_pwd as being copied as one chunck with reset 5
char sta_pwd[2][65]; // 0E3 - Keep together with sta_ssid as being copied as one chunck with reset 4/5 char sta_pwd[2][65]; // 0E3 - Keep together with sta_ssid as being copied as one chunck with reset 5
char hostname[33]; // 165 char hostname[33]; // 165
char syslog_host[33]; // 186 char syslog_host[33]; // 186
uint8_t rule_stop; // 1A7 uint8_t rule_stop; // 1A7
@ -213,12 +213,12 @@ struct SYSCFG {
uint8_t free_1D5[20]; // 1D5 Free since 5.12.0e uint8_t free_1D5[20]; // 1D5 Free since 5.12.0e
char mqtt_host[33]; // 1E9 char mqtt_host[33]; // 1E9 - Keep together with below as being copied as one chunck with reset 6
uint16_t mqtt_port; // 20A uint16_t mqtt_port; // 20A - Keep together
char mqtt_client[33]; // 20C char mqtt_client[33]; // 20C - Keep together
char mqtt_user[33]; // 22D char mqtt_user[33]; // 22D - Keep together
char mqtt_pwd[33]; // 24E char mqtt_pwd[33]; // 24E - Keep together
char mqtt_topic[33]; // 26F char mqtt_topic[33]; // 26F - Keep together with above items as being copied as one chunck with reset 6
char button_topic[33]; // 290 char button_topic[33]; // 290
char mqtt_grptopic[33]; // 2B1 char mqtt_grptopic[33]; // 2B1
uint8_t display_model; // 2D2 uint8_t display_model; // 2D2

View File

@ -2082,31 +2082,26 @@ void Every250mSeconds(void)
} }
if (restart_flag && (backlog_pointer == backlog_index)) { if (restart_flag && (backlog_pointer == backlog_index)) {
if ((214 == restart_flag) || (215 == restart_flag) || (216 == restart_flag)) { if ((214 == restart_flag) || (215 == restart_flag) || (216 == restart_flag)) {
char storage[sizeof(Settings.sta_ssid) + sizeof(Settings.sta_pwd)]; char storage_wifi[sizeof(Settings.sta_ssid) +
char storage_mqtt_host[sizeof(Settings.mqtt_host)]; sizeof(Settings.sta_pwd)];
uint16_t storage_mqtt_port; char storage_mqtt[sizeof(Settings.mqtt_host) +
char storage_mqtt_user[sizeof(Settings.mqtt_user)]; sizeof(Settings.mqtt_port) +
char storage_mqtt_pwd[sizeof(Settings.mqtt_pwd)]; sizeof(Settings.mqtt_client) +
char storage_mqtt_topic[sizeof(Settings.mqtt_topic)]; sizeof(Settings.mqtt_user) +
memcpy(storage, Settings.sta_ssid, sizeof(storage)); // Backup current SSIDs and Passwords sizeof(Settings.mqtt_pwd) +
sizeof(Settings.mqtt_topic)];
memcpy(storage_wifi, Settings.sta_ssid, sizeof(storage_wifi)); // Backup current SSIDs and Passwords
if (216 == restart_flag) { if (216 == restart_flag) {
memcpy(storage_mqtt_host, Settings.mqtt_host, sizeof(Settings.mqtt_host)); memcpy(storage_mqtt, Settings.mqtt_host, sizeof(storage_mqtt)); // Backup mqtt host, port, client, username and password
storage_mqtt_port = Settings.mqtt_port;
memcpy(storage_mqtt_user, Settings.mqtt_user, sizeof(Settings.mqtt_user));
memcpy(storage_mqtt_pwd, Settings.mqtt_pwd, sizeof(Settings.mqtt_pwd));
memcpy(storage_mqtt_topic, Settings.mqtt_topic, sizeof(Settings.mqtt_topic));
} }
if ((215 == restart_flag) || (216 == restart_flag)) { if ((215 == restart_flag) || (216 == restart_flag)) {
SettingsErase(0); // Erase all flash from program end to end of physical flash SettingsErase(0); // Erase all flash from program end to end of physical flash
} }
SettingsDefault(); SettingsDefault();
memcpy(Settings.sta_ssid, storage, sizeof(storage)); // Restore current SSIDs and Passwords memcpy(Settings.sta_ssid, storage_wifi, sizeof(storage_wifi)); // Restore current SSIDs and Passwords
if (216 == restart_flag) { // Restore the mqtt host, port, username and password if (216 == restart_flag) {
memcpy(Settings.mqtt_host, storage_mqtt_host, sizeof(Settings.mqtt_host)); memcpy(Settings.mqtt_host, storage_mqtt, sizeof(storage_mqtt)); // Restore the mqtt host, port, client, username and password
Settings.mqtt_port = storage_mqtt_port; strlcpy(Settings.mqtt_client, MQTT_CLIENT_ID, sizeof(Settings.mqtt_client)); // Set client to default
memcpy(Settings.mqtt_user, storage_mqtt_user, sizeof(Settings.mqtt_user));
memcpy(Settings.mqtt_pwd, storage_mqtt_pwd, sizeof(Settings.mqtt_pwd));
memcpy(Settings.mqtt_topic, storage_mqtt_topic, sizeof(Settings.mqtt_topic));
} }
restart_flag = 2; restart_flag = 2;
} }

View File

@ -1278,7 +1278,7 @@ void AddLog_P2(uint8_t loglevel, PGM_P formatP, ...)
{ {
va_list arg; va_list arg;
va_start(arg, formatP); va_start(arg, formatP);
int len = vsnprintf_P(log_data, sizeof(log_data), formatP, arg); vsnprintf_P(log_data, sizeof(log_data), formatP, arg);
va_end(arg); va_end(arg);
AddLog(loglevel); AddLog(loglevel);

View File

@ -272,7 +272,7 @@ const char HTTP_HEAD_STYLE3[] PROGMEM =
#else #else
"<h3>%s " D_MODULE "</h3>" "<h3>%s " D_MODULE "</h3>"
#endif #endif
"<h2>%s</h2>%s</div>"; "<h2>%s</h2>";
const char HTTP_MSG_SLIDER1[] PROGMEM = const char HTTP_MSG_SLIDER1[] PROGMEM =
"<div><span class='p'>" D_COLDLIGHT "</span><span class='q'>" D_WARMLIGHT "</span></div>" "<div><span class='p'>" D_COLDLIGHT "</span><span class='q'>" D_WARMLIGHT "</span></div>"
@ -566,27 +566,6 @@ bool HttpCheckPriviledgedAccess(bool autorequestauth = true)
return true; return true;
} }
String WSNetworkInfo(void)
{
String info = "";
if (Settings.flag3.gui_hostname_ip) {
uint8_t more_ips = 0;
info += F("<h3>"); info += my_hostname;
if (mdns_begun) { info += F(".local"); }
info += F(" (");
if (static_cast<uint32_t>(WiFi.localIP()) != 0) {
info += WiFi.localIP().toString();
more_ips++;
}
if (static_cast<uint32_t>(WiFi.softAPIP()) != 0) {
if (more_ips) { info += F(", "); }
info += WiFi.softAPIP().toString();
}
info += F(")</h3>");
}
return info;
}
void WSHeaderSend(void) void WSHeaderSend(void)
{ {
WebServer->sendHeader(F("Cache-Control"), F("no-cache, no-store, must-revalidate")); WebServer->sendHeader(F("Cache-Control"), F("no-cache, no-store, must-revalidate"));
@ -701,7 +680,18 @@ void WSContentSendStyle_P(const char* style)
WSContentSend_P(HTTP_HEAD_STYLE1); WSContentSend_P(HTTP_HEAD_STYLE1);
WSContentSend_P(HTTP_HEAD_STYLE2); WSContentSend_P(HTTP_HEAD_STYLE2);
WSContentSend_P(style); WSContentSend_P(style);
WSContentSend_P(HTTP_HEAD_STYLE3, ModuleName().c_str(), Settings.friendlyname[0], WSNetworkInfo().c_str()); WSContentSend_P(HTTP_HEAD_STYLE3, ModuleName().c_str(), Settings.friendlyname[0]);
if (Settings.flag3.gui_hostname_ip) {
bool lip = (static_cast<uint32_t>(WiFi.localIP()) != 0);
bool sip = (static_cast<uint32_t>(WiFi.softAPIP()) != 0);
WSContentSend_P(PSTR("<h4>%s%s (%s%s%s)</h4>"), // sonoff.local (192.168.2.12,192.168.4.1)
my_hostname,
(mdns_begun) ? ".local" : "",
(lip) ? WiFi.localIP().toString().c_str() : "",
(lip && sip) ? "," : "",
(sip) ? WiFi.softAPIP().toString().c_str() : "");
}
WSContentSend_P(PSTR("</div>"));
} }
void WSContentSendStyle(void) void WSContentSendStyle(void)
@ -812,7 +802,7 @@ void HandleRoot(void)
if ((Settings.web_password[0] != 0) && !(WebServer->hasArg("USER1")) && !(WebServer->hasArg("PASS1")) && HTTP_MANAGER_RESET_ONLY != webserver_state) { if ((Settings.web_password[0] != 0) && !(WebServer->hasArg("USER1")) && !(WebServer->hasArg("PASS1")) && HTTP_MANAGER_RESET_ONLY != webserver_state) {
HandleWifiLogin(); HandleWifiLogin();
} else { } else {
if (!(Settings.web_password[0] != 0) || ((WebServer->arg("USER1") == WEB_USERNAME ) && (WebServer->arg("PASS1") == Settings.web_password ) || HTTP_MANAGER_RESET_ONLY == webserver_state)) { if (!(Settings.web_password[0] != 0) || (((WebServer->arg("USER1") == WEB_USERNAME ) && (WebServer->arg("PASS1") == Settings.web_password )) || HTTP_MANAGER_RESET_ONLY == webserver_state)) {
HandleWifiConfiguration(); HandleWifiConfiguration();
} else { } else {
// wrong user and pass // wrong user and pass

View File

@ -166,7 +166,7 @@ static void Shorten(char** s, char *prefix)
} }
} }
int try_snprintf_P(char *s, size_t n, const char *format, ... ) void try_snprintf_P(char *s, int n, const char *format, ... )
{ {
va_list args; va_list args;
va_start(args, format); va_start(args, format);