mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
Merge branch 'development' into pre-release-9.4.0
This commit is contained in:
commit
c88152c14e
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
29
boards/esp32c3.json
Normal file
29
boards/esp32c3.json
Normal file
@ -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"
|
||||
}
|
6
esp32_partition_app1856k_spiffs320k.csv
Normal file
6
esp32_partition_app1856k_spiffs320k.csv
Normal file
@ -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,
|
|
6
esp32_partition_app2944k_spiffs10M.csv
Normal file
6
esp32_partition_app2944k_spiffs10M.csv
Normal file
@ -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,
|
|
@ -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
|
||||
|
@ -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}
|
||||
|
@ -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
|
||||
|
||||
|
@ -814,7 +814,9 @@ const float kSpeedConversionFactor[] = {1, // none
|
||||
// xdrv_02_webserver.ino
|
||||
#ifdef USE_WEBSERVER
|
||||
// {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
|
||||
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}";
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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 "Потвърдете рестартирането"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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 "Επιβεβαίωση επανεκκίνησης"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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 "אישור הפעלה מחדש"
|
||||
|
||||
|
@ -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?"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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 "재시작"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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 "Подтвердить перезагрузку"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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 "Підтвердити перезавантаження"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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 "确认重启"
|
||||
|
||||
|
@ -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 "確認重新啟動"
|
||||
|
||||
|
@ -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 };
|
||||
|
||||
|
@ -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
|
||||
|
@ -361,16 +361,19 @@ const char HTTP_DEVICE_STATE[] PROGMEM = "<td style='width:%d%%;text-align:cente
|
||||
|
||||
enum ButtonTitle {
|
||||
BUTTON_RESTART, BUTTON_RESET_CONFIGURATION,
|
||||
BUTTON_MAIN, BUTTON_CONFIGURATION, BUTTON_INFORMATION, BUTTON_FIRMWARE_UPGRADE, BUTTON_CONSOLE,
|
||||
BUTTON_MODULE, BUTTON_WIFI, BUTTON_LOGGING, BUTTON_OTHER, BUTTON_TEMPLATE, BUTTON_BACKUP, BUTTON_RESTORE };
|
||||
BUTTON_MAIN, BUTTON_CONFIGURATION, BUTTON_INFORMATION, BUTTON_FIRMWARE_UPGRADE, BUTTON_MANAGEMENT,
|
||||
BUTTON_MODULE, BUTTON_WIFI, BUTTON_LOGGING, BUTTON_OTHER, BUTTON_TEMPLATE, BUTTON_BACKUP, BUTTON_RESTORE,
|
||||
BUTTON_CONSOLE };
|
||||
const char kButtonTitle[] PROGMEM =
|
||||
D_RESTART "|" D_RESET_CONFIGURATION "|"
|
||||
D_MAIN_MENU "|" D_CONFIGURATION "|" D_INFORMATION "|" D_FIRMWARE_UPGRADE "|" D_CONSOLE "|"
|
||||
D_CONFIGURE_MODULE "|" D_CONFIGURE_WIFI"|" D_CONFIGURE_LOGGING "|" D_CONFIGURE_OTHER "|" D_CONFIGURE_TEMPLATE "|" D_BACKUP_CONFIGURATION "|" D_RESTORE_CONFIGURATION;
|
||||
D_MAIN_MENU "|" D_CONFIGURATION "|" D_INFORMATION "|" D_FIRMWARE_UPGRADE "|" D_MANAGEMENT "|"
|
||||
D_CONFIGURE_MODULE "|" D_CONFIGURE_WIFI"|" D_CONFIGURE_LOGGING "|" D_CONFIGURE_OTHER "|" D_CONFIGURE_TEMPLATE "|" D_BACKUP_CONFIGURATION "|" D_RESTORE_CONFIGURATION "|"
|
||||
D_CONSOLE;
|
||||
const char kButtonAction[] PROGMEM =
|
||||
".|rt|"
|
||||
".|cn|in|up|cs|"
|
||||
"md|wi|lg|co|tp|dl|rs";
|
||||
".|cn|in|up|mn|"
|
||||
"md|wi|lg|co|tp|dl|rs|"
|
||||
"cs";
|
||||
const char kButtonConfirm[] PROGMEM = D_CONFIRM_RESTART "|" D_CONFIRM_RESET_CONFIGURATION;
|
||||
|
||||
enum CTypes { CT_HTML, CT_PLAIN, CT_XML, CT_STREAM, CT_APP_JSON, CT_APP_STREAM };
|
||||
@ -452,6 +455,7 @@ const WebServerDispatch_t WebServerDispatch[] PROGMEM = {
|
||||
{ "u1", HTTP_ANY, HandleUpgradeFirmwareStart }, // OTA
|
||||
{ "u2", HTTP_OPTIONS, HandlePreflightRequest },
|
||||
{ "u3", HTTP_ANY, HandleUploadDone },
|
||||
{ "mn", HTTP_GET, HandleManagement },
|
||||
{ "cs", HTTP_GET, HandleConsole },
|
||||
{ "cs", HTTP_OPTIONS, HandlePreflightRequest },
|
||||
{ "cm", HTTP_ANY, HandleHttpCommand },
|
||||
@ -840,6 +844,14 @@ void WSContentSend_Temp(const char *types, float f_temperature) {
|
||||
WSContentSend_PD(HTTP_SNS_F_TEMP, types, Settings.flag2.temperature_resolution, &f_temperature, TempUnit());
|
||||
}
|
||||
|
||||
void WSContentSend_Voltage(const char *types, float f_voltage) {
|
||||
WSContentSend_PD(HTTP_SNS_F_VOLTAGE, types, Settings.flag2.voltage_resolution, &f_voltage);
|
||||
}
|
||||
|
||||
void WSContentSend_CurrentMA(const char *types, float f_current) {
|
||||
WSContentSend_PD(HTTP_SNS_F_CURRENT_MA, types, Settings.flag2.current_resolution, &f_current);
|
||||
}
|
||||
|
||||
void WSContentSend_THD(const char *types, float f_temperature, float f_humidity)
|
||||
{
|
||||
WSContentSend_Temp(types, f_temperature);
|
||||
@ -944,6 +956,19 @@ void HandleWifiLogin(void)
|
||||
WSContentStop();
|
||||
}
|
||||
|
||||
uint32_t WebUseManagementSubmenu(void) {
|
||||
static uint32_t management_count = 0;
|
||||
|
||||
if (!management_count) {
|
||||
XdrvMailbox.index = 1;
|
||||
XdrvCall(FUNC_WEB_ADD_CONSOLE_BUTTON);
|
||||
XsnsCall(FUNC_WEB_ADD_CONSOLE_BUTTON);
|
||||
XdrvCall(FUNC_WEB_ADD_MANAGEMENT_BUTTON);
|
||||
management_count = XdrvMailbox.index;
|
||||
}
|
||||
return management_count -1;
|
||||
}
|
||||
|
||||
uint32_t WebDeviceColumns(void) {
|
||||
const uint32_t max_columns = 8;
|
||||
|
||||
@ -1177,12 +1202,17 @@ void HandleRoot(void)
|
||||
if (HTTP_ADMIN == Web.state) {
|
||||
#ifdef FIRMWARE_MINIMAL
|
||||
WSContentSpaceButton(BUTTON_FIRMWARE_UPGRADE);
|
||||
WSContentButton(BUTTON_CONSOLE);
|
||||
#else
|
||||
WSContentSpaceButton(BUTTON_CONFIGURATION);
|
||||
WSContentButton(BUTTON_INFORMATION);
|
||||
WSContentButton(BUTTON_FIRMWARE_UPGRADE);
|
||||
if (!WebUseManagementSubmenu()) {
|
||||
WSContentButton(BUTTON_CONSOLE);
|
||||
} else {
|
||||
WSContentButton(BUTTON_MANAGEMENT);
|
||||
}
|
||||
#endif // Not FIRMWARE_MINIMAL
|
||||
WSContentButton(BUTTON_CONSOLE);
|
||||
WSContentButton(BUTTON_RESTART);
|
||||
}
|
||||
WSContentStop();
|
||||
@ -1404,9 +1434,6 @@ void HandleConfiguration(void)
|
||||
WSContentButton(BUTTON_BACKUP);
|
||||
WSContentButton(BUTTON_RESTORE);
|
||||
|
||||
WSContentSend_P(PSTR("<div></div>")); // 5px padding
|
||||
XdrvCall(FUNC_WEB_ADD_MANAGEMENT_BUTTON);
|
||||
|
||||
WSContentSpaceButton(BUTTON_MAIN);
|
||||
WSContentStop();
|
||||
}
|
||||
@ -2880,6 +2907,28 @@ void HandleHttpCommand(void)
|
||||
|
||||
/*-------------------------------------------------------------------------------------------*/
|
||||
|
||||
void HandleManagement(void)
|
||||
{
|
||||
if (!HttpCheckPriviledgedAccess()) { return; }
|
||||
|
||||
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_HTTP D_MANAGEMENT));
|
||||
|
||||
WSContentStart_P(PSTR(D_MANAGEMENT));
|
||||
WSContentSendStyle();
|
||||
|
||||
WSContentButton(BUTTON_CONSOLE);
|
||||
|
||||
XdrvMailbox.index = 0;
|
||||
XdrvCall(FUNC_WEB_ADD_CONSOLE_BUTTON);
|
||||
XsnsCall(FUNC_WEB_ADD_CONSOLE_BUTTON);
|
||||
|
||||
WSContentSend_P(PSTR("<div></div>")); // 5px padding
|
||||
XdrvCall(FUNC_WEB_ADD_MANAGEMENT_BUTTON);
|
||||
|
||||
WSContentSpaceButton(BUTTON_MAIN);
|
||||
WSContentStop();
|
||||
}
|
||||
|
||||
void HandleConsole(void)
|
||||
{
|
||||
if (!HttpCheckPriviledgedAccess()) { return; }
|
||||
@ -2895,7 +2944,7 @@ void HandleConsole(void)
|
||||
WSContentSend_P(HTTP_SCRIPT_CONSOL, Settings.web_refresh);
|
||||
WSContentSendStyle();
|
||||
WSContentSend_P(HTTP_FORM_CMND);
|
||||
WSContentSpaceButton(BUTTON_MAIN);
|
||||
WSContentSpaceButton((WebUseManagementSubmenu()) ? BUTTON_MANAGEMENT : BUTTON_MAIN);
|
||||
WSContentStop();
|
||||
}
|
||||
|
||||
|
@ -1845,7 +1845,7 @@ chknext:
|
||||
while (*lp==' ') lp++;
|
||||
float fvar1;
|
||||
lp = GetNumericArgument(lp, OPER_EQU, &fvar1, gv);
|
||||
fvar = core2_setaxppin(fvar, fvar1);
|
||||
fvar = Core2SetAxpPin(fvar, fvar1);
|
||||
lp++;
|
||||
len=0;
|
||||
goto exit;
|
||||
@ -5249,7 +5249,7 @@ void HandleScriptConfiguration(void) {
|
||||
#endif //USE_SCRIPT_FATFS
|
||||
|
||||
WSContentSend_P(HTTP_SCRIPT_FORM_END);
|
||||
WSContentSpaceButton(BUTTON_CONFIGURATION);
|
||||
WSContentSpaceButton(BUTTON_MANAGEMENT);
|
||||
WSContentStop();
|
||||
}
|
||||
|
||||
@ -7897,8 +7897,12 @@ bool Xdrv10(uint8_t function)
|
||||
}
|
||||
break;
|
||||
#ifdef USE_WEBSERVER
|
||||
case FUNC_WEB_ADD_BUTTON:
|
||||
WSContentSend_P(HTTP_BTN_MENU_RULES);
|
||||
case FUNC_WEB_ADD_CONSOLE_BUTTON:
|
||||
if (XdrvMailbox.index) {
|
||||
XdrvMailbox.index++;
|
||||
} else {
|
||||
WSContentSend_P(HTTP_BTN_MENU_RULES);
|
||||
}
|
||||
break;
|
||||
#ifdef USE_SCRIPT_WEB_DISPLAY
|
||||
case FUNC_WEB_ADD_MAIN_BUTTON:
|
||||
|
@ -645,74 +645,60 @@ void KNX_CB_Action(message_t const &msg, void *arg)
|
||||
}
|
||||
}
|
||||
else if (chan->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
|
||||
|
@ -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
|
||||
|
@ -588,15 +588,15 @@ const char UFS_FORM_SDC_HREFedit[] PROGMEM =
|
||||
"<a href=ufse?file=%s/%s>📝</a>"; // 📝
|
||||
|
||||
const char HTTP_EDITOR_FORM_START[] PROGMEM =
|
||||
"<fieldset><legend><b> " D_EDIT_FILE " </b></legend>"
|
||||
"<form>"
|
||||
"<label for='name'>" D_FILE ":</label><input type='text' id='name' name='name' value='%s'><br><hr width='98%%'>"
|
||||
"<textarea id='content' name='content' rows='8' cols='80' style='font-size: 12pt'>";
|
||||
"<fieldset><legend><b> " D_EDIT_FILE " </b></legend>"
|
||||
"<form>"
|
||||
"<label for='name'>" D_FILE ":</label><input type='text' id='name' name='name' value='%s'><br><hr width='98%%'>"
|
||||
"<textarea id='content' name='content' rows='8' cols='80' style='font-size: 12pt'>";
|
||||
|
||||
const char HTTP_EDITOR_FORM_END[] PROGMEM =
|
||||
"</textarea>"
|
||||
"<button name='save' type='submit' formmethod='post' formenctype='multipart/form-data' formaction='/ufse' class='button bgrn'>" D_SAVE "</button>"
|
||||
"</form></fieldset>";
|
||||
"</textarea>"
|
||||
"<button name='save' type='submit' formmethod='post' formenctype='multipart/form-data' formaction='/ufse' class='button bgrn'>" D_SAVE "</button>"
|
||||
"</form></fieldset>";
|
||||
|
||||
#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:
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -17,15 +17,28 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* 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 <Esp.h>
|
||||
#include <sys/time.h>
|
||||
@ -36,8 +49,6 @@ rtc better sync
|
||||
#include <soc/rtc.h>
|
||||
#include <SPI.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
1
tools/Esptool/Odroid_go_and_core2/Core2_flash_10M.bat
Normal file
1
tools/Esptool/Odroid_go_and_core2/Core2_flash_10M.bat
Normal file
@ -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
|
1
tools/Esptool/Odroid_go_and_core2/Odroid_flash_10M.bat
Normal file
1
tools/Esptool/Odroid_go_and_core2/Odroid_flash_10M.bat
Normal file
@ -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
|
BIN
tools/Esptool/Odroid_go_and_core2/partitions_spiffs_10M.bin
Normal file
BIN
tools/Esptool/Odroid_go_and_core2/partitions_spiffs_10M.bin
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user