diff --git a/CHANGELOG.md b/CHANGELOG.md index dd1116bbe..2372bc3f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,14 @@ All notable changes to this project will be documented in this file. - Optional GUI file editor enabled with define ``GUI_EDIT_FILE`` by barbudor (#11668) - Initial support for universal display driver UDisplay by Gerhard Mutz. Enable by selecting any GPIO as ``Option A3`` (#11665) +### Breaking Changed +- ESP32 partition layout changed to accomodate more file space on most and more code space on core2 and odroid-go (#11746) + ### Changed - 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 397bb6fe4..28832bc08 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -108,6 +108,9 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - ESP32 support for secondary I2C controller - ESP32 support for internal Hall Effect sensor connected to both GPIO36 and GPIO39 only +### Breaking Changed +- ESP32 partition layout changed to accomodate more file space on most and more code space on core2 and odroid-go [#11746](https://github.com/arendst/Tasmota/issues/11746) + ### Changed - TasmotaSerial library from v3.2.0 to v3.3.0 - PubSubClient library from EspEasy v2.7.12 to Tasmota v2.8.12 @@ -120,6 +123,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/boards/esp32c3.json b/boards/esp32c3.json new file mode 100644 index 000000000..bc703484c --- /dev/null +++ b/boards/esp32c3.json @@ -0,0 +1,29 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32c3_out.ld" + }, + "core": "esp32", + "f_cpu": "160000000L", + "f_flash": "80000000L", + "flash_mode": "dio", + "mcu": "esp32c3", + "variant": "esp32c3" + }, + "connectivity": [ + "wifi" + ], + "frameworks": [ + "arduino" + ], + "name": "Espressif ESP32-C3", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.espressif.com/projects/esp-idf/en/latest", + "vendor": "Espressif" +} 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_override_sample.ini b/platformio_override_sample.ini index 9821e2e97..4d10f5c60 100644 --- a/platformio_override_sample.ini +++ b/platformio_override_sample.ini @@ -35,6 +35,7 @@ default_envs = ; tasmota32-ir ; tasmota32-ircustom ; tasmota32solo1 +; tasmota32c3 ; tasmota32s2 ; tasmota32-odroidgo ; tasmota32-core2 @@ -185,6 +186,23 @@ lib_ignore = Micro-RTSP ESP32 Ethernet +; *** EXPERIMENTAL Tasmota version for ESP32-C3 +[env:tasmota32c3] +extends = env:tasmota32_base +board = esp32c3 +platform = https://github.com/Jason2866/platform-espressif32.git#feature/arduino-c3 +platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/v.2.0.0.pre/framework-arduinoespressif32-master-a6f33a9d3.tar.gz + ; needed toolchain for Windows + toolchain-riscv32 @ https://github.com/Jason2866/platform-espressif32/releases/download/8.4.0/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-win32.zip + ; needed toolchain for Linux + ;toolchain-riscv32 @ https://github.com/Jason2866/platform-espressif32/releases/download/8.4.0/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-linux-amd64.tar.gz + ; needed toolchain for MacOS + ;toolchain-riscv32 @ https://github.com/Jason2866/platform-espressif32/releases/download/8.4.0/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-macos.tar.gz + platformio/tool-mklittlefs @ ~1.203.200522 +build_unflags = ${esp32_defaults.build_unflags} -mtarget-align +build_flags = ${esp32_defaults.build_flags} + ;-DESP32_STAGE=true + ; *** EXPERIMENTAL Tasmota version for Arduino ESP32 IDF4.4. Linking not working. [env:tasmota32idf4] extends = env:tasmota32_base 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/tasmota/i18n.h b/tasmota/i18n.h index c435348a8..e3cc2cf8a 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -814,7 +814,9 @@ const float kSpeedConversionFactor[] = {1, // none // xdrv_02_webserver.ino #ifdef USE_WEBSERVER // {s} = , {m} = , {e} = -const char HTTP_SNS_F_TEMP[] PROGMEM = "{s}%s " D_TEMPERATURE "{m}%*_f " D_UNIT_DEGREE "%c{e}"; +const char HTTP_SNS_F_TEMP[] PROGMEM = "{s}%s " D_TEMPERATURE "{m}%*_f " D_UNIT_DEGREE "%c{e}"; +const char HTTP_SNS_F_VOLTAGE[] PROGMEM = "{s}%s " D_VOLTAGE "{m}%*_f " D_UNIT_VOLT "{e}"; +const char HTTP_SNS_F_CURRENT_MA[] PROGMEM = "{s}%s " D_CURRENT "{m}%*_f " D_UNIT_MILLIAMPERE "{e}"; const char HTTP_SNS_HUM[] PROGMEM = "{s}%s " D_HUMIDITY "{m}%s " D_UNIT_PERCENT "{e}"; const char HTTP_SNS_DEW[] PROGMEM = "{s}%s " D_DEWPOINT "{m}%s " D_UNIT_DEGREE "%c{e}"; const char HTTP_SNS_PRESSURE[] PROGMEM = "{s}%s " D_PRESSURE "{m}%s " "%s{e}"; diff --git a/tasmota/language/af_AF.h b/tasmota/language/af_AF.h index 297ca7de0..6c6c9ba54 100644 --- a/tasmota/language/af_AF.h +++ b/tasmota/language/af_AF.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Konfigurasie" #define D_INFORMATION "Inligting" #define D_FIRMWARE_UPGRADE "Firmware-opgradering" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Konsole" #define D_CONFIRM_RESTART "Bevestig weer te begin" diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h index 589503792..0a8e606ee 100644 --- a/tasmota/language/bg_BG.h +++ b/tasmota/language/bg_BG.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Конфигурация" #define D_INFORMATION "Информация" #define D_FIRMWARE_UPGRADE "Обновяване на фърмуера" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Конзола" #define D_CONFIRM_RESTART "Потвърдете рестартирането" diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h index 9694301ee..84f022a50 100644 --- a/tasmota/language/cs_CZ.h +++ b/tasmota/language/cs_CZ.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Nastavení" #define D_INFORMATION "Informace" #define D_FIRMWARE_UPGRADE "Aktualizace firmware" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Konzole" #define D_CONFIRM_RESTART "Potvrzení restartu" diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index 2625ceaf2..9870ca0a3 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.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 v9.3.1.2 + * Updated until v9.3.1.3 \*********************************************************************/ //#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -84,7 +84,7 @@ #define D_DISABLED "deaktiviert" #define D_DISTANCE "Abstand" #define D_DNS_SERVER "DNS-Server" -#define D_DO "Disolved Oxygen" +#define D_DO "gelöster Sauerstoff" #define D_DONE "erledigt" #define D_DST_TIME "DST" #define D_EC "EC" @@ -109,7 +109,7 @@ #define D_GATEWAY "Gateway" #define D_GROUP "Gruppe" #define D_HOST "Host" -#define D_HALL_EFFECT "Hall Effect" +#define D_HALL_EFFECT "Hall Effekt" #define D_HOSTNAME "Hostname" #define D_HUMIDITY "Feuchtigkeit" #define D_ILLUMINANCE "Beleuchtungsstärke" @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Einstellungen" #define D_INFORMATION "Informationen" #define D_FIRMWARE_UPGRADE "Firmware Update" +#define D_MANAGEMENT "Konsolen" #define D_CONSOLE "Konsole" #define D_CONFIRM_RESTART "Wirklich neustarten?" @@ -291,18 +292,18 @@ #define D_WPA_PSK "WPA-PSK" #define D_WPA2_PSK "WPA2-PSK" #define D_AP1_SSID "WLAN 1 - SSID" -#define D_AP1_SSID_HELP "Type or Select your WiFi Network" +#define D_AP1_SSID_HELP "WiFi Netzwerk auswählen oder eingeben" #define D_AP2_SSID "WLAN 2 - SSID" -#define D_AP2_SSID_HELP "Type your Alternative WiFi Network" +#define D_AP2_SSID_HELP "alternatives WiFi Netzwerk eingeben" #define D_AP_PASSWORD "WLAN - Passwort" -#define D_AP_PASSWORD_HELP "Enter your WiFi Password" -#define D_SELECT_YOUR_WIFI_NETWORK "Select your WiFi Network" -#define D_SHOW_MORE_WIFI_NETWORKS "Scan for all WiFi Networks" -#define D_SHOW_MORE_OPTIONS "More Options" -#define D_CHECK_CREDENTIALS "Please, check your credentials" -#define D_SUCCESSFUL_WIFI_CONNECTION "Successful WiFi Connection" -#define D_NOW_YOU_CAN_CLOSE_THIS_WINDOW "Now you can close this window" -#define D_REDIRECTING_TO_NEW_IP "Redirecting to new device's IP address" +#define D_AP_PASSWORD_HELP "WiFi Passwort eingeben" +#define D_SELECT_YOUR_WIFI_NETWORK "WiFi Netzwerk auswählen" +#define D_SHOW_MORE_WIFI_NETWORKS "Suche nach WiFi Netzwerken" +#define D_SHOW_MORE_OPTIONS "Mehr Optionen" +#define D_CHECK_CREDENTIALS "Bitte SSID/Passwort überprüfen" +#define D_SUCCESSFUL_WIFI_CONNECTION "mit Wifi verbunden" +#define D_NOW_YOU_CAN_CLOSE_THIS_WINDOW "das Fenster kann geschlossen werden" +#define D_REDIRECTING_TO_NEW_IP "Umleitung zur neuen Geräte IP-Addresse" #define D_MQTT_PARAMETERS "MQTT-Einstellungen" #define D_CLIENT "client" @@ -335,14 +336,14 @@ #define D_TEMPLATE_PARAMETERS "Vorlage Parameter" #define D_TEMPLATE_NAME "Name" #define D_BASE_TYPE "basiert auf" -#define D_TEMPLATE_FLAGS "Options" +#define D_TEMPLATE_FLAGS "Optionen" #define D_SAVE_CONFIGURATION "Konfiguration speichern" #define D_CONFIGURATION_SAVED "Konfiguration gespeichert" #define D_CONFIGURATION_RESET "Konfiguration zurücksetzen" #define D_PROGRAM_VERSION "Tasmota Version" -#define D_BUILD_DATE_AND_TIME "Build-Datum & -Uhrzeit" +#define D_BUILD_DATE_AND_TIME "Erstellungs-Datum & -Uhrzeit" #define D_CORE_AND_SDK_VERSION "Core-/SDK-Version" #define D_FLASH_WRITE_COUNT "Anz. Flash-Schreibzyklen" #define D_MAC_ADDRESS "MAC-Adresse" @@ -521,7 +522,7 @@ #define D_SENSORS_FOUND "Sensor gefunden" // xsns_06_dht.ino -#define D_TIMEOUT_WAITING_FOR "Timeout während Warten auf" +#define D_TIMEOUT_WAITING_FOR "Zeitüberschreitung während Warten auf" #define D_START_SIGNAL_LOW "Startausschlag niedrig" #define D_START_SIGNAL_HIGH "Startausschlag hoch" #define D_PULSE "Puls" diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h index 27e4b332b..55e3a99de 100644 --- a/tasmota/language/el_GR.h +++ b/tasmota/language/el_GR.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Ρυθμίσεις" #define D_INFORMATION "Πληροφορίες" #define D_FIRMWARE_UPGRADE "Αναβάθμιση" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Κονσόλα" #define D_CONFIRM_RESTART "Επιβεβαίωση επανεκκίνησης" diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index b592fc826..5ea16fdf3 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Configuration" #define D_INFORMATION "Information" #define D_FIRMWARE_UPGRADE "Firmware Upgrade" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Console" #define D_CONFIRM_RESTART "Confirm Restart" diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index acc823221..b79b4b456 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -1,5 +1,5 @@ /* - es-ES.h - localization for Spanish - Spain for Tasmota (translation also valid for all latinamerica) + es-ES.h - localization for Spanish - Spain for Tasmota (International Spanish valid for all latinamerica) Copyright (C) 2021 Adrian Scillato @@ -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 v9.3.1.2 + * Updated until v9.3.1.3 \*********************************************************************/ #define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Configuración" #define D_INFORMATION "Información" #define D_FIRMWARE_UPGRADE "Actualizar Firmware" +#define D_MANAGEMENT "Consolas" #define D_CONSOLE "Consola" #define D_CONFIRM_RESTART "Confirmar Reinicio" @@ -925,9 +926,9 @@ #define D_MANAGE_FILE_SYSTEM "Explorar Archivos" #define D_FS_SIZE "Tamaño" #define D_FS_FREE "Libre" -#define D_NEW_FILE "newfile.txt" -#define D_CREATE_NEW_FILE "Create and edit new file" -#define D_EDIT_FILE "Edit File" +#define D_NEW_FILE "nuevo.txt" +#define D_CREATE_NEW_FILE "Crear y editar un archivo nuevo" +#define D_EDIT_FILE "Editar Archivo" //xsns_67_as3935.ino #define D_AS3935_GAIN "Ganancia:" @@ -945,7 +946,7 @@ #define D_AS3935_DISTDET "Perturbancia detectada" #define D_AS3935_INTNOEV "Interrupción sin evento!" #define D_AS3935_FLICKER "IRQ flicker!" -#define D_AS3935_POWEROFF "Power Off" +#define D_AS3935_POWEROFF "Apagado" #define D_AS3935_NOMESS "Escuchando..." #define D_AS3935_ON "Encendido" #define D_AS3935_OFF "Apagado" diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h index aa74db5dd..dd590b905 100644 --- a/tasmota/language/fr_FR.h +++ b/tasmota/language/fr_FR.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Configuration" #define D_INFORMATION "Informations" #define D_FIRMWARE_UPGRADE "Mise à jour du Firmware" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Console" #define D_CONFIRM_RESTART "Confirmer redémarrage" diff --git a/tasmota/language/fy_NL.h b/tasmota/language/fy_NL.h index d76bf3fb9..2e87da726 100644 --- a/tasmota/language/fy_NL.h +++ b/tasmota/language/fy_NL.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Konfiguraasje" #define D_INFORMATION "Ynformaasje" #define D_FIRMWARE_UPGRADE "Opwurdearje" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Konsole" #define D_CONFIRM_RESTART "Befestigje opnij starte" diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h index 7d360e060..c58d58571 100644 --- a/tasmota/language/he_HE.h +++ b/tasmota/language/he_HE.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "הגדרות" #define D_INFORMATION "מידע" #define D_FIRMWARE_UPGRADE "שדרוג קושחה" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "קונסול" #define D_CONFIRM_RESTART "אישור הפעלה מחדש" diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h index eb6f6b41b..fd143a725 100644 --- a/tasmota/language/hu_HU.h +++ b/tasmota/language/hu_HU.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Beállítások" #define D_INFORMATION "Információ" #define D_FIRMWARE_UPGRADE "Firmware frissítés" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Konzol" #define D_CONFIRM_RESTART "Biztosan újraindítsam a modult?" diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index 0c27874f2..ab529c2e4 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.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 v9.3.1.3 - Last update 14.04.2021 + * Updated until v9.3.1.3 - Last update 16.04.2021 \*********************************************************************/ #define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Impostazioni" #define D_INFORMATION "Informazioni" #define D_FIRMWARE_UPGRADE "Aggiorna firmware" +#define D_MANAGEMENT "Console" #define D_CONSOLE "Console" #define D_CONFIRM_RESTART "Conferma riavvio" diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h index 9cce3e4ad..963c784cc 100644 --- a/tasmota/language/ko_KO.h +++ b/tasmota/language/ko_KO.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "설정 메뉴" #define D_INFORMATION "정보" #define D_FIRMWARE_UPGRADE "펌웨어 업그레이드" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "콘솔" #define D_CONFIRM_RESTART "재시작" diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h index 7917a6dd7..6d1b78244 100644 --- a/tasmota/language/nl_NL.h +++ b/tasmota/language/nl_NL.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Configuratie" #define D_INFORMATION "Informatie" #define D_FIRMWARE_UPGRADE "Opwaarderen" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Console" #define D_CONFIRM_RESTART "Bevestig herstart" diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index ee345765b..354fb9df4 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Konfiguracja" #define D_INFORMATION "Informacje" #define D_FIRMWARE_UPGRADE "Aktualizacja oprogramowania" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Konsola" #define D_CONFIRM_RESTART "Potwierdź restart" diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index 3be3dbc04..242fdb38b 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Configuração" #define D_INFORMATION "Informação" #define D_FIRMWARE_UPGRADE "Atualização de firmware" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Console" #define D_CONFIRM_RESTART "Confirmar o reinicio" diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index 245532523..958adaed0 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Configuração" #define D_INFORMATION "Informação" #define D_FIRMWARE_UPGRADE "Atualização de Firmware" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Consola" #define D_CONFIRM_RESTART "Confirmar o reinício" diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h index 6c62d0c98..3b39b5162 100644 --- a/tasmota/language/ro_RO.h +++ b/tasmota/language/ro_RO.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Configurație" #define D_INFORMATION "Informație" #define D_FIRMWARE_UPGRADE "Actualizare Firmware" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Consolă" #define D_CONFIRM_RESTART "Confirmare Restart" diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h index 4ef363376..b8c86c53d 100644 --- a/tasmota/language/ru_RU.h +++ b/tasmota/language/ru_RU.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Конфигурация" #define D_INFORMATION "Информация" #define D_FIRMWARE_UPGRADE "Обновление прошивки" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Консоль" #define D_CONFIRM_RESTART "Подтвердить перезагрузку" diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h index 6570bccdd..774c41113 100644 --- a/tasmota/language/sk_SK.h +++ b/tasmota/language/sk_SK.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Nastavenia" #define D_INFORMATION "Informácie" #define D_FIRMWARE_UPGRADE "Aktualizácia firmware" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Konzola" #define D_CONFIRM_RESTART "Potvrdenie reštartu" diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h index c195d4735..d5994fa4a 100644 --- a/tasmota/language/sv_SE.h +++ b/tasmota/language/sv_SE.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Konfigurering" #define D_INFORMATION "Information" #define D_FIRMWARE_UPGRADE "Uppgradera firmware" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Konsol" #define D_CONFIRM_RESTART "Bekräfta omstart" diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h index 8064479c7..722fd5bf3 100644 --- a/tasmota/language/tr_TR.h +++ b/tasmota/language/tr_TR.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Konfigürasyon" #define D_INFORMATION "Bilgi" #define D_FIRMWARE_UPGRADE "Cihaz yazılımını Güncelle" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Konsol" #define D_CONFIRM_RESTART "Yeniden Başlatmayı Onayla" diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h index 2f18836f1..d71faaa7e 100644 --- a/tasmota/language/uk_UA.h +++ b/tasmota/language/uk_UA.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Конфігурація" #define D_INFORMATION "Інформація" #define D_FIRMWARE_UPGRADE "Оновлення прошивки" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Консоль" #define D_CONFIRM_RESTART "Підтвердити перезавантаження" diff --git a/tasmota/language/vi_VN.h b/tasmota/language/vi_VN.h index 5b0c3a247..c35ef7f3d 100644 --- a/tasmota/language/vi_VN.h +++ b/tasmota/language/vi_VN.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "Cấu hình" #define D_INFORMATION "Thông tin" #define D_FIRMWARE_UPGRADE "Nâng cấp Firmware" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "Dòng Lệnh" #define D_CONFIRM_RESTART "Xác nhận khởi động lại" diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h index 22580ed43..fe73764c5 100644 --- a/tasmota/language/zh_CN.h +++ b/tasmota/language/zh_CN.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "设置" #define D_INFORMATION "信息" #define D_FIRMWARE_UPGRADE "固件升级" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "控制台" #define D_CONFIRM_RESTART "确认重启" diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h index c84fe4607..edb11e329 100644 --- a/tasmota/language/zh_TW.h +++ b/tasmota/language/zh_TW.h @@ -256,6 +256,7 @@ #define D_CONFIGURATION "設定" #define D_INFORMATION "資訊" #define D_FIRMWARE_UPGRADE "韌體升級" +#define D_MANAGEMENT "Consoles" #define D_CONSOLE "控制台" #define D_CONFIRM_RESTART "確認重新啟動" 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 13f2ad269..daa2b43f8 100644 --- a/tasmota/tasmota_configurations_ESP32.h +++ b/tasmota/tasmota_configurations_ESP32.h @@ -60,6 +60,7 @@ #define USE_UFILESYS #define USE_SDCARD #define GUI_TRASH_FILE + #define GUI_EDIT_FILE #ifdef USE_BERRY // Berry scripting language #define USE_BERRY_PSRAM // Allocate Berry memory in PSRAM if PSRAM is connected - this might be slightly slower but leaves main memory intact @@ -94,6 +95,7 @@ #define USE_UFILESYS #define USE_SDCARD #define GUI_TRASH_FILE + #define GUI_EDIT_FILE #ifdef USE_BERRY // Berry scripting language #define USE_BERRY_PSRAM // Allocate Berry memory in PSRAM if PSRAM is connected - this might be slightly slower but leaves main memory intact @@ -104,7 +106,7 @@ #define USE_MPU6886 #define USE_SPI #define USE_DISPLAY - #define USE_DISPLAY_ILI9342 + #define USE_DISPLAY_ILI9341 #define JPEG_PICTS #define USE_FT5206 #define USE_TOUCH_BUTTONS @@ -112,7 +114,7 @@ #define USE_SENDMAIL #define USE_ESP32MAIL -//#define USE_SCRIPT // Add support for script (+17k code) +#define USE_SCRIPT // Add support for script (+17k code) // Script related defines #ifdef USE_SCRIPT #undef USE_RULES @@ -126,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 @@ -150,6 +153,8 @@ #define USE_UFILESYS #define USE_SDCARD #define GUI_TRASH_FILE + #define GUI_EDIT_FILE + #define USE_ADC #undef USE_BERRY // Disable Berry scripting language #define USE_BLE_ESP32 // Enable new BLE driver @@ -165,6 +170,11 @@ #define USE_ENHANCED_GUI_WIFI_SCAN +#define USE_UFILESYS +#define USE_SDCARD + #define GUI_TRASH_FILE + #define GUI_EDIT_FILE + #define ROTARY_V1 // Add support for Rotary Encoder as used in MI Desk Lamp #define USE_TUYA_MCU // Add support for Tuya Serial MCU diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 8cac58e71..f18cc0b4b 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -361,16 +361,19 @@ const char HTTP_DEVICE_STATE[] PROGMEM = "type == KNX_ENERGY_VOLTAGE) // Reply KNX_ENERGY_VOLTAGE - { - if (Energy.data_valid[0]) { + { + knx.answer_4byte_float(msg.received_on, Energy.voltage[0]); + if (Settings.flag.knx_enable_enhancement) { + knx.answer_4byte_float(msg.received_on, Energy.voltage[0]); knx.answer_4byte_float(msg.received_on, Energy.voltage[0]); - if (Settings.flag.knx_enable_enhancement) { - knx.answer_4byte_float(msg.received_on, Energy.voltage[0]); - knx.answer_4byte_float(msg.received_on, Energy.voltage[0]); - } } } else if (chan->type == KNX_ENERGY_CURRENT) // Reply KNX_ENERGY_CURRENT { - if (Energy.data_valid[0]) { + knx.answer_4byte_float(msg.received_on, Energy.current[0]); + if (Settings.flag.knx_enable_enhancement) { + knx.answer_4byte_float(msg.received_on, Energy.current[0]); knx.answer_4byte_float(msg.received_on, Energy.current[0]); - if (Settings.flag.knx_enable_enhancement) { - knx.answer_4byte_float(msg.received_on, Energy.current[0]); - knx.answer_4byte_float(msg.received_on, Energy.current[0]); - } } } else if (chan->type == KNX_ENERGY_POWER) // Reply KNX_ENERGY_POWER { - if (Energy.data_valid[0]) { + knx.answer_4byte_float(msg.received_on, Energy.active_power[0]); + if (Settings.flag.knx_enable_enhancement) { + knx.answer_4byte_float(msg.received_on, Energy.active_power[0]); knx.answer_4byte_float(msg.received_on, Energy.active_power[0]); - if (Settings.flag.knx_enable_enhancement) { - knx.answer_4byte_float(msg.received_on, Energy.active_power[0]); - knx.answer_4byte_float(msg.received_on, Energy.active_power[0]); - } } } else if (chan->type == KNX_ENERGY_POWERFACTOR) // Reply KNX_ENERGY_POWERFACTOR { - if (Energy.data_valid[0]) { + knx.answer_4byte_float(msg.received_on, Energy.power_factor[0]); + if (Settings.flag.knx_enable_enhancement) { + knx.answer_4byte_float(msg.received_on, Energy.power_factor[0]); knx.answer_4byte_float(msg.received_on, Energy.power_factor[0]); - if (Settings.flag.knx_enable_enhancement) { - knx.answer_4byte_float(msg.received_on, Energy.power_factor[0]); - knx.answer_4byte_float(msg.received_on, Energy.power_factor[0]); - } } } else if (chan->type == KNX_ENERGY_YESTERDAY) // Reply KNX_ENERGY_YESTERDAY { - if (Energy.data_valid[0]) { - float energy_kWhyesterday = (float)Settings.energy_kWhyesterday / 100000; + float energy_kWhyesterday = (float)Settings.energy_kWhyesterday / 100000; + knx.answer_4byte_float(msg.received_on, energy_kWhyesterday); + if (Settings.flag.knx_enable_enhancement) { + knx.answer_4byte_float(msg.received_on, energy_kWhyesterday); knx.answer_4byte_float(msg.received_on, energy_kWhyesterday); - if (Settings.flag.knx_enable_enhancement) { - knx.answer_4byte_float(msg.received_on, energy_kWhyesterday); - knx.answer_4byte_float(msg.received_on, energy_kWhyesterday); - } } } else if (chan->type == KNX_ENERGY_DAILY) // Reply KNX_ENERGY_DAILY { - if (Energy.data_valid[0]) { + knx.answer_4byte_float(msg.received_on, Energy.daily); + if (Settings.flag.knx_enable_enhancement) { + knx.answer_4byte_float(msg.received_on, Energy.daily); knx.answer_4byte_float(msg.received_on, Energy.daily); - if (Settings.flag.knx_enable_enhancement) { - knx.answer_4byte_float(msg.received_on, Energy.daily); - knx.answer_4byte_float(msg.received_on, Energy.daily); - } } } else if (chan->type == KNX_ENERGY_TOTAL) // Reply KNX_ENERGY_TOTAL { - if (Energy.data_valid[0]) { + knx.answer_4byte_float(msg.received_on, Energy.total); + if (Settings.flag.knx_enable_enhancement) { + knx.answer_4byte_float(msg.received_on, Energy.total); knx.answer_4byte_float(msg.received_on, Energy.total); - if (Settings.flag.knx_enable_enhancement) { - knx.answer_4byte_float(msg.received_on, Energy.total); - knx.answer_4byte_float(msg.received_on, Energy.total); - } } } #ifdef USE_RULES diff --git a/tasmota/xdrv_42_i2s_audio.ino b/tasmota/xdrv_42_i2s_audio.ino index a63918206..1ab15e4ee 100644 --- a/tasmota/xdrv_42_i2s_audio.ino +++ b/tasmota/xdrv_42_i2s_audio.ino @@ -69,8 +69,8 @@ #ifdef USE_M5STACK_CORE2 #undef AUDIO_PWR_ON #undef AUDIO_PWR_OFF -#define AUDIO_PWR_ON CORE2_audio_power(true); -#define AUDIO_PWR_OFF CORE2_audio_power(false); +#define AUDIO_PWR_ON Core2AudioPower(true); +#define AUDIO_PWR_OFF Core2AudioPower(false); #undef DAC_IIS_BCK #undef DAC_IIS_WS #undef DAC_IIS_DOUT diff --git a/tasmota/xdrv_50_filesystem.ino b/tasmota/xdrv_50_filesystem.ino index b745d8594..51d178f40 100644 --- a/tasmota/xdrv_50_filesystem.ino +++ b/tasmota/xdrv_50_filesystem.ino @@ -588,15 +588,15 @@ const char UFS_FORM_SDC_HREFedit[] PROGMEM = "📝"; // 📝 const char HTTP_EDITOR_FORM_START[] PROGMEM = - "
 " D_EDIT_FILE " " - "
" - "

" - "" - "" - "
"; + "" + "" + ""; #endif // #ifdef GUI_EDIT_FILE @@ -661,7 +661,7 @@ void UfsDirectory(void) { } WSContentSend_P(UFS_FORM_SDC_DIRc); WSContentSend_P(UFS_FORM_FILE_UPGb); - WSContentSpaceButton(BUTTON_CONFIGURATION); + WSContentSpaceButton(BUTTON_MANAGEMENT); WSContentStop(); Web.upload_file_type = UPL_UFSFILE; @@ -905,7 +905,6 @@ void UfsUploadFileClose(void) { ufs_upload_file.close(); } - //****************************************************************************************** // File Editor //****************************************************************************************** @@ -917,45 +916,44 @@ void UfsEditor(void) { AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor GET")); - String fname; + char fname_input[UFS_FILENAME_SIZE]; if (Webserver->hasArg(F("file"))) { - fname = Webserver->arg(F("file")); + WebGetArg(PSTR("file"), fname_input, sizeof(fname_input)); + } else { + snprintf_P(fname_input, sizeof(fname_input), PSTR(D_NEW_FILE)); } - else { - fname = D_NEW_FILE; - } - if (fname[0] != '/') fname = "/" +fname; + char fname[UFS_FILENAME_SIZE]; + UfsFilename(fname, fname_input); // Trim spaces and add slash - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file=%s, ffs_type=%d, TfsFileExist=%d"), fname.c_str(), ffs_type, TfsFileExists(fname.c_str())); + AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file=%s, ffs_type=%d, TfsFileExist=%d"), fname, ffs_type, TfsFileExists(fname)); WSContentStart_P(PSTR(D_EDIT_FILE)); WSContentSendStyle(); - WSContentSend_P(HTTP_EDITOR_FORM_START, fname.c_str()); + char *bfname = fname +1; + WSContentSend_P(HTTP_EDITOR_FORM_START, bfname); // Skip leading slash - if (ffs_type && TfsFileExists(fname.c_str())) { - File fp = ffsp->open(fname.c_str(), "r"); + if (ffs_type && TfsFileExists(fname)) { + File fp = ffsp->open(fname, "r"); if (!fp) { AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file open failed")); WSContentSend_P(D_NEW_FILE); + } else { + uint8_t *buf = (uint8_t*)malloc(FILE_BUFFER_SIZE+1); + size_t filelen = fp.size(); + AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file len=%d"), filelen); + while (filelen > 0) { + size_t l = fp.read(buf, FILE_BUFFER_SIZE); + AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("UFS: UfsEditor: read=%d"), l); + if (l < 0) { break; } + buf[l] = '\0'; + WSContentSend_P((const char*)buf); + filelen -= l; + } + fp.close(); + free(buf); + AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: read done")); } - else { - uint8_t *buf = (uint8_t*)malloc(FILE_BUFFER_SIZE+1); - size_t filelen = fp.size(); - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file len=%d"), filelen); - while ( filelen > 0 ) { - size_t l = fp.read(buf, FILE_BUFFER_SIZE); - AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("UFS: UfsEditor: read=%d"), l); - if (l < 0) break; - buf[l] = '\0'; - WSContentSend_P((const char*)buf); - filelen -= l; - } - fp.close(); - free(buf); - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: read done")); - } - } - else { + } else { WSContentSend_P(D_NEW_FILE); } @@ -974,8 +972,12 @@ void UfsEditorUpload(void) { WSSend(400, CT_PLAIN, F("400: Bad request - no filename")); return; } - String name = Webserver->arg("name"); - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file '%s'"), name.c_str()); + + char fname_input[UFS_FILENAME_SIZE]; + WebGetArg(PSTR("name"), fname_input, sizeof(fname_input)); + char fname[UFS_FILENAME_SIZE]; + UfsFilename(fname, fname_input); // Trim spaces and add slash + AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file '%s'"), fname); if (!Webserver->hasArg("content")) { AddLog(LOG_LEVEL_ERROR, PSTR("UFS: UfsEditor: file upload - no content")); @@ -991,10 +993,10 @@ void UfsEditorUpload(void) { return; } - File fp = ffsp->open(name.c_str(), "w"); - if(!fp) { + File fp = ffsp->open(fname, "w"); + if (!fp) { Web.upload_error = 1; - AddLog(LOG_LEVEL_ERROR, PSTR("UFS: UfsEditor: 400: invalid file name '%s'"), name.c_str()); + AddLog(LOG_LEVEL_ERROR, PSTR("UFS: UfsEditor: 400: invalid file name '%s'"), fname); WSSend(400, CT_PLAIN, F("400: bad request - invalid filename")); return; } @@ -1005,7 +1007,7 @@ void UfsEditorUpload(void) { } if (!fp.print(content)) { - AddLog(LOG_LEVEL_ERROR, PSTR("UFS: UfsEditor: write error on '%s'"), name.c_str()); + AddLog(LOG_LEVEL_ERROR, PSTR("UFS: UfsEditor: write error on '%s'"), fname); } fp.close(); @@ -1014,7 +1016,7 @@ void UfsEditorUpload(void) { Webserver->send(303); } -#endif // #ifdef GUI_EDIT_FILE +#endif // GUI_EDIT_FILE #endif // USE_WEBSERVER @@ -1045,7 +1047,11 @@ bool Xdrv50(uint8_t function) { #ifdef USE_WEBSERVER case FUNC_WEB_ADD_MANAGEMENT_BUTTON: if (ufs_type) { - WSContentSend_PD(UFS_WEB_DIR, PSTR(D_MANAGE_FILE_SYSTEM)); + if (XdrvMailbox.index) { + XdrvMailbox.index++; + } else { + WSContentSend_PD(UFS_WEB_DIR, PSTR(D_MANAGE_FILE_SYSTEM)); + } } break; case FUNC_WEB_ADD_HANDLER: diff --git a/tasmota/xdrv_52_9_berry.ino b/tasmota/xdrv_52_9_berry.ino index f9994f271..de0681cf9 100644 --- a/tasmota/xdrv_52_9_berry.ino +++ b/tasmota/xdrv_52_9_berry.ino @@ -636,7 +636,7 @@ void HandleBerryConsole(void) WSContentFlush(); _WSContentSend(HTTP_BERRY_STYLE_CMND); _WSContentSend(HTTP_BERRY_FORM_CMND); - WSContentSpaceButton(BUTTON_MAIN); + WSContentSpaceButton(BUTTON_MANAGEMENT); WSContentStop(); } @@ -721,9 +721,13 @@ bool Xdrv52(uint8_t function) // case FUNC_SET_POWER: // break; #ifdef USE_WEBSERVER - case FUNC_WEB_ADD_BUTTON: - WSContentSend_P(HTTP_BTN_BERRY_CONSOLE); - callBerryEventDispatcher(PSTR("web_add_button"), nullptr, 0, nullptr); + case FUNC_WEB_ADD_CONSOLE_BUTTON: + if (XdrvMailbox.index) { + XdrvMailbox.index++; + } else { + WSContentSend_P(HTTP_BTN_BERRY_CONSOLE); + callBerryEventDispatcher(PSTR("web_add_button"), nullptr, 0, nullptr); + } break; case FUNC_WEB_ADD_MAIN_BUTTON: callBerryEventDispatcher(PSTR("web_add_main_button"), nullptr, 0, nullptr); diff --git a/tasmota/xdrv_79_esp32_ble.ino b/tasmota/xdrv_79_esp32_ble.ino index 31b16ceb9..5fabfe5cc 100644 --- a/tasmota/xdrv_79_esp32_ble.ino +++ b/tasmota/xdrv_79_esp32_ble.ino @@ -2004,7 +2004,7 @@ static void BLETaskRunCurrentOperation(BLE_ESP32::generic_sensor_t** pCurrentOpe } } if (op->writelen){ - if(pCharacteristic->canWrite()) { + if(pCharacteristic->canWrite() || pCharacteristic->canWriteNoResponse() ) { if (!pCharacteristic->writeValue(op->dataToWrite, op->writelen, true)){ newstate = GEN_STATE_FAILED_WRITE; #ifdef BLE_ESP32_DEBUG diff --git a/tasmota/xdrv_84_esp32_core2.ino b/tasmota/xdrv_84_esp32_core2.ino index 9f0d3cc60..fd7f4acbd 100644 --- a/tasmota/xdrv_84_esp32_core2.ino +++ b/tasmota/xdrv_84_esp32_core2.ino @@ -17,15 +17,28 @@ along with this program. If not, see . */ -/* remaining work: - -i2s microphone as loudness sensor -rtc better sync - -*/ - #ifdef ESP32 #ifdef USE_M5STACK_CORE2 +/*********************************************************************************************\ + * M5Stack Core2 support + * + * Module 7 + * Template {"NAME":"M5Core2","GPIO":[1,1,1,1,6720,6368,0,0,0,1,1,6400,0,0,736,1,0,0,0,704,0,1,1,1,0,0,0,0,640,608,1,1,1,0,672,0],"FLAG":0,"BASE":7} + * + * Initial commands: + * - DisplayType 2 + * - DisplayCols 27 + * - (optional) DisplayMode 2 + * - Power on + * - Voltres 3 + * - Ampres 1 + * + * Todo: + * - i2s microphone as loudness sensor + * - rtc better sync +\*********************************************************************************************/ + +#define XDRV_84 84 #include #include @@ -36,8 +49,6 @@ rtc better sync #include #include -#define XDRV_84 84 - struct CORE2_globs { AXP192 Axp; BM8563_RTC Rtc; @@ -57,116 +68,9 @@ struct CORE2_ADC { float temp; } core2_adc; -// cause SC card is needed by scripter -void CORE2_Module_Init(void) { +/*********************************************************************************************/ - // m5stack uses pin 38 not selectable in tasmota - SPI.setFrequency(40000000); - SPI.begin(18, 38, 23, -1); - // establish power chip on wire1 SDA 21, SCL 22 - core2_globs.Axp.begin(); - I2cSetActiveFound(AXP_ADDR, "AXP192"); - - core2_globs.Axp.SetAdcState(true); - // motor voltage - core2_globs.Axp.SetLDOVoltage(3,2000); - - core2_globs.Rtc.begin(); - I2cSetActiveFound(RTC_ADRESS, "RTC"); - - core2_globs.ready = true; -} - - -void CORE2_Init(void) { - - if (Rtc.utc_time < START_VALID_TIME) { - // set rtc from chip - Rtc.utc_time = Get_utc(); - - TIME_T tmpTime; - TasmotaGlobal.ntp_force_sync = true; //force to sync with ntp - BreakTime(Rtc.utc_time, tmpTime); - Rtc.daylight_saving_time = RuleToTime(Settings.tflag[1], RtcTime.year); - Rtc.standard_time = RuleToTime(Settings.tflag[0], RtcTime.year); - AddLog(LOG_LEVEL_INFO, PSTR("Set time from BM8563 to RTC (" D_UTC_TIME ") %s, (" D_DST_TIME ") %s, (" D_STD_TIME ") %s"), - GetDateAndTime(DT_UTC).c_str(), GetDateAndTime(DT_DST).c_str(), GetDateAndTime(DT_STD).c_str()); - if (Rtc.local_time < START_VALID_TIME) { // 2016-01-01 - TasmotaGlobal.rules_flag.time_init = 1; - } else { - TasmotaGlobal.rules_flag.time_set = 1; - } - - } - -} - -void CORE2_audio_power(bool power) { - core2_globs.Axp.SetSpkEnable(power); -} - -#ifdef USE_WEBSERVER -const char HTTP_CORE2[] PROGMEM = - "{s}VBUS Voltage" "{m}%s V" "{e}" - "{s}VBUS Current" "{m}%s mA" "{e}" - "{s}BATT Voltage" "{m}%s V" "{e}" - "{s}BATT Current" "{m}%s mA" "{e}" - "{s}Chip Temperature" "{m}%s C" "{e}"; -#endif // USE_WEBSERVER - - -void CORE2_loop(uint32_t flg) { - -} - -void CORE2_WebShow(uint32_t json) { - - char vstring[32]; - char bvstring[32]; - char cstring[32]; - char bcstring[32]; - char tstring[32]; - dtostrfd(core2_adc.vbus_v, 3, vstring); - dtostrfd(core2_adc.batt_v, 3, bvstring); - dtostrfd(core2_adc.vbus_c, 1, cstring); - dtostrfd(core2_adc.batt_c, 1, bcstring); - dtostrfd(core2_adc.temp, 2, tstring); - - if (json) { - ResponseAppend_P(PSTR(",\"CORE2\":{\"VBV\":%s,\"BV\":%s,\"VBC\":%s,\"BC\":%s,\"CT\":%s}"), vstring, cstring, bvstring, bcstring, tstring); - } else { - WSContentSend_PD(HTTP_CORE2, vstring, cstring, bvstring, bcstring, tstring); - } -} - -const char CORE2_Commands[] PROGMEM = "CORE2|" - "SHUTDOWN"; - -void (* const CORE2_Command[])(void) PROGMEM = { - &CORE2_Shutdown}; - - -void CORE2_Shutdown(void) { - char *mp = strchr(XdrvMailbox.data, ':'); - if (mp) { - core2_globs.wakeup_hour = atoi(XdrvMailbox.data); - core2_globs.wakeup_minute = atoi(mp+1); - core2_globs.shutdownseconds = -1; - core2_globs.shutdowndelay = 10; - char tbuff[16]; - sprintf(tbuff,"%02.2d:%02.2d", core2_globs.wakeup_hour, core2_globs.wakeup_minute ); - ResponseCmndChar(tbuff); - } else { - if (XdrvMailbox.payload >= 30) { - core2_globs.shutdownseconds = XdrvMailbox.payload; - core2_globs.shutdowndelay = 10; - } - ResponseCmndNumber(XdrvMailbox.payload); - } - -} - -void CORE2_DoShutdown(void) { +void Core2DoShutdown(void) { SettingsSaveAll(); RtcSettingsSave(); core2_globs.Rtc.clearIRQ(); @@ -182,11 +86,75 @@ void CORE2_DoShutdown(void) { core2_globs.Axp.PowerOff(); } +void Core2GetADC(void) { + core2_adc.vbus_v = core2_globs.Axp.GetVBusVoltage(); + core2_adc.batt_v = core2_globs.Axp.GetBatVoltage(); + core2_adc.vbus_c = core2_globs.Axp.GetVinCurrent(); + core2_adc.batt_c = core2_globs.Axp.GetBatCurrent(); + + core2_adc.temp = ConvertTemp(core2_globs.Axp.GetTempInAXP192()); +} + +void Core2GetRtc(void) { + RTC_TimeTypeDef RTCtime; + core2_globs.Rtc.GetTime(&RTCtime); + RtcTime.hour = RTCtime.Hours; + RtcTime.minute = RTCtime.Minutes; + RtcTime.second = RTCtime.Seconds; + + RTC_DateTypeDef RTCdate; + core2_globs.Rtc.GetDate(&RTCdate); + RtcTime.day_of_week = RTCdate.WeekDay; + RtcTime.month = RTCdate.Month; + RtcTime.day_of_month = RTCdate.Date; + RtcTime.year = RTCdate.Year; + + AddLog(LOG_LEVEL_INFO, PSTR("CR2: Set RTC %04d-%02d-%02dT%02d:%02d:%02d"), + RTCdate.Year, RTCdate.Month, RTCdate.Date, RTCtime.Hours, RTCtime.Minutes, RTCtime.Seconds); +} + +void Core2SetUtc(uint32_t epoch_time) { + TIME_T tm; + BreakTime(epoch_time, tm); + RTC_TimeTypeDef RTCtime; + RTCtime.Hours = tm.hour; + RTCtime.Minutes = tm.minute; + RTCtime.Seconds = tm.second; + core2_globs.Rtc.SetTime(&RTCtime); + RTC_DateTypeDef RTCdate; + RTCdate.WeekDay = tm.day_of_week; + RTCdate.Month = tm.month; + RTCdate.Date = tm.day_of_month; + RTCdate.Year = tm.year + 1970; + core2_globs.Rtc.SetDate(&RTCdate); +} + +uint32_t Core2GetUtc(void) { + RTC_TimeTypeDef RTCtime; + // 1. read has errors ??? + core2_globs.Rtc.GetTime(&RTCtime); + core2_globs.Rtc.GetTime(&RTCtime); + RTC_DateTypeDef RTCdate; + core2_globs.Rtc.GetDate(&RTCdate); + TIME_T tm; + tm.second = RTCtime.Seconds; + tm.minute = RTCtime.Minutes; + tm.hour = RTCtime.Hours; + tm.day_of_week = RTCdate.WeekDay; + tm.day_of_month = RTCdate.Date; + tm.month = RTCdate.Month; + tm.year = RTCdate.Year - 1970; + return MakeTime(tm); +} + +/*********************************************************************************************\ + * Called from xdrv_10_scripter.ino +\*********************************************************************************************/ + extern uint8_t tbstate[3]; - // c2ps(a b) -float core2_setaxppin(uint32_t sel, uint32_t val) { +float Core2SetAxpPin(uint32_t sel, uint32_t val) { switch (sel) { case 0: core2_globs.Axp.SetLed(val); @@ -215,91 +183,91 @@ float core2_setaxppin(uint32_t sel, uint32_t val) { } break; default: - GetRtc(); + Core2GetRtc(); break; } return 0; } -void core2_disp_pwr(uint8_t on) { +/*********************************************************************************************\ + * Called from xdrv_42_i2s_audio.ino +\*********************************************************************************************/ + +void Core2AudioPower(bool power) { + core2_globs.Axp.SetSpkEnable(power); +} + +/*********************************************************************************************\ + * Called from xdsp_04_ili9341.ino and xdsp_17_universal.ino +\*********************************************************************************************/ + +void Core2DisplayPower(uint8_t on) { core2_globs.Axp.SetDCDC3(on); } // display dimmer ranges from 0-15 // very little effect -void core2_disp_dim(uint8_t dim) { -uint16_t voltage = 2200; +void Core2DisplayDim(uint8_t dim) { + uint16_t voltage = 2200; voltage += ((uint32_t)dim*1200)/15; core2_globs.Axp.SetLcdVoltage(voltage); - // core2_globs.Axp.ScreenBreath(dim); +} + +/*********************************************************************************************/ + +// cause SC card is needed by scripter +void Core2ModuleInit(void) { + // m5stack uses pin 38 not selectable in tasmota + SPI.setFrequency(40000000); + SPI.begin(18, 38, 23, -1); + // establish power chip on wire1 SDA 21, SCL 22 + core2_globs.Axp.begin(); + I2cSetActiveFound(AXP_ADDR, "AXP192"); + + core2_globs.Axp.SetAdcState(true); + // motor voltage + core2_globs.Axp.SetLDOVoltage(3,2000); + + core2_globs.Rtc.begin(); + I2cSetActiveFound(RTC_ADRESS, "RTC"); + + core2_globs.ready = true; +} + +void Core2Init(void) { + if (Rtc.utc_time < START_VALID_TIME) { + // set rtc from chip + Rtc.utc_time = Core2GetUtc(); + + TIME_T tmpTime; + TasmotaGlobal.ntp_force_sync = true; // Force to sync with ntp + BreakTime(Rtc.utc_time, tmpTime); + Rtc.daylight_saving_time = RuleToTime(Settings.tflag[1], RtcTime.year); + Rtc.standard_time = RuleToTime(Settings.tflag[0], RtcTime.year); + AddLog(LOG_LEVEL_INFO, PSTR("CR2: Set time from BM8563 to RTC (" D_UTC_TIME ") %s, (" D_DST_TIME ") %s, (" D_STD_TIME ") %s"), + GetDateAndTime(DT_UTC).c_str(), GetDateAndTime(DT_DST).c_str(), GetDateAndTime(DT_STD).c_str()); + if (Rtc.local_time < START_VALID_TIME) { // 2016-01-01 + TasmotaGlobal.rules_flag.time_init = 1; + } else { + TasmotaGlobal.rules_flag.time_set = 1; + } + } +} + +void Core2Loop(uint32_t flg) { } - -void GetRtc(void) { - RTC_TimeTypeDef RTCtime; - core2_globs.Rtc.GetTime(&RTCtime); - RtcTime.hour = RTCtime.Hours; - RtcTime.minute = RTCtime.Minutes; - RtcTime.second = RTCtime.Seconds; - - - RTC_DateTypeDef RTCdate; - core2_globs.Rtc.GetDate(&RTCdate); - RtcTime.day_of_week = RTCdate.WeekDay; - RtcTime.month = RTCdate.Month; - RtcTime.day_of_month = RTCdate.Date; - RtcTime.year = RTCdate.Year; - - AddLog(LOG_LEVEL_INFO, PSTR("RTC: %02d:%02d:%02d"), RTCtime.Hours, RTCtime.Minutes, RTCtime.Seconds); - AddLog(LOG_LEVEL_INFO, PSTR("RTC: %02d.%02d.%04d"), RTCdate.Date, RTCdate.Month, RTCdate.Year); - -} - -void Set_utc(uint32_t epoch_time) { -TIME_T tm; - BreakTime(epoch_time, tm); - RTC_TimeTypeDef RTCtime; - RTCtime.Hours = tm.hour; - RTCtime.Minutes = tm.minute; - RTCtime.Seconds = tm.second; - core2_globs.Rtc.SetTime(&RTCtime); - RTC_DateTypeDef RTCdate; - RTCdate.WeekDay = tm.day_of_week; - RTCdate.Month = tm.month; - RTCdate.Date = tm.day_of_month; - RTCdate.Year = tm.year + 1970; - core2_globs.Rtc.SetDate(&RTCdate); -} - -uint32_t Get_utc(void) { - RTC_TimeTypeDef RTCtime; - // 1. read has errors ??? - core2_globs.Rtc.GetTime(&RTCtime); - core2_globs.Rtc.GetTime(&RTCtime); - RTC_DateTypeDef RTCdate; - core2_globs.Rtc.GetDate(&RTCdate); - TIME_T tm; - tm.second = RTCtime.Seconds; - tm.minute = RTCtime.Minutes; - tm.hour = RTCtime.Hours; - tm.day_of_week = RTCdate.WeekDay; - tm.day_of_month = RTCdate.Date; - tm.month = RTCdate.Month; - tm.year =RTCdate.Year - 1970; - return MakeTime(tm); -} - -void CORE2_EverySecond(void) { +void Core2EverySecond(void) { if (core2_globs.ready) { - CORE2_GetADC(); + Core2GetADC(); - if (Rtc.utc_time > START_VALID_TIME && core2_globs.tset==false && abs(Rtc.utc_time - Get_utc()) > 3) { - Set_utc(Rtc.utc_time); - AddLog(LOG_LEVEL_INFO, PSTR("Write Time TO BM8563 from NTP (" D_UTC_TIME ") %s, (" D_DST_TIME ") %s, (" D_STD_TIME ") %s"), + if (Rtc.utc_time > START_VALID_TIME && core2_globs.tset==false && abs(Rtc.utc_time - Core2GetUtc()) > 3) { + Core2SetUtc(Rtc.utc_time); + AddLog(LOG_LEVEL_INFO, PSTR("CR2: Write Time TO BM8563 from NTP (" D_UTC_TIME ") %s, (" D_DST_TIME ") %s, (" D_STD_TIME ") %s"), GetDateAndTime(DT_UTC).c_str(), GetDateAndTime(DT_DST).c_str(), GetDateAndTime(DT_STD).c_str()); core2_globs.tset = true; } @@ -307,19 +275,56 @@ void CORE2_EverySecond(void) { if (core2_globs.shutdowndelay) { core2_globs.shutdowndelay--; if (!core2_globs.shutdowndelay) { - CORE2_DoShutdown(); + Core2DoShutdown(); } } } } -void CORE2_GetADC(void) { - core2_adc.vbus_v = core2_globs.Axp.GetVBusVoltage(); - core2_adc.batt_v = core2_globs.Axp.GetBatVoltage(); - core2_adc.vbus_c = core2_globs.Axp.GetVinCurrent(); - core2_adc.batt_c = core2_globs.Axp.GetBatCurrent(); +void Core2Show(uint32_t json) { + if (json) { + ResponseAppend_P(PSTR(",\"Core2\":{\"VBV\":%*_f,\"VBC\":%*_f,\"BV\":%*_f,\"BC\":%*_f,\"" D_JSON_TEMPERATURE "\":%*_f}"), + Settings.flag2.voltage_resolution, &core2_adc.vbus_v, + Settings.flag2.current_resolution, &core2_adc.vbus_c, + Settings.flag2.voltage_resolution, &core2_adc.batt_v, + Settings.flag2.current_resolution, &core2_adc.batt_c, + Settings.flag2.temperature_resolution, &core2_adc.temp); + } else { + WSContentSend_Voltage("VBus", core2_adc.vbus_v); + WSContentSend_CurrentMA("VBus", core2_adc.vbus_c); + WSContentSend_Voltage("Batt", core2_adc.batt_v); + WSContentSend_CurrentMA("Batt", core2_adc.batt_c); + WSContentSend_Temp("Core2", core2_adc.temp); + } +} - core2_adc.temp = core2_globs.Axp.GetTempInAXP192(); +/*********************************************************************************************\ + * Commands +\*********************************************************************************************/ + +const char kCore2Commands[] PROGMEM = "Core2|" + "Shutdown"; + +void (* const Core2Command[])(void) PROGMEM = { + &CmndCore2Shutdown}; + +void CmndCore2Shutdown(void) { + char *mp = strchr(XdrvMailbox.data, ':'); + if (mp) { + core2_globs.wakeup_hour = atoi(XdrvMailbox.data); + core2_globs.wakeup_minute = atoi(mp+1); + core2_globs.shutdownseconds = -1; + core2_globs.shutdowndelay = 10; + char tbuff[16]; + sprintf(tbuff, "%02.2d" D_HOUR_MINUTE_SEPARATOR "%02.2d", core2_globs.wakeup_hour, core2_globs.wakeup_minute ); + ResponseCmndChar(tbuff); + } else { + if (XdrvMailbox.payload >= 30) { + core2_globs.shutdownseconds = XdrvMailbox.payload; + core2_globs.shutdowndelay = 10; + } + ResponseCmndNumber(XdrvMailbox.payload); + } } /*********************************************************************************************\ @@ -330,31 +335,29 @@ bool Xdrv84(uint8_t function) { bool result = false; switch (function) { - - case FUNC_WEB_SENSOR: -#ifdef USE_WEBSERVER - CORE2_WebShow(0); -#endif - break; - case FUNC_JSON_APPEND: - CORE2_WebShow(1); - break; - case FUNC_COMMAND: - result = DecodeCommand(CORE2_Commands, CORE2_Command); - break; - case FUNC_MODULE_INIT: - CORE2_Module_Init(); - break; - case FUNC_INIT: - CORE2_Init(); + case FUNC_LOOP: + Core2Loop(1); break; case FUNC_EVERY_SECOND: - CORE2_EverySecond(); + Core2EverySecond(); break; - case FUNC_LOOP: - CORE2_loop(1); + case FUNC_JSON_APPEND: + Core2Show(1); + break; +#ifdef USE_WEBSERVER + case FUNC_WEB_SENSOR: + Core2Show(0); + break; +#endif + case FUNC_COMMAND: + result = DecodeCommand(kCore2Commands, Core2Command); + break; + case FUNC_INIT: + Core2Init(); + break; + case FUNC_MODULE_INIT: + Core2ModuleInit(); break; - } return result; } diff --git a/tasmota/xdsp_04_ili9341.ino b/tasmota/xdsp_04_ili9341.ino index 60b2dd646..b38a18eee 100644 --- a/tasmota/xdsp_04_ili9341.ino +++ b/tasmota/xdsp_04_ili9341.ino @@ -136,18 +136,18 @@ void ILI9341_InitDriver() } -void core2_disp_pwr(uint8_t on); -void core2_disp_dim(uint8_t dim); +void Core2DisplayPower(uint8_t on); +void Core2DisplayDim(uint8_t dim); void ili9342_bpwr(uint8_t on) { #ifdef USE_M5STACK_CORE2 - core2_disp_pwr(on); + Core2DisplayPower(on); #endif } void ili9342_dimm(uint8_t dim) { #ifdef USE_M5STACK_CORE2 - core2_disp_dim(dim); + Core2DisplayDim(dim); #endif } diff --git a/tasmota/xdsp_17_universal.ino b/tasmota/xdsp_17_universal.ino index 9ae3eeeb4..419a94d12 100644 --- a/tasmota/xdsp_17_universal.ino +++ b/tasmota/xdsp_17_universal.ino @@ -260,18 +260,18 @@ char *fbuff; /*********************************************************************************************/ -void core2_disp_pwr(uint8_t on); -void core2_disp_dim(uint8_t dim); +void Core2DisplayPower(uint8_t on); +void Core2DisplayDim(uint8_t dim); void udisp_bpwr(uint8_t on) { #ifdef USE_M5STACK_CORE2 - core2_disp_pwr(on); + Core2DisplayPower(on); #endif } void udisp_dimm(uint8_t dim) { #ifdef USE_M5STACK_CORE2 - core2_disp_dim(dim); + Core2DisplayDim(dim); #endif } 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); } 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 000000000..08781f13a Binary files /dev/null and b/tools/Esptool/Odroid_go_and_core2/partitions_spiffs_10M.bin differ