From 6bb0f034c34a6e6a3769053e84e61356d2038243 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Sat, 21 Apr 2018 13:10:44 +0200 Subject: [PATCH 01/14] Fix Timer invalid JSON message when too long Fix Timer invalid JSON message when too long (#2447) --- sonoff/xdrv_09_timers.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonoff/xdrv_09_timers.ino b/sonoff/xdrv_09_timers.ino index 82884ab4e..0ffe94f55 100644 --- a/sonoff/xdrv_09_timers.ino +++ b/sonoff/xdrv_09_timers.ino @@ -345,7 +345,7 @@ boolean TimerCommand() } } else { if (devices_present) { - StaticJsonBuffer<128> jsonBuffer; + StaticJsonBuffer<200> 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 From 84fce04a68e196b811a923719b4ce019f7bbb2ee Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Sat, 21 Apr 2018 17:10:35 +0200 Subject: [PATCH 02/14] Updated Bulgarian language file (#2503) Updated Bulgarian language file (#2503) --- sonoff/language/bg-BG.h | 90 ++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/sonoff/language/bg-BG.h b/sonoff/language/bg-BG.h index 29391e192..7f30252ec 100644 --- a/sonoff/language/bg-BG.h +++ b/sonoff/language/bg-BG.h @@ -28,7 +28,7 @@ * Use online command StateText to translate ON, OFF, HOLD and TOGGLE. * Use online command Prefix to translate cmnd, stat and tele. * - * Updated until v5.12.0l + * Updated until v5.12.0m \*********************************************************************/ //#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -193,7 +193,7 @@ #define D_SYSLOG_HOST_NOT_FOUND "Хостът на системния лог не е намерен" // settings.ino -#define D_SAVED_TO_FLASH_AT "Запазено в флаш паметта на" +#define D_SAVED_TO_FLASH_AT "Запазено във флаш паметта на" #define D_LOADED_FROM_FLASH_AT "Заредено от флаш паметта от" #define D_USE_DEFAULTS "Използване на параметри по подразбиране" #define D_ERASED_SECTOR "Изтрит сектор" @@ -224,12 +224,12 @@ #define D_CONFIGURE_MQTT "Конфигурация на MQTT" #define D_CONFIGURE_DOMOTICZ "Конфигурация на Domoticz" #define D_CONFIGURE_LOGGING "Конфигурация на логинга" -#define D_CONFIGURE_OTHER "Конфигурация на други" -#define D_CONFIRM_RESET_CONFIGURATION "Потвърдете ресетирането" -#define D_RESET_CONFIGURATION "Ресетиране на конфигурацията" +#define D_CONFIGURE_OTHER "Драги конфигурации" +#define D_CONFIRM_RESET_CONFIGURATION "Потвърдете изчистването" +#define D_RESET_CONFIGURATION "Изчистване на конфигурацията" #define D_BACKUP_CONFIGURATION "Запазване на конфигурацията" #define D_RESTORE_CONFIGURATION "Възстановяване на конфигурацията" -#define D_MAIN_MENU "Основно Меню" +#define D_MAIN_MENU "Основно меню" #define D_MODULE_PARAMETERS "Параметри на модула" #define D_MODULE_TYPE "Тип на модула" @@ -237,10 +237,10 @@ #define D_SERIAL_IN "Сериен вход" #define D_SERIAL_OUT "Сериен изход" -#define D_WIFI_PARAMETERS "Параметры на Wifi" -#define D_SCAN_FOR_WIFI_NETWORKS "Сканиране за безжични мрежи Wifi" -#define D_SCAN_DONE "Сканированието е завършено" -#define D_NO_NETWORKS_FOUND "Не са намерени мрежи" +#define D_WIFI_PARAMETERS "Wifi параметри" +#define D_SCAN_FOR_WIFI_NETWORKS "Сканиране за безжични мрежи" +#define D_SCAN_DONE "Сканирането приключи" +#define D_NO_NETWORKS_FOUND "Не бяха открити мрежи" #define D_REFRESH_TO_SCAN_AGAIN "Обновяване за повторно сканиране" #define D_DUPLICATE_ACCESSPOINT "Дублиране на точката за достъп (AP)" #define D_SKIPPING_LOW_QUALITY "Пропускане поради лошо качество" @@ -280,9 +280,9 @@ #define D_CONFIGURATION_RESET "Конфигурацията е изчистена" #define D_PROGRAM_VERSION "Версия на програмата" -#define D_BUILD_DATE_AND_TIME "Дата & Час на компилацията" +#define D_BUILD_DATE_AND_TIME "Дата и час на компилацията" #define D_CORE_AND_SDK_VERSION "Версия на Core/SDK" -#define D_FLASH_WRITE_COUNT "Брой на записите във Flash" +#define D_FLASH_WRITE_COUNT "Брой на записите във флаш паметта" #define D_MAC_ADDRESS "MAC адрес" #define D_MQTT_HOST "MQTT хост" #define D_MQTT_PORT "MQTT порт" @@ -369,31 +369,31 @@ #define D_CONFIGURE_TIMER "Конфигуриране на таймер" #define D_TIMER_PARAMETERS "Параметри на таймера" #define D_TIMER_ARM "Arm" -#define D_TIMER_TIME "Time" -#define D_TIMER_DAYS "Days" -#define D_TIMER_REPEAT "Repeat" -#define D_TIMER_OUTPUT "Output" -#define D_TIMER_ACTION "Action" +#define D_TIMER_TIME "Време" +#define D_TIMER_DAYS "Дни" +#define D_TIMER_REPEAT "Повтори" +#define D_TIMER_OUTPUT "Изход" +#define D_TIMER_ACTION "Действие" // xdrv_10_knx.ino -#define D_CONFIGURE_KNX "Configure KNX" -#define D_KNX_PARAMETERS "KNX Parameters" -#define D_KNX_GENERAL_CONFIG "General" -#define D_KNX_PHYSICAL_ADDRESS "Physical Address" -#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Must be unique on the KNX network )" -#define D_KNX_ENABLE "Enable KNX" -#define D_KNX_GROUP_ADDRESS_TO_WRITE "Data to Send to Group Addresses" -#define D_ADD "Add" -#define D_DELETE "Delete" -#define D_REPLY "Reply" -#define D_KNX_GROUP_ADDRESS_TO_READ "Group Addresses to Receive Data from" +#define D_CONFIGURE_KNX "Конфигуриране на KNX" +#define D_KNX_PARAMETERS "KNX параметри" +#define D_KNX_GENERAL_CONFIG "Основни" +#define D_KNX_PHYSICAL_ADDRESS "Физически адрес" +#define D_KNX_PHYSICAL_ADDRESS_NOTE "( Трябва да е уникален в KNX мрежата )" +#define D_KNX_ENABLE "Активиране на KNX" +#define D_KNX_GROUP_ADDRESS_TO_WRITE "Групови адреси за изпращане на данни" +#define D_ADD "Добаване" +#define D_DELETE "Изтриване" +#define D_REPLY "Отговор" +#define D_KNX_GROUP_ADDRESS_TO_READ "Групови адреси за получаване на данни" #define D_LOG_KNX "KNX: " -#define D_RECEIVED_FROM "Received from" -#define D_KNX_COMMAND_WRITE "Write" -#define D_KNX_COMMAND_READ "Read" -#define D_KNX_COMMAND_OTHER "Other" -#define D_SENT_TO "sent to" -#define D_KNX_WARNING "The group address ( 0 / 0 / 0 ) is reserved and can not be used." +#define D_RECEIVED_FROM "Получен от" +#define D_KNX_COMMAND_WRITE "Писане" +#define D_KNX_COMMAND_READ "Четене" +#define D_KNX_COMMAND_OTHER "Друго" +#define D_SENT_TO "изпратен до" +#define D_KNX_WARNING "Груповият адрес ( 0 / 0 / 0 ) е резервиран и не може да бъде използван." // xdrv_03_energy.ino #define D_ENERGY_TODAY "Използвана енергия днес" @@ -446,7 +446,7 @@ #define D_SENSOR_SAIR_TX "SAir Tx" #define D_SENSOR_SPI_CS "SPI CS" #define D_SENSOR_SPI_DC "SPI DC" -#define D_SENSOR_BACKLIGHT "BkLight" +#define D_SENSOR_BACKLIGHT "Подсветка" #define D_SENSOR_PMS5003 "PMS5003" #define D_SENSOR_SDS0X1 "SDS0X1" #define D_SENSOR_SBR_RX "SerBr Rx" @@ -456,26 +456,26 @@ // Units #define D_UNIT_AMPERE "А" -#define D_UNIT_CENTIMETER "cm" -#define D_UNIT_HOUR "Ч" +#define D_UNIT_CENTIMETER "см" +#define D_UNIT_HOUR "ч" #define D_UNIT_KILOOHM "кОм" -#define D_UNIT_KILOWATTHOUR "кВт" +#define D_UNIT_KILOWATTHOUR "кВт/ч" #define D_UNIT_LUX "лукс" #define D_UNIT_MICROGRAM_PER_CUBIC_METER "микрограм/м3" -#define D_UNIT_MICROMETER "микрметър" -#define D_UNIT_MICROSECOND "микросек." +#define D_UNIT_MICROMETER "микрометър" +#define D_UNIT_MICROSECOND "микросек" #define D_UNIT_MILLIAMPERE "мА" -#define D_UNIT_MILLISECOND "милисек." -#define D_UNIT_MINUTE "мин." +#define D_UNIT_MILLISECOND "мсек" +#define D_UNIT_MINUTE "мин" #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" -#define D_UNIT_PRESSURE "Хектопаскал" -#define D_UNIT_SECOND "сек." +#define D_UNIT_PRESSURE "хПа" +#define D_UNIT_SECOND "сек" #define D_UNIT_SECTORS "сектори" #define D_UNIT_VOLT "В" #define D_UNIT_WATT "Вт" -#define D_UNIT_WATTHOUR "Вт/Час" +#define D_UNIT_WATTHOUR "Вт/ч" // Log message prefix #define D_LOG_APPLICATION "APP: " // Application From 9549ab3ad36d0e30076702a67ab213070e12ddb6 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Sat, 21 Apr 2018 18:17:24 +0200 Subject: [PATCH 03/14] Remove display of passwords (#2505) Remove display of passwords (#2505) --- sonoff/i18n.h | 4 ++++ sonoff/sonoff.ino | 8 ++++++-- sonoff/sonoff_post.h | 42 ++++++++++++++++++++++++++++------------- sonoff/support.ino | 2 +- sonoff/webserver.ino | 10 +++++----- sonoff/xdrv_00_mqtt.ino | 4 +++- 6 files changed, 48 insertions(+), 22 deletions(-) diff --git a/sonoff/i18n.h b/sonoff/i18n.h index fc6a43db4..f50242d86 100644 --- a/sonoff/i18n.h +++ b/sonoff/i18n.h @@ -372,6 +372,8 @@ /********************************************************************************************/ +#define D_ASTERIX "********" + #ifndef MY_LANGUAGE #include "language/en-GB.h" #else @@ -435,11 +437,13 @@ const char S_JSON_COMMAND_NVALUE_ACTIVE_NVALUE[] PROGMEM = "{\"%s\":\"%d (" D const char S_JSON_COMMAND_NVALUE[] PROGMEM = "{\"%s\":%d}"; const char S_JSON_COMMAND_LVALUE[] PROGMEM = "{\"%s\":%lu}"; const char S_JSON_COMMAND_SVALUE[] PROGMEM = "{\"%s\":\"%s\"}"; +const char S_JSON_COMMAND_ASTERIX[] PROGMEM = "{\"%s\":\"" D_ASTERIX "\"}"; const char S_JSON_COMMAND_XVALUE[] PROGMEM = "{\"%s\":%s}"; // %s must provide quotes on non-number const char S_JSON_COMMAND_INDEX_NVALUE[] PROGMEM = "{\"%s%d\":%d}"; const char S_JSON_COMMAND_INDEX_LVALUE[] PROGMEM = "{\"%s%d\":%lu}"; const char S_JSON_COMMAND_INDEX_SVALUE[] PROGMEM = "{\"%s%d\":\"%s\"}"; +const char S_JSON_COMMAND_INDEX_ASTERIX[] PROGMEM = "{\"%s%d\":\"" D_ASTERIX "\"}"; const char S_JSON_COMMAND_INDEX_SVALUE_SVALUE[] PROGMEM = "{\"%s%d\":\"%s%s\"}"; const char S_JSON_COMMAND_INDEX_NVALUE_ACTIVE_NVALUE[] PROGMEM = "{\"%s%d\":\"%d (" D_JSON_ACTIVE " %d)\"}"; diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 00850b891..4bb89b6e6 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -922,8 +922,10 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len) strlcpy(Settings.sta_pwd[index -1], (1 == payload) ? (1 == index) ? STA_PASS1 : STA_PASS2 : dataBuf, sizeof(Settings.sta_pwd[0])); Settings.sta_active = index -1; restart_flag = 2; + snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, index, Settings.sta_pwd[index -1]); + } else { + snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_ASTERIX, command, index); } - snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, index, Settings.sta_pwd[index -1]); } else if ((CMND_HOSTNAME == command_code) && !grpflg) { if ((data_len > 0) && (data_len < sizeof(Settings.hostname))) { @@ -978,8 +980,10 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len) else if (CMND_WEBPASSWORD == command_code) { if ((data_len > 0) && (data_len < sizeof(Settings.web_password))) { strlcpy(Settings.web_password, (!strcmp(dataBuf,"0")) ? "" : (1 == payload) ? WEB_PASSWORD : dataBuf, sizeof(Settings.web_password)); + snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, Settings.web_password); + } else { + snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_ASTERIX, command); } - snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, Settings.web_password); } else if (CMND_WEBLOG == command_code) { if ((payload >= LOG_LEVEL_NONE) && (payload <= LOG_LEVEL_ALL)) Settings.weblog_level = payload; diff --git a/sonoff/sonoff_post.h b/sonoff/sonoff_post.h index 47a752c72..09d68f89a 100644 --- a/sonoff/sonoff_post.h +++ b/sonoff/sonoff_post.h @@ -79,6 +79,7 @@ void KNX_CB_Action(message_t const &msg, void *arg); #endif // #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow #define USE_ARILUX_RF // Add support for Arilux RF remote controller (+0k8 code, 252 iram (non 2.3.0)) +#define USE_SR04 // Add support for HC-SR04 ultrasonic devices (+1k code) #endif // USE_ALL_SENSORS ===================== #if defined(USE_DS18x20) || defined(USE_DS18x20_LEGACY) @@ -99,6 +100,9 @@ void KNX_CB_Action(message_t const &msg, void *arg); #ifdef USE_HOME_ASSISTANT #undef USE_HOME_ASSISTANT // Disable Home Assistant #endif +#ifdef USE_KNX +#undef USE_KNX // Disable KNX IP Protocol Support +#endif //#ifdef USE_WEBSERVER //#undef USE_WEBSERVER // Disable Webserver //#endif @@ -111,30 +115,24 @@ void KNX_CB_Action(message_t const &msg, void *arg); #ifdef USE_SUNRISE #undef USE_SUNRISE // Disable support for Sunrise and sunset tools #endif -#ifdef USE_KNX -#undef USE_KNX // Disable KNX IP Protocol Support +#ifdef USE_RULES +#undef USE_RULES // Disable support for rules #endif -#ifdef USE_PZEM004T -#undef USE_PZEM004T // Disable PZEM004T energy sensor +#ifdef USE_DHT +#undef USE_DHT // Disable internal DHT sensor #endif #ifdef USE_DS18x20 #undef USE_DS18x20 // Disable DS18x20 sensor #endif +#ifdef USE_DS18B20 +#undef USE_DS18B20 // Disable internal DS18B20 sensor +#endif #ifdef USE_I2C #undef USE_I2C // Disable all I2C sensors and devices #endif #ifdef USE_SPI #undef USE_SPI // Disable all SPI devices #endif -#ifdef USE_WS2812 -#undef USE_WS2812 // Disable WS2812 Led string -#endif -#ifdef USE_DS18B20 -#undef USE_DS18B20 // Disable internal DS18B20 sensor -#endif -#ifdef USE_DHT -#undef USE_DHT // Disable internal DHT sensor -#endif #ifdef USE_DISPLAY #undef USE_DISPLAY // Disable Display support #endif @@ -144,12 +142,30 @@ void KNX_CB_Action(message_t const &msg, void *arg); #ifdef USE_SENSEAIR #undef USE_SENSEAIR // Disable support for SenseAir K30, K70 and S8 CO2 sensor #endif +#ifdef USE_PMS5003 +#undef USE_PMS5003 // Disable support for PMS5003 and PMS7003 particle concentration sensor +#endif +#ifdef USE_NOVA_SDS +#undef USE_NOVA_SDS // Disable support for SDS011 and SDS021 particle concentration sensor +#endif +#ifdef USE_PZEM004T +#undef USE_PZEM004T // Disable PZEM004T energy sensor +#endif +#ifdef USE_SERIAL_BRIDGE +#undef USE_SERIAL_BRIDGE // Disable support for software Serial Bridge +#endif #ifdef USE_IR_REMOTE #undef USE_IR_REMOTE // Disable IR driver #endif +#ifdef USE_WS2812 +#undef USE_WS2812 // Disable WS2812 Led string +#endif #ifdef USE_ARILUX_RF #undef USE_ARILUX_RF // Disable support for Arilux RF remote controller #endif +#ifdef USE_SR04 +#undef USE_SR04 // Disable support for for HC-SR04 ultrasonic devices +#endif #ifdef DEBUG_THEO #undef DEBUG_THEO // Disable debug code #endif diff --git a/sonoff/support.ino b/sonoff/support.ino index 34d271644..8bc76d6a8 100644 --- a/sonoff/support.ino +++ b/sonoff/support.ino @@ -740,7 +740,7 @@ void WifiCheck(uint8_t param) strlcpy(Settings.sta_pwd[0], WiFi.psk().c_str(), sizeof(Settings.sta_pwd[0])); } Settings.sta_active = 0; - snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_WIFI D_WCFG_1_SMARTCONFIG D_CMND_SSID "1 %s, " D_CMND_PASSWORD "1 %s"), Settings.sta_ssid[0], Settings.sta_pwd[0]); + snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_WIFI D_WCFG_1_SMARTCONFIG D_CMND_SSID "1 %s"), Settings.sta_ssid[0]); AddLog(LOG_LEVEL_INFO); } } diff --git a/sonoff/webserver.ino b/sonoff/webserver.ino index 1dc3eda52..c6dcab568 100644 --- a/sonoff/webserver.ino +++ b/sonoff/webserver.ino @@ -227,9 +227,9 @@ const char HTTP_FORM_WIFI[] PROGMEM = "
 " D_WIFI_PARAMETERS " 
" "" "
" D_AP1_SSID " (" STA_SSID1 ")

" - "
" D_AP1_PASSWORD "

" + "
" D_AP1_PASSWORD "

" "
" D_AP2_SSID " (" STA_SSID2 ")

" - "
" D_AP2_PASSWORD "

" + "
" D_AP2_PASSWORD "

" "
" D_HOSTNAME " (" WIFI_HOSTNAME ")

"; const char HTTP_FORM_MQTT[] PROGMEM = "
 " D_MQTT_PARAMETERS " " @@ -259,7 +259,7 @@ const char HTTP_FORM_LOG3[] PROGMEM = const char HTTP_FORM_OTHER[] PROGMEM = "
 " D_OTHER_PARAMETERS " " "" - "
" D_WEB_ADMIN_PASSWORD "

" + "
" D_WEB_ADMIN_PASSWORD "

" "
" D_MQTT_ENABLE "
"; const char HTTP_FORM_OTHER2[] PROGMEM = "
" D_FRIENDLY_NAME " {1 ({2)

"; @@ -1011,8 +1011,8 @@ void HandleSaveSettings() strlcpy(Settings.sta_pwd[0], (!strlen(tmp)) ? "" : (strchr(tmp,'*')) ? Settings.sta_pwd[0] : tmp, sizeof(Settings.sta_pwd[0])); WebGetArg("p2", tmp, sizeof(tmp)); strlcpy(Settings.sta_pwd[1], (!strlen(tmp)) ? "" : (strchr(tmp,'*')) ? Settings.sta_pwd[1] : tmp, sizeof(Settings.sta_pwd[1])); - snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_WIFI D_CMND_HOSTNAME " %s, " D_CMND_SSID "1 %s, " D_CMND_PASSWORD "1 %s, " D_CMND_SSID "2 %s, " D_CMND_PASSWORD "2 %s"), - Settings.hostname, Settings.sta_ssid[0], Settings.sta_pwd[0], Settings.sta_ssid[1], Settings.sta_pwd[1]); + snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_WIFI D_CMND_HOSTNAME " %s, " D_CMND_SSID "1 %s, " D_CMND_SSID "2 %s"), + Settings.hostname, Settings.sta_ssid[0], Settings.sta_ssid[1]); AddLog(LOG_LEVEL_INFO); result += F("
" D_TRYING_TO_CONNECT "
"); break; diff --git a/sonoff/xdrv_00_mqtt.ino b/sonoff/xdrv_00_mqtt.ino index fa478b7a7..68b3c6a70 100644 --- a/sonoff/xdrv_00_mqtt.ino +++ b/sonoff/xdrv_00_mqtt.ino @@ -594,9 +594,11 @@ bool MqttCommand() else if (CMND_MQTTPASSWORD == command_code) { if ((data_len > 0) && (data_len < sizeof(Settings.mqtt_pwd))) { strlcpy(Settings.mqtt_pwd, (!strcmp(dataBuf,"0")) ? "" : (1 == payload) ? MQTT_PASS : dataBuf, sizeof(Settings.mqtt_pwd)); + snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, Settings.mqtt_pwd); restart_flag = 2; + } else { + snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_ASTERIX, command); } - snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, Settings.mqtt_pwd); } else if (CMND_FULLTOPIC == command_code) { if ((data_len > 0) && (data_len < sizeof(Settings.mqtt_fulltopic))) { From 2daba99e33a1647f1f9c01829ad6e8083526b8b2 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Sun, 22 Apr 2018 14:01:32 +0200 Subject: [PATCH 04/14] Minor fixes --- README.md | 2 +- sonoff/language/cs-CZ.h | 4 ++-- sonoff/xsns_22_sr04.ino | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f7c00a1dd..16b220ff7 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ The following devices are supported: You can contribute to Sonoff-Tasmota by - providing Pull Requests (Features, Proof of Concepts, Language files or Fixes) - testing new released features and report issues -- donating to acquire hardware for testing and implementating or out of gratitude +- donating to acquire hardware for testing and implementing or out of gratitude [![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://paypal.me/tasmota) diff --git a/sonoff/language/cs-CZ.h b/sonoff/language/cs-CZ.h index fa641216d..51296a577 100644 --- a/sonoff/language/cs-CZ.h +++ b/sonoff/language/cs-CZ.h @@ -1,7 +1,7 @@ /* cs-CZ.h - localization for Czech with diacritics - Czech for Sonoff-Tasmota - Copyright (C) 2018 Vladimír Synekl + Copyright (C) 2018 Vladimír Synek This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -368,7 +368,7 @@ // xdrv_09_timers.ino #define D_CONFIGURE_TIMER "Nastavení Časovače" #define D_TIMER_PARAMETERS "Časovač" -#define D_TIMER_ARM "Zajistit" +#define D_TIMER_ARM "Aktivní" #define D_TIMER_TIME "Čas" #define D_TIMER_DAYS "Dny" #define D_TIMER_REPEAT "Opakovat" diff --git a/sonoff/xsns_22_sr04.ino b/sonoff/xsns_22_sr04.ino index 5a3a7dc87..59781cb0e 100644 --- a/sonoff/xsns_22_sr04.ino +++ b/sonoff/xsns_22_sr04.ino @@ -26,6 +26,7 @@ * - https://www.dfrobot.com/wiki/index.php/Weather-proof_Ultrasonic_Sensor_SKU_:_SEN0207 \*********************************************************************************************/ #define max(a,b) ((a)>(b)?(a):(b)) +#define min(a,b) ((a)<(b)?(a):(b)) uint8_t sr04_echo_pin = 0; uint8_t sr04_trig_pin = 0; @@ -71,7 +72,7 @@ boolean Sr04Read(uint16_t *distance) uint16_t Sr04Ping(uint16_t max_cm_distance) { uint16_t duration = 0; - uint16_t maxEchoTime, maxTime; + uint16_t maxEchoTime; maxEchoTime = min(max_cm_distance + 1, (uint16_t) MAX_SENSOR_DISTANCE + 1) * US_ROUNDTRIP_CM; @@ -89,7 +90,8 @@ uint16_t Sr04Ping(uint16_t max_cm_distance) return (duration > maxEchoTime) ? 0 : duration; } -uint16_t Sr04GetSamples(uint8_t it, uint16_t max_cm_distance) { +uint16_t Sr04GetSamples(uint8_t it, uint16_t max_cm_distance) +{ uint16_t uS[it]; uint16_t last; uint8_t j; From e6dbde4e43d687de77527310a11e37e336ee7bff Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Sun, 22 Apr 2018 14:04:58 +0200 Subject: [PATCH 05/14] Only compile one environment to ease Travis --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index c3d38b9a2..1d6d4cc94 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,7 +11,7 @@ src_dir = sonoff ; *** Uncomment one of the lines below to build/upload only one environment -;env_default = sonoff +env_default = sonoff ;env_default = sonoff-minimal ;env_default = sonoff-xxl ;env_default = sonoff-BG From d42ecbcb8fde730f3fde320338c04b72d133ad76 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Sun, 22 Apr 2018 14:47:03 +0200 Subject: [PATCH 06/14] Compile all of them. --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 1d6d4cc94..c3d38b9a2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,7 +11,7 @@ src_dir = sonoff ; *** Uncomment one of the lines below to build/upload only one environment -env_default = sonoff +;env_default = sonoff ;env_default = sonoff-minimal ;env_default = sonoff-xxl ;env_default = sonoff-BG From 1669e6263982b5a8a2d46cd524a02fd4cbec0f55 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Sun, 22 Apr 2018 16:56:51 +0200 Subject: [PATCH 07/14] update picture --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 16b220ff7..f7b285e56 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ The following devices are supported: - [iTead Sonoff Dual (R2)](https://www.itead.cc/smart-home/sonoff-dual.html) - [iTead Sonoff Pow with Energy Monitoring](https://www.itead.cc/smart-home/sonoff-pow.html) - [iTead Sonoff Pow R2 with Energy Monitoring](https://www.itead.cc/sonoff-pow-r2.html) -- [iTead Sonoff 4CH](https://www.itead.cc/smart-home/sonoff-4ch.html) -- [iTead Sonoff 4CH Pro](https://www.itead.cc/smart-home/sonoff-4ch-pro.html) +- [iTead Sonoff 4CH (R2)](https://www.itead.cc/smart-home/sonoff-4ch.html) +- [iTead Sonoff 4CH Pro (R2)](https://www.itead.cc/smart-home/sonoff-4ch-pro.html) - [iTead S20 Smart Socket](https://www.itead.cc/smart-socket.html) - [Sonoff S22 Smart Socket](https://github.com/arendst/Sonoff-Tasmota/issues/627) - [iTead Sonoff S31 Smart Socket with Energy Monitoring](https://www.itead.cc/sonoff-s31.html) @@ -55,7 +55,7 @@ The following devices are supported: - [iTead Sonoff Touch](https://www.itead.cc/sonoff-touch.html) - [iTead Sonoff T1](https://www.itead.cc/sonoff-t1.html) - [iTead Sonoff SC](https://www.itead.cc/sonoff-sc.html) -- [iTead Sonoff Led](https://www.itead.cc/sonoff-led.html) +- [iTead Sonoff Led](https://www.itead.cc/sonoff-led.html) - [iTead Sonoff BN-SZ01 Ceiling Led](https://www.itead.cc/bn-sz01.html) - [iTead Sonoff B1](https://www.itead.cc/sonoff-b1.html) - [iTead Sonoff RF Bridge 433](https://www.itead.cc/sonoff-rf-bridge-433.html) From 8fea3e49a8611da9af39b693d6f9a16d15c37492 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Mon, 23 Apr 2018 11:37:46 +0200 Subject: [PATCH 08/14] 5.12.0m - Changes and Fixes 5.12.0m * Remove sonoff-xxl * Add sonoff-classic, sonoff-allsensors and sonoff-knx * Add some coloring to important web buttons * Add user selectable defines for Sunrise/set Dawn option (#2378) * Add GPIO_User to GPIO02 for all Sonoff T1 (#2524) --- platformio.ini | 92 ++++++++++++++++++++++++++------------- sonoff/_releasenotes.ino | 7 ++- sonoff/sonoff.h | 6 +++ sonoff/sonoff_post.h | 86 ++++++++++++++++++++++++++++++++++-- sonoff/sonoff_template.h | 6 +-- sonoff/user_config.h | 15 ++++++- sonoff/webserver.ino | 12 +++-- sonoff/xdrv_09_timers.ino | 3 +- sonoff/xdrv_11_knx.ino | 6 ++- 9 files changed, 186 insertions(+), 47 deletions(-) diff --git a/platformio.ini b/platformio.ini index c3d38b9a2..c74fe3c8d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,8 +13,11 @@ src_dir = sonoff ; *** Uncomment one of the lines below to build/upload only one environment ;env_default = sonoff ;env_default = sonoff-minimal -;env_default = sonoff-xxl +;env_default = sonoff-classic +;env_default = sonoff-knx +;env_default = sonoff-allsensors ;env_default = sonoff-BG +;env_default = sonoff-CN ;env_default = sonoff-CZ ;env_default = sonoff-DE ;env_default = sonoff-ES @@ -26,7 +29,6 @@ src_dir = sonoff ;env_default = sonoff-PL ;env_default = sonoff-PT ;env_default = sonoff-RU -;env_default = sonoff-CN ;env_default = sonoff-TW [env:sonoff] @@ -71,7 +73,35 @@ extra_scripts = pio/strip-floats.py ; Serial Monitor options monitor_baud = 115200 -[env:sonoff-xxl] +[env:sonoff-classic] +;platform = espressif8266@1.5.0 ; v2.3.0 +;platform = espressif8266@1.6.0 ; v2.4.0 +platform = espressif8266 +framework = arduino +board = esp01_1m +board_flash_mode = dout +build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_CLASSIC +;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_CLASSIC -DUSE_CONFIG_OVERRIDE +extra_scripts = pio/strip-floats.py + +; Serial Monitor options +monitor_baud = 115200 + +[env:sonoff-knx] +;platform = espressif8266@1.5.0 ; v2.3.0 +;platform = espressif8266@1.6.0 ; v2.4.0 +platform = espressif8266 +framework = arduino +board = esp01_1m +board_flash_mode = dout +build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_KNX_NO_EMULATION +;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_KNX_NO_EMULATION -DUSE_CONFIG_OVERRIDE +extra_scripts = pio/strip-floats.py + +; Serial Monitor options +monitor_baud = 115200 + +[env:sonoff-allsensors] ;platform = espressif8266@1.5.0 ; v2.3.0 ;platform = espressif8266@1.6.0 ; v2.4.0 platform = espressif8266 @@ -85,20 +115,6 @@ extra_scripts = pio/strip-floats.py ; Serial Monitor options monitor_baud = 115200 -[env:sonoff-CZ] -;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=cs-CZ -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=cs-CZ -DUSE_CONFIG_OVERRIDE -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 - [env:sonoff-BG] ;platform = espressif8266@1.5.0 ; v2.3.0 ;platform = espressif8266@1.6.0 ; v2.4.0 @@ -113,6 +129,34 @@ extra_scripts = pio/strip-floats.py ; *** Serial Monitor options monitor_baud = 115200 +[env:sonoff-CN] +;platform = espressif8266@1.5.0 ; v2.3.0 +;platform = espressif8266@1.6.0 ; v2.4.0 +platform = espressif8266 +framework = arduino +board = esp01_1m +board_flash_mode = dout +build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN +;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN -DUSE_CONFIG_OVERRIDE +extra_scripts = pio/strip-floats.py + +; *** Serial Monitor options +monitor_baud = 115200 + +[env:sonoff-CZ] +;platform = espressif8266@1.5.0 ; v2.3.0 +;platform = espressif8266@1.6.0 ; v2.4.0 +platform = espressif8266 +framework = arduino +board = esp01_1m +board_flash_mode = dout +build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=cs-CZ +;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=cs-CZ -DUSE_CONFIG_OVERRIDE +extra_scripts = pio/strip-floats.py + +; *** Serial Monitor options +monitor_baud = 115200 + [env:sonoff-DE] ;platform = espressif8266@1.5.0 ; v2.3.0 ;platform = espressif8266@1.6.0 ; v2.4.0 @@ -253,20 +297,6 @@ extra_scripts = pio/strip-floats.py ; *** Serial Monitor options monitor_baud = 115200 -[env:sonoff-CN] -;platform = espressif8266@1.5.0 ; v2.3.0 -;platform = espressif8266@1.6.0 ; v2.4.0 -platform = espressif8266 -framework = arduino -board = esp01_1m -board_flash_mode = dout -build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN -;build_flags = -Wl,-Tesp8266.flash.1m0.ld -DMY_LANGUAGE=zh-CN -DUSE_CONFIG_OVERRIDE -extra_scripts = pio/strip-floats.py - -; *** Serial Monitor options -monitor_baud = 115200 - [env:sonoff-TW] ;platform = espressif8266@1.5.0 ; v2.3.0 ;platform = espressif8266@1.6.0 ; v2.4.0 diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 1c2269538..454f24137 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,11 +1,16 @@ /* 5.12.0m * Reinit timers to accomodate random window (#2447) + * Remove sonoff-xxl + * Add sonoff-classic, sonoff-allsensors and sonoff-knx + * Add some coloring to important web buttons + * Add user selectable defines for Sunrise/set Dawn option (#2378) * Add random window to timers (#2447) * Add optional KNX IP Protocol Support (#2402) * Add Greek language file (#2491) * Add Bulgarian language file * Add support for sensor HC-SR04 ultrasonic (#113, #1964, #2444) * Add support for Sonoff Pow R2 (#2340) + * Add GPIO_User to GPIO02 for all Sonoff T1 (#2524) * Fix compile error when using ESP/Arduino library v2.3.0 by reverting KNX async UDP library to default UDP library (#2488, #2492, #2493) * Fix configuration filename truncation when it contains spaces (#2484, #2490) * @@ -111,7 +116,7 @@ * Add support for sensor SHTC3 (#1967) * * 5.12.0a - * Change platformio option sonoff-ds18x20 to sonoff-xxl enabling ds18x20 and all other sensors in one image + * Change platformio option sonoff-ds18x20 to sonoff-allsensors enabling ds18x20 and all other sensors in one image * Fix providing web page configuratin option for Friendly Name when no device (relay or light) is configured (#1850) * Change default parameters in user_config.h to undefined for easy installation (#1851) * Change max user configurable hold time from 10 to 25 seconds (#1851) diff --git a/sonoff/sonoff.h b/sonoff/sonoff.h index 2a2bb58ce..296046c85 100644 --- a/sonoff/sonoff.h +++ b/sonoff/sonoff.h @@ -127,6 +127,12 @@ typedef unsigned long power_t; // Power (Relay) type #define MQTT_TASMOTAMQTT 2 // Mqtt TasmotaMqtt library based on esp-mqtt-arduino #define MQTT_ESPMQTTARDUINO 3 // Mqtt esp-mqtt-arduino library by Ingo Randolf +// Sunrise and Sunset DawnType +#define DAWN_NORMAL -0.8333 +#define DAWN_CIVIL -6.0 +#define DAWN_NAUTIC -12.0 +#define DAWN_ASTRONOMIC -18.0 + /*********************************************************************************************\ * Enumeration \*********************************************************************************************/ diff --git a/sonoff/sonoff_post.h b/sonoff/sonoff_post.h index 09d68f89a..1d6ba7878 100644 --- a/sonoff/sonoff_post.h +++ b/sonoff/sonoff_post.h @@ -20,6 +20,10 @@ #ifndef _SONOFF_POST_H_ #define _SONOFF_POST_H_ +/*********************************************************************************************\ + * Function declarations +\*********************************************************************************************/ + #ifdef __cplusplus extern "C" { #endif @@ -38,9 +42,18 @@ void WifiWpsStatusCallback(wps_cb_status status); void KNX_CB_Action(message_t const &msg, void *arg); //#endif // USE_KNX +/*********************************************************************************************\ + * Default global defines +\*********************************************************************************************/ + #define USE_DHT // Default DHT11 sensor needs no external library -#ifdef USE_ALL_SENSORS // ===================== Configure sonoff-xxl.bin ========================= +/*********************************************************************************************\ + * [sonoff-allsensors.bin] + * Provide an image with all supported sensors enabled +\*********************************************************************************************/ + +#ifdef USE_ALL_SENSORS #define USE_ADC_VCC // Display Vcc in Power status. Disable for use as Analog input on selected devices #define USE_DS18x20 // For more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code) //#define USE_DS18x20_LEGACY // For more than one DS18x20 sensors with dynamic scan using library OneWire (+1k5 code) @@ -80,14 +93,75 @@ void KNX_CB_Action(message_t const &msg, void *arg); // #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow #define USE_ARILUX_RF // Add support for Arilux RF remote controller (+0k8 code, 252 iram (non 2.3.0)) #define USE_SR04 // Add support for HC-SR04 ultrasonic devices (+1k code) -#endif // USE_ALL_SENSORS ===================== +#endif // USE_ALL_SENSORS + +/*********************************************************************************************\ + * [sonoff-classic.bin] + * Provide an image close to version 5.12.0 but still within 499k program space to allow one time OTA +\*********************************************************************************************/ + +#ifdef USE_CLASSIC +#ifdef USE_KNX +#undef USE_KNX +#endif +#ifdef USE_TIMERS +#undef USE_TIMERS +#endif +#ifdef USE_TIMERS_WEB +#undef USE_TIMERS_WEB +#endif +#ifdef USE_SUNRISE +#undef USE_SUNRISE +#endif +#ifdef USE_RULES +#undef USE_RULES +#endif +#ifdef USE_SGP30 +#undef USE_SGP30 +#endif +#ifdef USE_NOVA_SDS +#undef USE_NOVA_SDS +#endif +#ifdef USE_IR_RECEIVE +#undef USE_IR_RECEIVE +#endif +#ifdef USE_SERIAL_BRIDGE +#undef USE_SERIAL_BRIDGE +#endif +#ifdef USE_SR04 +#undef USE_SR04 +#endif +#endif // USE_CLASSIC + +/*********************************************************************************************\ + * [sonoff-knx.bin] + * Provide a dedicated KNX image allowing enough code and memory space +\*********************************************************************************************/ + +#ifdef USE_KNX_NO_EMULATION +#ifndef USE_KNX +#define USE_KNX // Enable KNX IP Protocol Support (+23k code, +3k3 mem) +#endif +#ifdef USE_EMULATION +#undef USE_EMULATION // Disable Belkin WeMo and Hue Bridge emulation for Alexa (-16k code, -2k mem) +#endif +#endif // USE_KNX_NO_EMULATION + +/*********************************************************************************************\ + * Mandatory define for DS18x20 if changed by above image selections +\*********************************************************************************************/ #if defined(USE_DS18x20) || defined(USE_DS18x20_LEGACY) #else #define USE_DS18B20 // Default DS18B20 sensor needs no external library #endif -#ifdef BE_MINIMAL // ========================== Configure sonoff-minimal.bin ===================== +/*********************************************************************************************\ + * [sonoff-minimal.bin] + * Provide the smallest image possible while still enabling a webserver for intermediate image load +\*********************************************************************************************/ + +#ifdef BE_MINIMAL #ifdef USE_MQTT_TLS #undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set #endif @@ -169,7 +243,11 @@ void KNX_CB_Action(message_t const &msg, void *arg); #ifdef DEBUG_THEO #undef DEBUG_THEO // Disable debug code #endif -#endif // BE_MINIMAL ========================== +#endif // BE_MINIMAL + +/*********************************************************************************************\ + * Mandatory defines satisfying possible disabled defines +\*********************************************************************************************/ #ifndef SWITCH_MODE #define SWITCH_MODE TOGGLE // TOGGLE, FOLLOW or FOLLOW_INV (the wall switch state) diff --git a/sonoff/sonoff_template.h b/sonoff/sonoff_template.h index b3f95152f..dc0746ec7 100644 --- a/sonoff/sonoff_template.h +++ b/sonoff/sonoff_template.h @@ -608,7 +608,7 @@ const mytmplt kModules[MAXMODULE] PROGMEM = { { "Sonoff T1 1CH", // Sonoff T1 1CH (ESP8285) GPIO_KEY1, // GPIO00 Button 1 GPIO_USER, // GPIO01 Serial RXD and Optional sensor - 0, + GPIO_USER, // GPIO02 Optional Sensor (J3 Pin 5) GPIO_USER, // GPIO03 Serial TXD and Optional sensor 0, 0, 0, 0, 0, // Flash connection @@ -621,7 +621,7 @@ const mytmplt kModules[MAXMODULE] PROGMEM = { { "Sonoff T1 2CH", // Sonoff T1 2CH (ESP8285) GPIO_KEY1, // GPIO00 Button 1 GPIO_USER, // GPIO01 Serial RXD and Optional sensor - 0, + GPIO_USER, // GPIO02 Optional Sensor (J3 Pin 5) GPIO_USER, // GPIO03 Serial TXD and Optional sensor 0, GPIO_REL2, // GPIO05 Blue Led and Relay 2 (0 = Off, 1 = On) @@ -636,7 +636,7 @@ const mytmplt kModules[MAXMODULE] PROGMEM = { { "Sonoff T1 3CH", // Sonoff T1 3CH (ESP8285) GPIO_KEY1, // GPIO00 Button 1 GPIO_USER, // GPIO01 Serial RXD and Optional sensor - 0, + GPIO_USER, // GPIO02 Optional Sensor (J3 Pin 5) GPIO_USER, // GPIO03 Serial TXD and Optional sensor GPIO_REL3, // GPIO04 Blue Led and Relay 3 (0 = Off, 1 = On) GPIO_REL2, // GPIO05 Blue Led and Relay 2 (0 = Off, 1 = On) diff --git a/sonoff/user_config.h b/sonoff/user_config.h index 05950abd0..92dd23dda 100644 --- a/sonoff/user_config.h +++ b/sonoff/user_config.h @@ -228,6 +228,7 @@ #define USE_TIMERS // Add support for up to 16 timers (+2k2 code) #define USE_TIMERS_WEB // Add timer webpage support (+4k5 code) #define USE_SUNRISE // Add support for Sunrise and sunset tools (+16k) + #define SUNRISE_DAWN_ANGLE DAWN_NORMAL // Select desired Dawn Angle from (DAWN_NORMAL, DAWN_CIVIL, DAWN_NAUTIC, DAWN_ASTRONOMIC) // -- Rules --------------------------------------- #define USE_RULES // Add support for rules (+4k4 code) @@ -288,11 +289,23 @@ #define USE_SR04 // Add support for HC-SR04 ultrasonic devices (+1k code) +/*********************************************************************************************\ + * Select features and sensors enabled in previous version saving space +\*********************************************************************************************/ + +//#define USE_CLASSIC // Create sonoff-classic (See sonoff_post.h for selected features) + /*********************************************************************************************\ * Select all sensors - overrides above undefines!! \*********************************************************************************************/ -//#define USE_ALL_SENSORS // Create sonoff-xxl with all sensors enabled (See sonoff_post.h for selected sensors) +//#define USE_ALL_SENSORS // Create sonoff-allsensors with all sensors enabled (See sonoff_post.h for selected sensors) + +/*********************************************************************************************\ + * Select KNX without Emulation to save space +\*********************************************************************************************/ + +//#define USE_KNX_NO_EMULATION // Create sonoff-knx with KNX but without Emulation (See sonoff_post.h) /*********************************************************************************************\ * Compile a minimal version if upgrade memory gets tight ONLY TO BE USED FOR UPGRADE STEP 1! diff --git a/sonoff/webserver.ino b/sonoff/webserver.ino index c6dcab568..e7d9262be 100644 --- a/sonoff/webserver.ino +++ b/sonoff/webserver.ino @@ -89,7 +89,11 @@ const char HTTP_HEAD_STYLE[] PROGMEM = "body{text-align:center;font-family:verdana;}" "td{padding:0px;}" "button{border:0;border-radius:0.3rem;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%;-webkit-transition-duration:0.4s;transition-duration:0.4s;cursor:pointer;}" - "button:hover{background-color:#006cba;}" + "button:hover{background-color:#0e70a4;}" + ".bred{background-color:#d43535;}" + ".bred:hover{background-color:#931f1f;}" + ".bgrn{background-color:#47c266;}" + ".bgrn:hover{background-color:#5aaf6f;}" "a{text-decoration:none;}" ".p{float:left;text-align:left;}" ".q{float:right;text-align:right;}" @@ -180,7 +184,7 @@ const char HTTP_BTN_MENU1[] PROGMEM = "
" "
"; const char HTTP_BTN_RSTRT[] PROGMEM = - "
"; + "
"; const char HTTP_BTN_MENU_MODULE[] PROGMEM = "
"; #if defined(USE_TIMERS) && defined(USE_TIMERS_WEB) @@ -202,7 +206,7 @@ const char HTTP_BTN_MENU4[] PROGMEM = "
" "
" "
" - "
" + "
" "
" "
"; const char HTTP_BTN_MAIN[] PROGMEM = @@ -270,7 +274,7 @@ const char HTTP_FORM_OTHER3b[] PROGMEM = "
{3{4"; // Different id only used for labels #endif // USE_EMULATION const char HTTP_FORM_END[] PROGMEM = - "
"; + "
"; const char HTTP_FORM_RST[] PROGMEM = "
" "
 " D_RESTORE_CONFIGURATION " "; diff --git a/sonoff/xdrv_09_timers.ino b/sonoff/xdrv_09_timers.ino index 0ffe94f55..26b23b258 100644 --- a/sonoff/xdrv_09_timers.ino +++ b/sonoff/xdrv_09_timers.ino @@ -124,7 +124,8 @@ void DuskTillDawn(uint8_t *hour_up,uint8_t *minute_up, uint8_t *hour_down, uint8 h (D) = -12.0 nautische Dämmerung h (D) = -18.0 astronomische Dämmerung */ - double h = -50/60.0*RAD; +// double h = -50/60.0*RAD; + double h = SUNRISE_DAWN_ANGLE *RAD; double B = (((double)Settings.latitude)/1000000) * RAD; // geographische Breite double GeographischeLaenge = ((double)Settings.longitude)/1000000; // double Zeitzone = 0; //Weltzeit diff --git a/sonoff/xdrv_11_knx.ino b/sonoff/xdrv_11_knx.ino index 76fc1cf0c..7084973b9 100644 --- a/sonoff/xdrv_11_knx.ino +++ b/sonoff/xdrv_11_knx.ino @@ -596,7 +596,8 @@ const char HTTP_FORM_KNX_ADD_BTN[] PROGMEM = const char HTTP_FORM_KNX_ADD_TABLE_ROW[] PROGMEM = "{optex} -> GAfnum / GAarea / GAfdef " - ""; +// ""; + ""; const char HTTP_FORM_KNX3[] PROGMEM = "

" @@ -608,7 +609,8 @@ const char HTTP_FORM_KNX4[] PROGMEM = const char HTTP_FORM_KNX_ADD_TABLE_ROW2[] PROGMEM = "GAfnum / GAarea / GAfdef -> {optex}" - ""; +// ""; + ""; void HandleKNXConfiguration() From c3c4e48b74f38e1a07379809a47e0dc64bf971eb Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Mon, 23 Apr 2018 12:38:15 +0200 Subject: [PATCH 09/14] Add stale and see what happens... --- .github/stale.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 000000000..43d5e77f3 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,40 @@ +# Number of days of inactivity before an Issue or Pull Request becomes stale +daysUntilStale: 120 + +# Number of days of inactivity before a stale Issue or Pull Request is closed. +# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. +daysUntilClose: 14 + +# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable +exemptLabels: + - pinned + - security + - enhancement + - bug + +# Set to true to ignore issues in a project (defaults to false) +exemptProjects: false + +# Set to true to ignore issues in a milestone (defaults to false) +exemptMilestones: false + +# Label to use when marking as stale +staleLabel: stale + +# Comment to post when marking as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when removing the stale label. +# unmarkComment: > +# Your comment here. + +# Comment to post when closing a stale Issue or Pull Request. +closeComment: > + This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem. +# Limit the number of actions per hour, from 1-30. Default is 30 +limitPerRun: 30 + +# Limit to only `issues` or `pulls` +only: issues From 883fb041d7a83cee39357b437d5d1d8c26b6baba Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Mon, 23 Apr 2018 16:59:04 +0200 Subject: [PATCH 10/14] Add firmware info and Credits --- README.md | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 105 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f7b285e56..b5e83f708 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,9 @@ If you like **Sonoff-Tasmota**, give it a star, or fork it and contribute! Current version is **5.12.0m** - 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. ### Important User Compilation Information - If you want to compile Sonoff-Tasmota yourself keep in mind the following: - Only Flash Mode **DOUT** is supported. Do not use Flash Mode DIO / QIO / QOUT as it might seem to brick your device. See [Wiki](https://github.com/arendst/Sonoff-Tasmota/wiki/Theo's-Tasmota-Tips) for background information. @@ -28,7 +26,6 @@ If you want to compile Sonoff-Tasmota yourself keep in mind the following: - To make compile time changes to Sonoff-Tasmota it can use the ``user_config_override.h`` file. It assures keeping your settings when you download and compile a new version. To use ``user_config.override.h`` you will have to make a copy of the provided ``user_config.override_sample.h`` file and add your setting overrides. To enable the override file you will need to use a compile define as documented in the ``user_config_override_sample.h`` file. ### Version Information - - Sonoff-Tasmota provides all (Sonoff) modules in one file and starts with module Sonoff Basic. - Once uploaded select module using the configuration webpage or the commands ```Modules``` and ```Module```. - After reboot select config menu again or use commands ```GPIOs``` and ```GPIO``` to change GPIO with desired sensor. @@ -71,8 +68,72 @@ The following devices are supported: - [Luani HVIO board](https://luani.de/projekte/esp8266-hvio/) - Wemos D1 mini, NodeMcu and Ledunia -### Contribute +### Firmware release information +Different firmware images are released based on Features and Sensors selection guided by code and memory usage. +- The Minimal version allows intermediate OTA uploads to support larger versions and does NOT change any persistent parameter. +- The Classic version allows single OTA uploads as did the previous Sonoff-Tasmota versions. + +| Typical file size | sonoff | classic | minimal | knx | allsensors | +|--------------------------------|--------|---------|---------|------|------------| +| ESP/Arduino lib v2.3.0 | 526k | 488k | 427k | 535k | 549k | +| ESP/Arduino lib v2.4.0 | 531k | 496k | 435k | 540k | 552k | +| ESP/Arduino lib v2.4.1 | 533k | 498k | 436k | 542k | 554k | + +| Feature | sonoff | classic | minimal | knx | allsensors | +|--------------------------------|--------|---------|---------|-----|------------| +| MY_LANGUAGE en-GB | x | x | x | x | x | +| MQTT_LIBRARY_TYPE PUBSUBCLIENT | x | x | x | x | x | +| USE_DOMOTICZ | x | x | - | x | x | +| USE_HOME_ASSISTANT | x | x | - | x | x | +| USE_MQTT_TLS | - | - | - | - | - | +| USE_KNX | - | - | - | x | - | +| USE_WEBSERVER | x | x | x | x | x | +| USE_EMULATION | x | x | - | - | x | +| USE_DISCOVERY | x | x | - | x | x | +| WEBSERVER_ADVERTISE | x | x | - | x | x | +| MQTT_HOST_DISCOVERY | x | x | - | x | x | +| USE_TIMERS | x | - | - | x | x | +| USE_TIMERS_WEB | x | - | - | x | x | +| USE_SUNRISE | x | - | - | x | x | +| USE_RULES | x | - | - | x | x | + +| Sensor | sonoff | classic | minimal | knx | allsensors | +|--------------------------------|--------|---------|---------|-----|------------| +| USE_ADC_VCC | x | x | x | x | x | +| USE_DS18B20 | x | x | - | x | - | +| USE_DS18x20 | - | - | - | - | x | +| USE_DS18x20_LEGACY | - | - | - | - | - | +| USE_I2C | x | x | - | x | x | +| USE_SHT | x | x | - | x | x | +| USE_SHT3X | x | x | - | x | x | +| USE_HTU | x | x | - | x | x | +| USE_BMP | x | x | - | x | x | +| USE_BME680 | - | - | - | - | x | +| USE_SGP30 | x | - | - | x | x | +| USE_BH1750 | x | x | - | x | x | +| USE_VEML6070 | - | - | - | - | x | +| USE_TSL2561 | - | - | - | - | x | +| USE_ADS1115 | - | - | - | - | x | +| USE_ADS1115_I2CDEV | - | - | - | - | - | +| USE_INA219 | - | - | - | - | x | +| USE_MGS | - | - | - | - | x | +| USE_SPI | - | - | - | - | - | +| USE_MHZ19 | x | x | - | x | x | +| USE_SENSEAIR | x | x | - | x | x | +| USE_PMS5003 | x | x | - | x | x | +| USE_NOVA_SDS | x | - | - | x | x | +| USE_PZEM004T | x | x | - | x | x | +| USE_SERIAL_BRIDGE | x | - | - | x | x | +| USE_IR_REMOTE | x | x | - | x | x | +| USE_IR_HVAC | - | - | - | - | x | +| USE_IR_RECEIVE | x | - | - | x | x | +| USE_WS2812 | x | x | - | x | x | +| USE_WS2812_DMA | - | - | - | - | - | +| USE_ARILUX_RF | x | x | - | x | x | +| USE_SR04 | x | - | - | x | x | + +### Contribute You can contribute to Sonoff-Tasmota by - providing Pull Requests (Features, Proof of Concepts, Language files or Fixes) - testing new released features and report issues @@ -80,6 +141,46 @@ You can contribute to Sonoff-Tasmota by [![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://paypal.me/tasmota) +### Credits +Libraries used with Sonoff-Tasmota are: +- [ESP8266 core for Arduino](https://github.com/esp8266/Arduino) +- [Adafruit BME680](https://github.com/adafruit/Adafruit_BME680) +- [Adafruit Sensor](https://github.com/adafruit/Adafruit_Sensor) +- [Adafruit SGP30](https://github.com/adafruit/Adafruit_SGP30) +- [ArduinoJson](https://arduinojson.org/) +- [Esp8266MqttClient](https://github.com/tuanpmt/ESP8266MQTTClient) +- [esp-knx-ip](https://github.com/envy/esp-knx-ip) +- [esp-mqtt-arduino](https://github.com/i-n-g-o/esp-mqtt-arduino) +- [I2Cdevlib](https://github.com/jrowberg/i2cdevlib) +- [IRremoteEsp8266](https://github.com/markszabo/IRremoteESP8266) +- [JobaTsl2561](https://github.com/joba-1/Joba_Tsl2561) +- [MultiChannelGasSensor](http://wiki.seeedstudio.com/Grove-Multichannel_Gas_Sensor/) +- [NeoPixelBus](https://github.com/Makuna/NeoPixelBus) +- [OneWire](https://github.com/PaulStoffregen/OneWire) +- [PubSubClient](https://github.com/knolleary/pubsubclient) + +People helping to keep the show on the road: +- David Lang for providing initial issue resolution and code optimizations +- Heiko Krupp for his IRSend, HTU21, SI70xx and Wemo/Hue emulation drivers +- Wiktor Schmidt for Travis CI implementation +- Thom Dietrich for PlatformIO optimizations +- Marinus van den Broek for his EspEasy based inspiration +- Pete Ba for more user friendly energy monitor calibration +- Lobradov providing compile optimization tips +- Flexiti for his initial timer implementation +- reloxx13 for his [SonWeb](https://github.com/reloxx13/SonWEB) management tool +- Joachim Banzhaf for his TSL2561 library and driver +- Gijs Noorlander for his MHZ19 and SenseAir drivers +- Emontnemery for his HomeAssistant Discovery concept and many code tuning tips +- Aidan Mountford for his HSB support +- Daniel Ztolnai for his inspiring Serial Bridge implementation +- Gerhard Mutz for his SGP30 and Sunrise/Sunset driver +- Nuno Ferreira for his HC-SR04 driver +- Adrian Scillato for his (security)fixes and implementing and maintaining KNX +- Raymond Mouthaan for managing Wemos Wiki information +- Norbert Richter, Frogmore42 and Jason2866 for providing many issue answers +- Many more providing Tips, Pocs or PRs + ### License This program is licensed under GPL-3.0 From 40ea11af73990561adcfa9dc12b7be4d85ff4fb8 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Mon, 23 Apr 2018 17:08:41 +0200 Subject: [PATCH 11/14] Lay-out update --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b5e83f708..5ed1a06e1 100644 --- a/README.md +++ b/README.md @@ -74,13 +74,17 @@ Different firmware images are released based on Features and Sensors selection g - The Minimal version allows intermediate OTA uploads to support larger versions and does NOT change any persistent parameter. - The Classic version allows single OTA uploads as did the previous Sonoff-Tasmota versions. -| Typical file size | sonoff | classic | minimal | knx | allsensors | +#### Typical file size. + +| ESP/Arduino library version | sonoff | classic | minimal | knx | allsensors | |--------------------------------|--------|---------|---------|------|------------| | ESP/Arduino lib v2.3.0 | 526k | 488k | 427k | 535k | 549k | | ESP/Arduino lib v2.4.0 | 531k | 496k | 435k | 540k | 552k | | ESP/Arduino lib v2.4.1 | 533k | 498k | 436k | 542k | 554k | -| Feature | sonoff | classic | minimal | knx | allsensors | +#### Available Features and Sensors. + +| Feature or Sensor | sonoff | classic | minimal | knx | allsensors | |--------------------------------|--------|---------|---------|-----|------------| | MY_LANGUAGE en-GB | x | x | x | x | x | | MQTT_LIBRARY_TYPE PUBSUBCLIENT | x | x | x | x | x | @@ -97,9 +101,7 @@ Different firmware images are released based on Features and Sensors selection g | USE_TIMERS_WEB | x | - | - | x | x | | USE_SUNRISE | x | - | - | x | x | | USE_RULES | x | - | - | x | x | - -| Sensor | sonoff | classic | minimal | knx | allsensors | -|--------------------------------|--------|---------|---------|-----|------------| +| | | | | | | | USE_ADC_VCC | x | x | x | x | x | | USE_DS18B20 | x | x | - | x | - | | USE_DS18x20 | - | - | - | - | x | @@ -132,6 +134,7 @@ Different firmware images are released based on Features and Sensors selection g | USE_WS2812_DMA | - | - | - | - | - | | USE_ARILUX_RF | x | x | - | x | x | | USE_SR04 | x | - | - | x | x | +| | sonoff | classic | minimal | knx | allsensors | ### Contribute You can contribute to Sonoff-Tasmota by @@ -164,7 +167,7 @@ People helping to keep the show on the road: - Heiko Krupp for his IRSend, HTU21, SI70xx and Wemo/Hue emulation drivers - Wiktor Schmidt for Travis CI implementation - Thom Dietrich for PlatformIO optimizations -- Marinus van den Broek for his EspEasy based inspiration +- Marinus van den Broek for his EspEasy inspiration - Pete Ba for more user friendly energy monitor calibration - Lobradov providing compile optimization tips - Flexiti for his initial timer implementation From ee0ca1631fc4769be114abed71efe0074fec45ac Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Mon, 23 Apr 2018 17:10:50 +0200 Subject: [PATCH 12/14] Lay-out update2 --- README.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5ed1a06e1..c2d00f6a1 100644 --- a/README.md +++ b/README.md @@ -74,14 +74,6 @@ Different firmware images are released based on Features and Sensors selection g - The Minimal version allows intermediate OTA uploads to support larger versions and does NOT change any persistent parameter. - The Classic version allows single OTA uploads as did the previous Sonoff-Tasmota versions. -#### Typical file size. - -| ESP/Arduino library version | sonoff | classic | minimal | knx | allsensors | -|--------------------------------|--------|---------|---------|------|------------| -| ESP/Arduino lib v2.3.0 | 526k | 488k | 427k | 535k | 549k | -| ESP/Arduino lib v2.4.0 | 531k | 496k | 435k | 540k | 552k | -| ESP/Arduino lib v2.4.1 | 533k | 498k | 436k | 542k | 554k | - #### Available Features and Sensors. | Feature or Sensor | sonoff | classic | minimal | knx | allsensors | @@ -134,7 +126,14 @@ Different firmware images are released based on Features and Sensors selection g | USE_WS2812_DMA | - | - | - | - | - | | USE_ARILUX_RF | x | x | - | x | x | | USE_SR04 | x | - | - | x | x | -| | sonoff | classic | minimal | knx | allsensors | + +#### Typical file size. + +| ESP/Arduino library version | sonoff | classic | minimal | knx | allsensors | +|--------------------------------|--------|---------|---------|------|------------| +| ESP/Arduino lib v2.3.0 | 526k | 488k | 427k | 535k | 549k | +| ESP/Arduino lib v2.4.0 | 531k | 496k | 435k | 540k | 552k | +| ESP/Arduino lib v2.4.1 | 533k | 498k | 436k | 542k | 554k | ### Contribute You can contribute to Sonoff-Tasmota by From c432d41eb5e272292872d86cc6af6fcbe6f16698 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Mon, 23 Apr 2018 17:14:19 +0200 Subject: [PATCH 13/14] Updated lay-out --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c2d00f6a1..608843f54 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,8 @@ You can contribute to Sonoff-Tasmota by [![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://paypal.me/tasmota) ### Credits + +#### Libraries used Libraries used with Sonoff-Tasmota are: - [ESP8266 core for Arduino](https://github.com/esp8266/Arduino) - [Adafruit BME680](https://github.com/adafruit/Adafruit_BME680) @@ -161,6 +163,7 @@ Libraries used with Sonoff-Tasmota are: - [OneWire](https://github.com/PaulStoffregen/OneWire) - [PubSubClient](https://github.com/knolleary/pubsubclient) +#### People inspiring me People helping to keep the show on the road: - David Lang for providing initial issue resolution and code optimizations - Heiko Krupp for his IRSend, HTU21, SI70xx and Wemo/Hue emulation drivers From e32e9ee6c28e77b514ff06e01143fa5696d60cd9 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Mon, 23 Apr 2018 17:18:24 +0200 Subject: [PATCH 14/14] updates --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 608843f54..a15c9ab91 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Different firmware images are released based on Features and Sensors selection g - The Minimal version allows intermediate OTA uploads to support larger versions and does NOT change any persistent parameter. - The Classic version allows single OTA uploads as did the previous Sonoff-Tasmota versions. -#### Available Features and Sensors. +#### Available Features and Sensors | Feature or Sensor | sonoff | classic | minimal | knx | allsensors | |--------------------------------|--------|---------|---------|-----|------------| @@ -127,7 +127,7 @@ Different firmware images are released based on Features and Sensors selection g | USE_ARILUX_RF | x | x | - | x | x | | USE_SR04 | x | - | - | x | x | -#### Typical file size. +#### Typical file size | ESP/Arduino library version | sonoff | classic | minimal | knx | allsensors | |--------------------------------|--------|---------|---------|------|------------| @@ -165,11 +165,11 @@ Libraries used with Sonoff-Tasmota are: #### People inspiring me People helping to keep the show on the road: -- David Lang for providing initial issue resolution and code optimizations +- David Lang providing initial issue resolution and code optimizations - Heiko Krupp for his IRSend, HTU21, SI70xx and Wemo/Hue emulation drivers - Wiktor Schmidt for Travis CI implementation - Thom Dietrich for PlatformIO optimizations -- Marinus van den Broek for his EspEasy inspiration +- Marinus van den Broek for his EspEasy groundwork - Pete Ba for more user friendly energy monitor calibration - Lobradov providing compile optimization tips - Flexiti for his initial timer implementation @@ -178,7 +178,7 @@ People helping to keep the show on the road: - Gijs Noorlander for his MHZ19 and SenseAir drivers - Emontnemery for his HomeAssistant Discovery concept and many code tuning tips - Aidan Mountford for his HSB support -- Daniel Ztolnai for his inspiring Serial Bridge implementation +- Daniel Ztolnai for his Serial Bridge implementation - Gerhard Mutz for his SGP30 and Sunrise/Sunset driver - Nuno Ferreira for his HC-SR04 driver - Adrian Scillato for his (security)fixes and implementing and maintaining KNX