From 9851c26781165982d8522a520e6a8121a12ce2a5 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Thu, 15 Apr 2021 20:21:51 +0200 Subject: [PATCH 1/4] Fix for #11680 Using file from https://github.com/arendst/Tasmota/issues/11680#issuecomment-818844390 --- tasmota/xsns_53_sml.ino | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/tasmota/xsns_53_sml.ino b/tasmota/xsns_53_sml.ino index c29cd29a5..5288e2dc3 100755 --- a/tasmota/xsns_53_sml.ino +++ b/tasmota/xsns_53_sml.ino @@ -1915,14 +1915,14 @@ void SML_Immediate_MQTT(const char *mp,uint8_t index,uint8_t mindex) { // web + json interface void SML_Show(boolean json) { - int8_t count,mindex,cindex=0; + int8_t count, mindex, cindex = 0; char tpowstr[32]; char name[24]; char unit[8]; char jname[24]; int8_t index=0,mid=0; char *mp=(char*)meter_p; - char *cp,nojson=0; + char *cp, nojson = 0; //char b_mqtt_data[MESSZ]; //b_mqtt_data[0]=0; @@ -1937,9 +1937,9 @@ void SML_Show(boolean json) { if (mindex<0 || mindex>=meters_used) mindex=0; if (meter_desc_p[mindex].prefix[0]=='*' && meter_desc_p[mindex].prefix[1]==0) { - nojson=1; + nojson = 1; } else { - nojson=0; + nojson = 0; } mp+=2; if (*mp=='=' && *(mp+1)=='h') { @@ -2032,27 +2032,35 @@ void SML_Show(boolean json) { } if (json) { - if (!dvalid[index]) { - nojson = 1; + //if (dvalid[index]) { + //AddLog(LOG_LEVEL_INFO, PSTR("not yet valid line %d"), index); - } + //} // json export if (index==0) { //snprintf_P(b_mqtt_data, sizeof(b_mqtt_data), "%s,\"%s\":{\"%s\":%s", b_mqtt_data,meter_desc_p[mindex].prefix,jname,tpowstr); - if (!nojson) ResponseAppend_P(PSTR(",\"%s\":{\"%s\":%s"),meter_desc_p[mindex].prefix,jname,tpowstr); + if (!nojson) { + ResponseAppend_P(PSTR(",\"%s\":{\"%s\":%s"),meter_desc_p[mindex].prefix,jname,tpowstr); + } } else { if (lastmind!=mindex) { // meter changed, close mqtt //snprintf_P(b_mqtt_data, sizeof(b_mqtt_data), "%s}", b_mqtt_data); - if (!nojson) ResponseAppend_P(PSTR("}")); + if (!nojson) { + ResponseAppend_P(PSTR("}")); + } // and open new //snprintf_P(b_mqtt_data, sizeof(b_mqtt_data), "%s,\"%s\":{\"%s\":%s", b_mqtt_data,meter_desc_p[mindex].prefix,jname,tpowstr); - if (!nojson) ResponseAppend_P(PSTR(",\"%s\":{\"%s\":%s"),meter_desc_p[mindex].prefix,jname,tpowstr); + if (!nojson) { + ResponseAppend_P(PSTR(",\"%s\":{\"%s\":%s"),meter_desc_p[mindex].prefix,jname,tpowstr); + } lastmind=mindex; } else { //snprintf_P(b_mqtt_data, sizeof(b_mqtt_data), "%s,\"%s\":%s", b_mqtt_data,jname,tpowstr); - if (!nojson) ResponseAppend_P(PSTR(",\"%s\":%s"),jname,tpowstr); + if (!nojson) { + ResponseAppend_P(PSTR(",\"%s\":%s"),jname,tpowstr); + } } } @@ -2073,7 +2081,9 @@ void SML_Show(boolean json) { if (json) { //snprintf_P(b_mqtt_data, sizeof(b_mqtt_data), "%s}", b_mqtt_data); //ResponseAppend_P(PSTR("%s"),b_mqtt_data); - if (!nojson) ResponseAppend_P(PSTR("}")); + if (!nojson) { + ResponseAppend_P(PSTR("}")); + } } else { //WSContentSend_PD(PSTR("%s"),b_mqtt_data); } From 2ff5de0b2fba7f44a4decb20054f0e2087d61ce9 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Fri, 16 Apr 2021 11:25:49 +0200 Subject: [PATCH 2/4] Change SPIFFS partions --- esp32_partition_app1856k_spiffs320k.csv | 6 ++++++ esp32_partition_app2944k_spiffs10M.csv | 6 ++++++ platformio_tasmota32.ini | 2 +- platformio_tasmota_env32.ini | 4 ++-- .../Odroid_go_and_core2/Core2_flash_10M.bat | 1 + .../{Core2_flash.bat => Core2_flash_12M.bat} | 0 .../Odroid_go_and_core2/Odroid_flash_10M.bat | 1 + .../{Odroid_flash.bat => Odroid_flash_12M.bat} | 0 .../partitions_spiffs_10M.bin | Bin 0 -> 3072 bytes 9 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 esp32_partition_app1856k_spiffs320k.csv create mode 100644 esp32_partition_app2944k_spiffs10M.csv create mode 100644 tools/Esptool/Odroid_go_and_core2/Core2_flash_10M.bat rename tools/Esptool/Odroid_go_and_core2/{Core2_flash.bat => Core2_flash_12M.bat} (100%) create mode 100644 tools/Esptool/Odroid_go_and_core2/Odroid_flash_10M.bat rename tools/Esptool/Odroid_go_and_core2/{Odroid_flash.bat => Odroid_flash_12M.bat} (100%) create mode 100644 tools/Esptool/Odroid_go_and_core2/partitions_spiffs_10M.bin diff --git a/esp32_partition_app1856k_spiffs320k.csv b/esp32_partition_app1856k_spiffs320k.csv new file mode 100644 index 000000000..09659603f --- /dev/null +++ b/esp32_partition_app1856k_spiffs320k.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x1D0000, +app1, app, ota_1, 0x1E0000, 0x1D0000, +spiffs, data, spiffs, 0x3B0000,0x50000, diff --git a/esp32_partition_app2944k_spiffs10M.csv b/esp32_partition_app2944k_spiffs10M.csv new file mode 100644 index 000000000..f87b84a9c --- /dev/null +++ b/esp32_partition_app2944k_spiffs10M.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x2F0000, +app1, app, ota_1, 0x300000, 0x2F0000, +spiffs, data, spiffs, 0x5F0000,0xA10000, diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index abf1d0199..3a8c42192 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -10,7 +10,7 @@ board = esp32dev board_build.filesystem = ${common.board_build.filesystem} custom_unpack_dir = ${common.custom_unpack_dir} board_build.ldscript = esp32_out.ld -board_build.partitions = esp32_partition_app1984k_spiffs64k.csv +board_build.partitions = esp32_partition_app1856k_spiffs320k.csv board_build.flash_mode = ${common.board_build.flash_mode} board_build.f_flash = ${common.board_build.f_flash} board_build.f_cpu = ${common.board_build.f_cpu} diff --git a/platformio_tasmota_env32.ini b/platformio_tasmota_env32.ini index f0b85e60b..54722290c 100644 --- a/platformio_tasmota_env32.ini +++ b/platformio_tasmota_env32.ini @@ -50,7 +50,7 @@ board_build.f_cpu = 240000000L board_build.flash_mode = qio board_build.f_flash = 80000000L upload_speed = 2000000 -board_build.partitions = esp32_partition_app1984k_spiffs12M.csv +board_build.partitions = esp32_partition_app2944k_spiffs10M.csv build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -lc-psram-workaround -lm-psram-workaround -DFIRMWARE_ODROID_GO lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_i2c, lib/lib_rf, lib/lib_div, lib/lib_ssl, lib/lib_display @@ -61,7 +61,7 @@ board_build.f_cpu = 240000000L board_build.flash_mode = qio board_build.f_flash = 80000000L upload_speed = 2000000 -board_build.partitions = esp32_partition_app1984k_spiffs12M.csv +board_build.partitions = esp32_partition_app2944k_spiffs10M.csv build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -lc-psram-workaround -lm-psram-workaround -DFIRMWARE_M5STACK_CORE2 lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_i2c, lib/lib_rf, lib/lib_div, lib/lib_ssl, lib/lib_display, lib/lib_audio diff --git a/tools/Esptool/Odroid_go_and_core2/Core2_flash_10M.bat b/tools/Esptool/Odroid_go_and_core2/Core2_flash_10M.bat new file mode 100644 index 000000000..7f978acb2 --- /dev/null +++ b/tools/Esptool/Odroid_go_and_core2/Core2_flash_10M.bat @@ -0,0 +1 @@ +esptool.py --chip esp32 --baud 2000000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 bootloader_qio_80m.bin 0x8000 partitions_spiffs_10M.bin 0xe000 boot_app0.bin 0x10000 tasmota32-core2.bin diff --git a/tools/Esptool/Odroid_go_and_core2/Core2_flash.bat b/tools/Esptool/Odroid_go_and_core2/Core2_flash_12M.bat similarity index 100% rename from tools/Esptool/Odroid_go_and_core2/Core2_flash.bat rename to tools/Esptool/Odroid_go_and_core2/Core2_flash_12M.bat diff --git a/tools/Esptool/Odroid_go_and_core2/Odroid_flash_10M.bat b/tools/Esptool/Odroid_go_and_core2/Odroid_flash_10M.bat new file mode 100644 index 000000000..fde9850e0 --- /dev/null +++ b/tools/Esptool/Odroid_go_and_core2/Odroid_flash_10M.bat @@ -0,0 +1 @@ +esptool.py --chip esp32 --baud 2000000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 bootloader_qio_80m.bin 0x8000 partitions_spiffs_10M.bin 0xe000 boot_app0.bin 0x10000 tasmota32-odroid.bin diff --git a/tools/Esptool/Odroid_go_and_core2/Odroid_flash.bat b/tools/Esptool/Odroid_go_and_core2/Odroid_flash_12M.bat similarity index 100% rename from tools/Esptool/Odroid_go_and_core2/Odroid_flash.bat rename to tools/Esptool/Odroid_go_and_core2/Odroid_flash_12M.bat diff --git a/tools/Esptool/Odroid_go_and_core2/partitions_spiffs_10M.bin b/tools/Esptool/Odroid_go_and_core2/partitions_spiffs_10M.bin new file mode 100644 index 0000000000000000000000000000000000000000..08781f13a1eb77b9c5bdeea885dcbd80c2236418 GIT binary patch literal 3072 zcmZ1#z{tcffq{V`fPo>etQg2Z1*-xW85kY_#S|DA@=Fp^5=#cs$tM) zNGvEYK#>G;fbxP23?N~!ydkDMV-o{IJWzNcLvcZ7S{j-YUcdg20 Date: Fri, 16 Apr 2021 11:40:38 +0200 Subject: [PATCH 3/4] Redesigned GUI Redesigned GUI by moving non-configuration buttons from ``Configuration`` to new submenu ``Consoles`` --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + tasmota/tasmota.h | 2 +- tasmota/tasmota_configurations_ESP32.h | 1 + tasmota/xdrv_01_webserver.ino | 63 +++++++++++++++++++++----- tasmota/xdrv_10_scripter.ino | 10 ++-- tasmota/xdrv_50_filesystem.ino | 8 +++- tasmota/xdrv_52_9_berry.ino | 12 +++-- 8 files changed, 77 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41ec5a960..7b5b9e848 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file. - In tasmota-sensors.bin enabled support for VL53L0X and disabled TSL2561 (#11711) - Add HLW8012/BL0937 average pulse calculation by Alex Lovett (#11722) - Redesigned initial GUI wifi configuration by Adrian Scillato (#11693) +- Redesigned GUI by moving non-configuration buttons from ``Configuration`` to new submenu ``Consoles`` ### Fixed - Telegram chat id incorrect size (#11660) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 921800545..4a7ba03a6 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -120,6 +120,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - ADC range result from int to float using command ``FreqRes`` for decimal resolution selection [#11545](https://github.com/arendst/Tasmota/issues/11545) - Removed overtemp detection on external energy monitoring devices [#11628](https://github.com/arendst/Tasmota/issues/11628) - Redesigned initial GUI wifi configuration by Adrian Scillato [#11693](https://github.com/arendst/Tasmota/issues/11693) +- Redesigned GUI by moving non-configuration buttons from ``Configuration`` to new submenu ``Consoles`` - In tasmota-sensors.bin enabled support for VL53L0X and disabled TSL2561 [#11711](https://github.com/arendst/Tasmota/issues/11711) - Add HLW8012/BL0937 average pulse calculation by Alex Lovett [#11722](https://github.com/arendst/Tasmota/issues/11722) diff --git a/tasmota/tasmota.h b/tasmota/tasmota.h index c9d58fd05..bd8c392ee 100644 --- a/tasmota/tasmota.h +++ b/tasmota/tasmota.h @@ -310,7 +310,7 @@ enum XsnsFunctions {FUNC_SETTINGS_OVERRIDE, FUNC_PIN_STATE, FUNC_MODULE_INIT, FU FUNC_SET_POWER, FUNC_SET_DEVICE_POWER, FUNC_SHOW_SENSOR, FUNC_ANY_KEY, FUNC_ENERGY_EVERY_SECOND, FUNC_ENERGY_RESET, FUNC_RULES_PROCESS, FUNC_SERIAL, FUNC_FREE_MEM, FUNC_BUTTON_PRESSED, - FUNC_WEB_ADD_BUTTON, FUNC_WEB_ADD_MANAGEMENT_BUTTON, FUNC_WEB_ADD_MAIN_BUTTON, + FUNC_WEB_ADD_BUTTON, FUNC_WEB_ADD_CONSOLE_BUTTON, FUNC_WEB_ADD_MANAGEMENT_BUTTON, FUNC_WEB_ADD_MAIN_BUTTON, FUNC_WEB_ADD_HANDLER, FUNC_SET_CHANNELS, FUNC_SET_SCHEME, FUNC_HOTPLUG_SCAN, FUNC_DEVICE_GROUP_ITEM }; diff --git a/tasmota/tasmota_configurations_ESP32.h b/tasmota/tasmota_configurations_ESP32.h index 20723fd69..daa2b43f8 100644 --- a/tasmota/tasmota_configurations_ESP32.h +++ b/tasmota/tasmota_configurations_ESP32.h @@ -128,6 +128,7 @@ #define USE_SCRIPT_GLOBVARS #define USE_SCRIPT_SUB_COMMAND #define USE_ANGLE_FUNC + #define USE_SCRIPT_WEB_DISPLAY #define SCRIPT_FULL_WEBPAGE #define SCRIPT_GET_HTTPS_JP #define USE_GOOGLE_CHARTS diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 5b97d04db..f18cc0b4b 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -361,16 +361,19 @@ const char HTTP_DEVICE_STATE[] PROGMEM = "