Merge branch 'development' into feature/analog-ph-sensor-support

This commit is contained in:
Theo Arends 2021-01-06 14:27:41 +01:00 committed by GitHub
commit d63c46fe38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
64 changed files with 900 additions and 907 deletions

View File

@ -3,7 +3,11 @@ All notable changes to this project will be documented in this file.
## [Unreleased] - Development
## [9.2.0.2]
## [9.2.0.3]
### Changed
- Force initial default state ``SetOption57 1`` to scan wifi network every 44 minutes for strongest signal (#10395)
## [9.2.0.2] 20210105
### Added
- Basic support for ESP32 Odroid Go 16MB binary tasmota32-odroidgo.bin (#8630)
- Command ``CTRange`` to specify the visible CT range the bulb is capable of (#10311)
@ -13,6 +17,7 @@ All notable changes to this project will be documented in this file.
- Command ``RuleTimer0`` to access all RuleTimers at once (#10352)
- SPI display driver SSD1331 Color oled by Jeroen Vermeulen (#10376)
- IRremoteESP8266 library from v2.7.13 to v2.7.14
- Rotary No Pullup GPIO selection ``Rotary A/B_n`` (#10407)
### Breaking Changed
- Replaced MFRC522 13.56MHz rfid card reader GPIO selection from ``SPI CS`` by ``RC522 CS``

View File

@ -56,7 +56,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
[Complete list](BUILDS.md) of available feature and sensors.
## Changelog v9.2.0.2
## Changelog v9.2.0.3
### Added
- Command ``CTRange`` to specify the visible CT range the bulb is capable of [#10311](https://github.com/arendst/Tasmota/issues/10311)
- Command ``RuleTimer0`` to access all RuleTimers at once [#10352](https://github.com/arendst/Tasmota/issues/10352)
@ -65,6 +65,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
- Command ``SetOption119 1`` to remove the device addr from json payload, can be used with zb_topic_fname where the addr is already known from the topic [#10355](https://github.com/arendst/Tasmota/issues/10355)
- Milliseconds to console output [#10152](https://github.com/arendst/Tasmota/issues/10152)
- Gpio ``Option_a1`` enabling PWM2 high impedance if powered off as used by Wyze bulbs [#10196](https://github.com/arendst/Tasmota/issues/10196)
- Rotary No Pullup GPIO selection ``Rotary A/B_n`` [#10407](https://github.com/arendst/Tasmota/issues/10407)
- BSSID and Signal Strength Indicator to GUI wifi scan result [#10253](https://github.com/arendst/Tasmota/issues/10253)
- Support for P9813 RGB Led MOSFET controller [#10104](https://github.com/arendst/Tasmota/issues/10104)
- Support for GPIO option selection
@ -90,7 +91,8 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
### Changed
- Logging from heap to stack freeing 700 bytes RAM
- Disabled ``USE_LIGHT`` light support for ZBBridge saving 17.6kB (#10374)
- Disabled ``USE_LIGHT`` light support for ZBBridge saving 17.6kB [#10374](https://github.com/arendst/Tasmota/issues/10374)
- Force initial default state ``SetOption57 1`` to scan wifi network every 44 minutes for strongest signal [#10395](https://github.com/arendst/Tasmota/issues/10395)
### Fixed
- Redesign syslog and mqttlog using log buffer [#10164](https://github.com/arendst/Tasmota/issues/10164)

View File

@ -1579,6 +1579,8 @@ void Adafruit_GFX_Button::initButtonUL(
strncpy(_label, label, 9);
}
void draw_picture(char *path, uint32_t xp, uint32_t yp, uint32_t xs, uint32_t ys, bool inverted);
/**************************************************************************/
/*!
@brief Draw the button on the screen
@ -1598,16 +1600,20 @@ void Adafruit_GFX_Button::drawButton(boolean inverted) {
text = _fillcolor;
}
uint8_t r = min(_w, _h) / 4; // Corner radius
_gfx->fillRoundRect(_x1, _y1, _w, _h, r, fill);
_gfx->drawRoundRect(_x1, _y1, _w, _h, r, outline);
_gfx->setCursor(_x1 + (_w/2) - (strlen(_label) * 3 * _textsize_x),
_y1 + (_h/2) - (4 * _textsize_y));
_gfx->setTextColor(text);
_gfx->setTextSize(_textsize_x, _textsize_y);
_gfx->print(_label);
if (_label[0]=='/') {
// picture path
draw_picture(_label, _x1, _y1, _w, _h, inverted);
_gfx->drawRect(_x1, _y1, _w, _h, text);
} else {
uint8_t r = min(_w, _h) / 4; // Corner radius
_gfx->fillRoundRect(_x1, _y1, _w, _h, r, fill);
_gfx->drawRoundRect(_x1, _y1, _w, _h, r, outline);
_gfx->setCursor(_x1 + (_w/2) - (strlen(_label) * 3 * _textsize_x), _y1 + (_h/2) - (4 * _textsize_y));
_gfx->setTextColor(text);
_gfx->setTextSize(_textsize_x, _textsize_y);
_gfx->print(_label);
}
}
/**************************************************************************/

View File

@ -545,6 +545,12 @@ void ILI9341_2::DisplayOnff(int8_t on) {
}
}
void ILI9341_2::invertDisplay(boolean i) {
ILI9341_2_CS_LOW
writecmd(i ? ILI9341_2_INVOFF : ILI9341_2_INVON);
ILI9341_2_CS_HIGH
}
void ili9342_dimm(uint8_t dim);
// dimmer 0-100

View File

@ -119,30 +119,6 @@ class ILI9341_2 : public Renderer {
ILI9341_2(int8_t cs, int8_t res, int8_t dc, int8_t bp);
void init(uint16_t width, uint16_t height);
/*
void begin(void);
void DisplayInit(int8_t p,int8_t size,int8_t rot,int8_t font);
void setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
void setScrollArea(uint16_t topFixedArea, uint16_t bottomFixedArea);
void scroll(uint16_t pixels);
void pushColor(uint16_t color);
void pushColors(uint16_t *data, uint8_t len, boolean first);
//void drawImage(const uint8_t* img, uint16_t x, uint16_t y, uint16_t w, uint16_t h);
void fillScreen(uint16_t color);
void drawPixel(int16_t x, int16_t y, uint16_t color);
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
void fillRect(int16_t x, int16_t y, int16_t w, int16_t h,uint16_t color);
void setRotation(uint8_t r);
void invertDisplay(boolean i);
uint16_t color565(uint8_t r, uint8_t g, uint8_t b);
void DisplayOnff(int8_t on);
void writecommand(uint8_t c);
void writedata(uint8_t d);
void write16BitColor(uint16_t color);
void commandList(uint8_t *addr);
void hw_spi_init();
void dim(uint8_t contrast);*/
uint16_t GetColorFromIndex(uint8_t index);
private:
@ -161,7 +137,7 @@ class ILI9341_2 : public Renderer {
void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
void dim(uint8_t dim);
void pushColors(uint16_t *data, uint8_t len, boolean first);
void invertDisplay(boolean i);
void spiwrite(uint8_t c);
void spiwrite16(uint16_t c);
void spiwrite32(uint32_t c);

View File

@ -503,6 +503,16 @@ void ILI9488::scroll(uint16_t pixels){
}*/
void ILI9488::setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) {
if (!x0 && !y0 && !x1 && !y1) {
x0=0;
y0=0;
x1=_width;
y1=_height;
}
setAddrWindow_int(x0, y0, x1-1, y1-1);
}
void ILI9488::setAddrWindow_int(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) {
uint8_t flag=0;
if (!x0 && !y0 && !x1 && !y1) {
@ -594,6 +604,7 @@ void ILI9488::pushColor(uint16_t color) {
ILI9488_STOP
}
#if 1
void ILI9488::pushColors(uint16_t *data, uint8_t len, boolean first) {
uint16_t color;
uint8_t buff[len*3+1];
@ -616,6 +627,17 @@ void ILI9488::pushColors(uint16_t *data, uint8_t len, boolean first) {
ILI9488_STOP
}
#else
void ILI9488::pushColors(uint16_t *data, uint8_t len, boolean first) {
uint16_t color;
while (len--) {
write16BitColor(*data++);
}
ILI9488_STOP
}
#endif
void ILI9488::write16BitColor(uint16_t color){
// #if (__STM32F1__)
@ -688,7 +710,7 @@ void ILI9488::drawPixel(int16_t x, int16_t y, uint16_t color) {
if((x < 0) ||(x >= _width) || (y < 0) || (y >= _height)) return;
setAddrWindow(x,y,x+1,y+1);
setAddrWindow_int(x,y,x+1,y+1);
write16BitColor(color);
ILI9488_STOP
}
@ -702,7 +724,7 @@ void ILI9488::drawFastVLine(int16_t x, int16_t y, int16_t h,
if((y+h-1) >= _height)
h = _height-y;
setAddrWindow(x, y, x, y+h-1);
setAddrWindow_int(x, y, x, y+h-1);
uint8_t r = (color & 0xF800) >> 11;
uint8_t g = (color & 0x07E0) >> 5;
@ -770,7 +792,7 @@ void ILI9488::drawFastHLine(int16_t x, int16_t y, int16_t w,
if((x >= _width) || (y >= _height)) return;
if((x+w-1) >= _width) w = _width-x;
setAddrWindow(x, y, x+w-1, y);
setAddrWindow_int(x, y, x+w-1, y);
uint8_t r = (color & 0xF800) >> 11;
uint8_t g = (color & 0x07E0) >> 5;
@ -905,7 +927,7 @@ void ILI9488::fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t colo
if((x + w - 1) >= _width) w = _width - x;
if((y + h - 1) >= _height) h = _height - y;
setAddrWindow(x, y, x+w-1, y+h-1);
setAddrWindow_int(x, y, x+w-1, y+h-1);
//ILI9488_START
uint8_t r = (color & 0xF800) >> 11;
@ -1050,7 +1072,7 @@ void ILI9488::fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t colo
if((x + w - 1) >= _width) w = _width - x;
if((y + h - 1) >= _height) h = _height - y;
setAddrWindow(x, y, x+w-1, y+h-1);
setAddrWindow_int(x, y, x+w-1, y+h-1);
uint8_t r = (color & 0xF800) >> 11;
uint8_t g = (color & 0x07E0) >> 5;

View File

@ -136,6 +136,7 @@ class ILI9488 : public Renderer {
void begin(void);
void DisplayInit(int8_t p,int8_t size,int8_t rot,int8_t font);
void setAddrWindow_int(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
void setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
void setScrollArea(uint16_t topFixedArea, uint16_t bottomFixedArea);
void scroll(uint16_t pixels);

View File

@ -32,6 +32,10 @@
//#define USE_GFX_FONTS
#define USE_TINY_FONT
#ifdef ESP32
#define USE_ICON_FONT
#endif
uint8_t wr_redir=0;
uint8_t *buffer;
@ -223,27 +227,32 @@ void Renderer::setTextFont(uint8_t f) {
break;
case 7:
selected_font = &RAFont;
break;
default:
font=0;
selected_font = &Font12;
break;
}
#else
#ifdef USE_EPD_FONTS
if (1 == font) {
switch (font) {
selected_font = &Font12;
} else {
#ifdef USE_TINY_FONT
if (2 == font) {
selected_font = &Font24;
} else {
selected_font = &Font8;
}
#else
break;
case 2:
selected_font = &Font24;
#endif
break;
case 3:
#ifdef USE_TINY_FONT
selected_font = &Font8;
#else
selected_font = &Font24;
#endif
break;
default:
selected_font = &Font12;
break;
}
#endif
#endif
}
@ -513,6 +522,9 @@ void Renderer::setDrawMode(uint8_t mode) {
drawmode=mode;
}
void Renderer::invertDisplay(boolean i) {
}
void VButton::xdrawButton(bool inverted) {
wr_redir=1;
drawButton(inverted);
@ -520,4 +532,6 @@ void VButton::xdrawButton(bool inverted) {
}
/* END OF FILE */

View File

@ -35,6 +35,7 @@ public:
virtual void dim(uint8_t contrast);
virtual void pushColors(uint16_t *data, uint8_t len, boolean first);
virtual void setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
virtual void invertDisplay(boolean i);
void setDrawMode(uint8_t mode);
uint8_t drawmode;
virtual void FastString(uint16_t x,uint16_t y,uint16_t tcolor, const char* str);

View File

@ -3723,6 +3723,8 @@ void IMAPData::setFetchUID(const String &fetchUID)
std::string().swap(tmp);
}
extern FS *ufsp;
void IMAPData::setFileStorageType(uint8_t storageType)
{
_storageType = storageType;
@ -3736,6 +3738,9 @@ void IMAPData::setFileStorageType(uint8_t storageType)
case MailClientStorageType::FFat:
fsp = &FFat;
break;
case MailClientStorageType::Univ:
fsp = ufsp;
break;
}
}
@ -4766,6 +4771,9 @@ void SMTPData::setFileStorageType(uint8_t storageType)
case MailClientStorageType::FFat:
fsp = &FFat;
break;
case MailClientStorageType::Univ:
fsp = ufsp;
break;
}
}

View File

@ -92,6 +92,7 @@ struct MailClientStorageType
static const uint8_t SPIFFS = 0;
static const uint8_t SD = 1;
static const uint8_t FFat = 2;
static const uint8_t Univ = 3;
};
static const char ESP32_MAIL_STR_1[] PROGMEM = "Content-Type: multipart/mixed; boundary=\"";

View File

@ -134,6 +134,7 @@ lib_extra_dirs = ${library.lib_extra_dirs}
[core32_stage]
platform = espressif32 @ 2.1.0
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/arduino-esp32/releases/download/1.0.5-rc4/esp32-1.0.5-rc4.zip
platformio/tool-mklittlefs @ ~1.203.200522
build_unflags = ${esp32_defaults.build_unflags}
build_flags = ${esp32_defaults.build_flags}
;-DESP32_STAGE=true

View File

@ -90,5 +90,6 @@ build_flags = ${esp_defaults.build_flags}
[core32]
platform = espressif32 @ 2.1.0
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/arduino-esp32/releases/download/1.0.5-rc4/esp32-1.0.5-rc4.zip
platformio/tool-mklittlefs @ ~1.203.200522
build_unflags = ${esp32_defaults.build_unflags}
build_flags = ${esp32_defaults.build_flags}

View File

@ -40,8 +40,8 @@ lib_extra_dirs = lib/libesp32, lib/lib_basic
extends = env:tasmota32
board = odroid_esp32
board_build.f_cpu = 240000000L
board_build.partitions = esp32_partition_app1984k_ffat12M.csv
build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM=true -DFIRMWARE_ODROID_GO
board_build.partitions = esp32_partition_app1984k_spiffs12M.csv
build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -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
[env:tasmota32-minimal]

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Wysig skrif"
#define D_SCRIPT "wysig skrif"
#define D_SDCARD_UPLOAD "lêer oplaai"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Klaar"
#define D_SCRIPT_CHARS_LEFT "karakters oor"
#define D_SCRIPT_CHARS_NO_MORE "nie meer karakters nie"

View File

@ -864,7 +864,7 @@
#define D_CONFIGURE_SCRIPT "Редакция на скрипт"
#define D_SCRIPT "редактирай скрипт"
#define D_SDCARD_UPLOAD "изпрати файл"
#define D_SDCARD_DIR "директория на SD картата"
#define D_UFSDIR "директория на UFS картата"
#define D_UPL_DONE "Готово"
#define D_SCRIPT_CHARS_LEFT "оставащи символи"
#define D_SCRIPT_CHARS_NO_MORE "няма повече символи"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs card directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Skript konfigurieren"
#define D_SCRIPT "Skript bearbeiten"
#define D_SDCARD_UPLOAD "Datei speichern"
#define D_SDCARD_DIR "SD Card Verzeichnis"
#define D_UFSDIR "UFS Verzeichnis"
#define D_UPL_DONE "Fertig"
#define D_SCRIPT_CHARS_LEFT "Zeichen übrig"
#define D_SCRIPT_CHARS_NO_MORE "kein Speicher mehr"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Editar Script"
#define D_SCRIPT "Editar Script"
#define D_SDCARD_UPLOAD "Subir Archivo"
#define D_SDCARD_DIR "Directorio en Tarjeta SD"
#define D_UFSDIR "Directorio en Tarjeta UFS"
#define D_UPL_DONE "Listo"
#define D_SCRIPT_CHARS_LEFT "Caracteres disponibles"
#define D_SCRIPT_CHARS_NO_MORE "No hay mas espacio"

View File

@ -858,7 +858,7 @@
#define D_CONFIGURE_SCRIPT "Éditer le script"
#define D_SCRIPT "édition du script"
#define D_SDCARD_UPLOAD "Envoi du fichier"
#define D_SDCARD_DIR "Dossier carte SD"
#define D_UFSDIR "Dossier UFS"
#define D_UPL_DONE "Terminé"
#define D_SCRIPT_CHARS_LEFT "car. restant"
#define D_SCRIPT_CHARS_NO_MORE "plus de car."

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Modifica script"
#define D_SCRIPT "modifica script"
#define D_SDCARD_UPLOAD "upload file"
#define D_SDCARD_DIR "cartella scheda SD"
#define D_UFSDIR "cartella scheda UFS"
#define D_UPL_DONE "Completato"
#define D_SCRIPT_CHARS_LEFT "caratteri rimanenti"
#define D_SCRIPT_CHARS_NO_MORE "nessun altro carattere"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Configurare script"
#define D_SCRIPT "editează script"
#define D_SDCARD_UPLOAD "Încarcă fișier"
#define D_SDCARD_DIR "director sd card"
#define D_UFSDIR "director ufs"
#define D_UPL_DONE "Terminat"
#define D_SCRIPT_CHARS_LEFT "caractere rămase"
#define D_SCRIPT_CHARS_NO_MORE "caractere terminate"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Конфігурація сценарія"
#define D_SCRIPT "Редагування сценарія"
#define D_SDCARD_UPLOAD "завантажити файл на карту SD"
#define D_SDCARD_DIR "завантажити файл в каталог на карту SD"
#define D_UFSDIR "завантажити файл в каталог на карту UFS"
#define D_UPL_DONE "Готово"
#define D_SCRIPT_CHARS_LEFT "символів ще вільно"
#define D_SCRIPT_CHARS_NO_MORE "більше немає місця"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Chỉnh sửa kịch bản"
#define D_SCRIPT "chỉnh sửa kịch bản"
#define D_SDCARD_UPLOAD "tải lên tệp"
#define D_SDCARD_DIR "thư mục thẻ nhớ sd"
#define D_UFSDIR "thư mục thẻ nhớ ufs"
#define D_UPL_DONE "Hoàn thành"
#define D_SCRIPT_CHARS_LEFT "ký tự đã dùng"
#define D_SCRIPT_CHARS_NO_MORE "không còn ký tự trống"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "Edit script"
#define D_SCRIPT "edit script"
#define D_SDCARD_UPLOAD "file upload"
#define D_SDCARD_DIR "sd card directory"
#define D_UFSDIR "ufs directory"
#define D_UPL_DONE "Done"
#define D_SCRIPT_CHARS_LEFT "chars left"
#define D_SCRIPT_CHARS_NO_MORE "no more chars"

View File

@ -865,7 +865,7 @@
#define D_CONFIGURE_SCRIPT "編輯腳本"
#define D_SCRIPT "編輯腳本"
#define D_SDCARD_UPLOAD "上傳檔案"
#define D_SDCARD_DIR "記憶卡目錄"
#define D_UFSDIR "記憶卡目錄"
#define D_UPL_DONE "完成"
#define D_SCRIPT_CHARS_LEFT "剩餘字元"
#define D_SCRIPT_CHARS_NO_MORE "放不下更多字元了"

View File

@ -80,7 +80,7 @@
// The configuration can be changed after first setup using WifiConfig 0, 2, 4, 5, 6 and 7.
#define WIFI_ARP_INTERVAL 0 // [SetOption41] Send gratuitous ARP interval
#define WIFI_SCAN_AT_RESTART false // [SetOption56] Scan wifi network at restart for configured AP's
#define WIFI_SCAN_REGULARLY false // [SetOption57] Scan wifi network every 44 minutes for configured AP's
#define WIFI_SCAN_REGULARLY true // [SetOption57] Scan wifi network every 44 minutes for configured AP's
// -- Syslog --------------------------------------
#define SYS_LOG_HOST "" // [LogHost] (Linux) syslog host

View File

@ -389,7 +389,7 @@ void xsend_message_txt(char *msg) {
#ifdef DEBUG_EMAIL_PORT
AddLog_P(LOG_LEVEL_INFO, PSTR("%s"),msg);
#endif
#if defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
if (*msg=='@') {
msg++;
attach_File(msg);
@ -415,9 +415,9 @@ void xsend_message_txt(char *msg) {
#endif
}
#if defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
#include <LittleFS.h>
extern FS *fsp;
extern FS *ufsp;
void attach_File(char *path) {
g_client->print(F("--frontier\r\n"));
@ -425,7 +425,7 @@ void attach_File(char *path) {
char buff[64];
char *cp = path;
while (*cp=='/') cp++;
File file = fsp->open(path, "r");
File file = ufsp->open(path, "r");
if (file) {
sprintf_P(buff,PSTR("Content-Disposition: attachment; filename=\"%s\"\r\n\r\n"), cp);
g_client->write(buff);
@ -717,6 +717,8 @@ uint16_t SendMail(char *buffer) {
//Set the storage types to read the attach files (SD is default)
//smtpData.setFileStorageType(MailClientStorageType::SPIFFS);
/*
#ifdef USE_SCRIPT_FATFS
#if USE_SCRIPT_FATFS<0
smtpData.setFileStorageType(MailClientStorageType::FFat);
@ -724,6 +726,9 @@ uint16_t SendMail(char *buffer) {
smtpData.setFileStorageType(MailClientStorageType::SD);
#endif
#endif
*/
smtpData.setFileStorageType(MailClientStorageType::Univ);
//smtpData.setSendCallback(sendCallback);

View File

@ -51,31 +51,33 @@ void RtcSettingsSave(void)
}
}
bool RtcSettingsLoad(void) {
bool was_read_valid = true;
bool RtcSettingsLoad(uint32_t update) {
#ifdef ESP8266
ESP.rtcUserMemoryRead(100, (uint32_t*)&RtcSettings, sizeof(RtcSettings)); // 0x290
#endif // ESP8266
#ifdef ESP32
RtcSettings = RtcDataSettings;
#endif // ESP32
if (RtcSettings.valid != RTC_MEM_VALID) {
was_read_valid = false;
memset(&RtcSettings, 0, sizeof(RtcSettings));
RtcSettings.valid = RTC_MEM_VALID;
RtcSettings.energy_kWhtoday = Settings.energy_kWhtoday;
RtcSettings.energy_kWhtotal = Settings.energy_kWhtotal;
RtcSettings.energy_usage = Settings.energy_usage;
for (uint32_t i = 0; i < MAX_COUNTERS; i++) {
RtcSettings.pulse_counter[i] = Settings.pulse_counter[i];
bool read_valid = (RTC_MEM_VALID == RtcSettings.valid);
if (update) {
if (!read_valid) {
memset(&RtcSettings, 0, sizeof(RtcSettings));
RtcSettings.valid = RTC_MEM_VALID;
RtcSettings.energy_kWhtoday = Settings.energy_kWhtoday;
RtcSettings.energy_kWhtotal = Settings.energy_kWhtotal;
RtcSettings.energy_usage = Settings.energy_usage;
for (uint32_t i = 0; i < MAX_COUNTERS; i++) {
RtcSettings.pulse_counter[i] = Settings.pulse_counter[i];
}
RtcSettings.power = Settings.power;
// RtcSettings.baudrate = Settings.baudrate * 300;
RtcSettings.baudrate = APP_BAUDRATE;
RtcSettingsSave();
}
RtcSettings.power = Settings.power;
// RtcSettings.baudrate = Settings.baudrate * 300;
RtcSettings.baudrate = APP_BAUDRATE;
RtcSettingsSave();
rtc_settings_crc = GetRtcSettingsCrc();
}
rtc_settings_crc = GetRtcSettingsCrc();
return was_read_valid;
return read_valid;
}
bool RtcSettingsValid(void)
@ -571,7 +573,7 @@ void SettingsLoad(void) {
settings_crc32 = GetSettingsCrc32();
#endif // FIRMWARE_MINIMAL
RtcSettingsLoad();
RtcSettingsLoad(1);
}
// Used in TLS - returns the timestamp of the last Flash settings write
@ -1323,6 +1325,9 @@ void SettingsDelta(void)
if (Settings.version < 0x09010000) {
Settings.dimmer_step = DEFAULT_DIMMER_STEP;
}
if (Settings.version < 0x09020003) {
Settings.flag3.use_wifi_rescan = true; // As a result of #10395
}
Settings.version = VERSION;
SettingsSave(1);

View File

@ -86,6 +86,11 @@ uint32_t FlashWriteMaxSector(void) {
uint8_t* FlashDirectAccess(void) {
return (uint8_t*)(0x40200000 + (FlashWriteStartSector() * SPI_FLASH_SEC_SIZE));
}
void *special_malloc(uint32_t size) {
return malloc(size);
}
#endif
/*********************************************************************************************\
@ -414,4 +419,13 @@ uint8_t* FlashDirectAccess(void) {
return data;
}
#endif // ESP32
void *special_malloc(uint32_t size) {
if (psramFound()) {
return heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
} else {
return malloc(size);
}
}
#endif // ESP32

View File

@ -29,9 +29,27 @@ uint8_t red, grn, blu;
uint16_t b , g, r;
for (uint32_t cnt=0; cnt<len; cnt++) {
red = *in++;
grn = *in++;
blu = *in++;
grn = *in++;
red = *in++;
b = (blu >> 3) & 0x1f;
g = ((grn >> 2) & 0x3f) << 5;
r = ((red >> 3) & 0x1f) << 11;
*out++ = (r | g | b);
}
}
void rgb888_to_565i(uint8_t *in, uint16_t *out, uint32_t len) {
uint8_t red, grn, blu;
uint16_t b , g, r;
for (uint32_t cnt=0; cnt<len; cnt++) {
blu = 255-*in++;
grn = 255-*in++;
red = 255-*in++;
b = (blu >> 3) & 0x1f;
g = ((grn >> 2) & 0x3f) << 5;
r = ((red >> 3) & 0x1f) << 11;

View File

@ -55,6 +55,8 @@ const uint8_t rotary_offset = 128;
const int8_t rotary_state_pos[16] = { 0, 1, -1, 2, -1, 0, -2, 1, 1, -2, 0, -1, 2, -1, 1, 0 };
struct ROTARY {
uint8_t no_pullup_mask_a = 0; // Rotary A pull-up bitmask flags
uint8_t no_pullup_mask_b = 0; // Rotary B pull-up bitmask flags
uint8_t model;
bool present;
} Rotary;
@ -74,6 +76,14 @@ tEncoder Encoder[MAX_ROTARIES];
/********************************************************************************************/
void RotaryAPullupFlag(uint32 switch_bit) {
bitSet(Rotary.no_pullup_mask_a, switch_bit);
}
void RotaryBPullupFlag(uint32 switch_bit) {
bitSet(Rotary.no_pullup_mask_b, switch_bit);
}
bool RotaryButtonPressed(uint32_t button_index) {
if (!Rotary.present) { return false; }
@ -136,8 +146,8 @@ void RotaryInit(void) {
Encoder[index].position = rotary_offset;
Encoder[index].pina = Pin(GPIO_ROT1A, index);
Encoder[index].pinb = Pin(GPIO_ROT1B, index);
pinMode(Encoder[index].pina, INPUT_PULLUP);
pinMode(Encoder[index].pinb, INPUT_PULLUP);
pinMode(Encoder[index].pina, bitRead(Rotary.no_pullup_mask_a, index) ? INPUT : INPUT_PULLUP);
pinMode(Encoder[index].pinb, bitRead(Rotary.no_pullup_mask_b, index) ? INPUT : INPUT_PULLUP);
if (0 == Rotary.model) {
attachInterruptArg(Encoder[index].pina, RotaryIsrArgMiDesk, &Encoder[index], CHANGE);
attachInterruptArg(Encoder[index].pinb, RotaryIsrArgMiDesk, &Encoder[index], CHANGE);

View File

@ -400,15 +400,6 @@ void RtcSecond(void)
} else {
TasmotaGlobal.rules_flag.time_set = 1;
}
#ifdef ESP32
// Sync RTOS time to be used by SD Card time stamps
struct timeval tv;
tv.tv_sec = Rtc.local_time;
tv.tv_usec = 0;
settimeofday(&tv, nullptr);
#endif // ESP32
} else {
Rtc.utc_time++; // Increment every second
}
@ -463,6 +454,17 @@ void RtcSecond(void)
Rtc.midnight = Rtc.local_time;
Rtc.midnight_now = true;
}
#ifdef ESP32
if (mutex) { // Time is just synced and is valid
// Sync RTOS time to be used by SD Card time stamps
struct timeval tv;
tv.tv_sec = Rtc.local_time;
tv.tv_usec = 0;
settimeofday(&tv, nullptr);
}
#endif // ESP32
}
RtcTime.year += 1970;

View File

@ -1538,6 +1538,16 @@ void GpioInit(void)
bitSet(TasmotaGlobal.gpio_optiona.data, mpin - AGPIO(GPIO_OPTION_A));
mpin = GPIO_NONE;
}
#ifdef ROTARY_V1
else if ((mpin >= AGPIO(GPIO_ROT1A_NP)) && (mpin < (AGPIO(GPIO_ROT1A_NP) + MAX_ROTARIES))) {
RotaryAPullupFlag(mpin - AGPIO(GPIO_ROT1A_NP));
mpin -= (AGPIO(GPIO_ROT1A_NP) - AGPIO(GPIO_ROT1A));
}
else if ((mpin >= AGPIO(GPIO_ROT1B_NP)) && (mpin < (AGPIO(GPIO_ROT1B_NP) + MAX_ROTARIES))) {
RotaryBPullupFlag(mpin - AGPIO(GPIO_ROT1B_NP));
mpin -= (AGPIO(GPIO_ROT1B_NP) - AGPIO(GPIO_ROT1B));
}
#endif // ROTARY_V1
else if ((mpin >= AGPIO(GPIO_SWT1_NP)) && (mpin < (AGPIO(GPIO_SWT1_NP) + MAX_SWITCHES))) {
SwitchPullupFlag(mpin - AGPIO(GPIO_SWT1_NP));
mpin -= (AGPIO(GPIO_SWT1_NP) - AGPIO(GPIO_SWT1));

View File

@ -220,7 +220,7 @@ void setup(void) {
#endif
RtcRebootSave();
if (RtcSettingsLoad()) {
if (RtcSettingsLoad(0)) {
uint32_t baudrate = (RtcSettings.baudrate / 300) * 300; // Make it a valid baudrate
if (baudrate) { TasmotaGlobal.baudrate = baudrate; }
}

View File

@ -52,6 +52,8 @@
#define FALLBACK_MODULE ODROID_GO // [Module2] Select default module on fast reboot where USER_MODULE is user template
#define USE_ODROID_GO // Add support for Odroid Go
#define USE_UFILESYS
#define USE_SDCARD
#define USE_ADC
#define USE_SPI
#define USE_DISPLAY // Add SPI Display Support (+2k code)

View File

@ -143,6 +143,7 @@ enum UserSelectablePins {
GPIO_ST7789_CS, GPIO_ST7789_DC,
GPIO_SSD1331_CS, GPIO_SSD1331_DC,
GPIO_SDCARD_CS,
GPIO_ROT1A_NP, GPIO_ROT1B_NP, // Rotary switch
GPIO_ADC_PH, // Analog PH Sensor
GPIO_SENSOR_END };
@ -237,7 +238,7 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_CSE7766_TX "|" D_SENSOR_CSE7766_RX "|"
D_SENSOR_ARIRFRCV "|" D_SENSOR_ARIRFSEL "|"
D_SENSOR_TXD "|" D_SENSOR_RXD "|"
D_SENSOR_ROTARY "_a|" D_SENSOR_ROTARY "_b|"
D_SENSOR_ROTARY " A|" D_SENSOR_ROTARY " B|"
D_SENSOR_ADC_JOYSTICK "|"
D_SENSOR_MAX31865_CS "|"
D_SENSOR_HRE_CLOCK "|" D_SENSOR_HRE_DATA "|"
@ -294,7 +295,7 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_SHELLY_DIMMER_BOOT0 "|" D_SENSOR_SHELLY_DIMMER_RST_INV "|"
D_SENSOR_RC522_RST "|"
D_SENSOR_P9813_CLK "|" D_SENSOR_P9813_DAT "|"
D_SENSOR_OPTION "_a|"
D_SENSOR_OPTION " A|"
D_SENSOR_FTC532 "|"
D_SENSOR_RC522_CS "|"
D_SENSOR_NRF24_CS "|" D_SENSOR_NRF24_DC "|"
@ -307,6 +308,7 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_ST7789_CS "|" D_SENSOR_ST7789_DC "|"
D_SENSOR_SSD1331_CS "|" D_SENSOR_SSD1331_DC "|"
D_SENSOR_SDCARD_CS "|"
D_SENSOR_ROTARY " A_n|" D_SENSOR_ROTARY " B_n|"
D_SENSOR_ADC_PH "|"
;
@ -332,6 +334,8 @@ const uint16_t kGpioNiceList[] PROGMEM = {
#ifdef ROTARY_V1
AGPIO(GPIO_ROT1A) + MAX_ROTARIES, // Rotary A Pin
AGPIO(GPIO_ROT1B) + MAX_ROTARIES, // Rotary B Pin
AGPIO(GPIO_ROT1A_NP) + MAX_ROTARIES, // Rotary A Pin No Pullup
AGPIO(GPIO_ROT1B_NP) + MAX_ROTARIES, // Rotary B Pin No Pullup
#endif
AGPIO(GPIO_REL1) + MAX_RELAYS, // Relays
AGPIO(GPIO_REL1_INV) + MAX_RELAYS,
@ -2475,7 +2479,7 @@ const mytmplt kModules[] PROGMEM =
AGPIO(GPIO_SPI_MISO), // 19 IO GPIO19, VSPI_MISO
0, // 20
AGPIO(GPIO_ILI9341_DC), // 21 IO GPIO21, SPI_DC_LCD
0, // 22 IO LED GPIO22, VSPI_CS1_TFLASH
AGPIO(GPIO_SDCARD_CS), // 22 IO LED GPIO22, VSPI_CS1_TFLASH
AGPIO(GPIO_SPI_MOSI), // 23 IO GPIO23, VSPI_MOSI
0, // 24
0, // 25 IO GPIO25, DAC_1 (PAM8304A)

View File

@ -20,6 +20,6 @@
#ifndef _TASMOTA_VERSION_H_
#define _TASMOTA_VERSION_H_
const uint32_t VERSION = 0x09020002;
const uint32_t VERSION = 0x09020003;
#endif // _TASMOTA_VERSION_H_

View File

@ -1583,7 +1583,7 @@ void ModuleSaveSettings(void)
} else {
if (ValidGPIO(i, template_gp.io[i])) {
Settings.my_gp.io[i] = WebGetGpioArg(i);
gpios += F(", " D_GPIO ); gpios += String(i); gpios += F(" "); gpios += String(Settings.my_gp.io[i]);
gpios += F(", "); gpios += String(i); gpios += F(" "); gpios += String(Settings.my_gp.io[i]);
}
}
}

View File

@ -558,14 +558,16 @@ void EnergyCommandCalResponse(uint32_t nvalue)
void CmndEnergyReset(void)
{
if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= 3)) {
char *p;
unsigned long lnum = strtoul(XdrvMailbox.data, &p, 10);
if (p != XdrvMailbox.data) {
uint32_t values[2] = { 0 };
uint32_t params = ParseParameters(2, values);
values[0] *= 100;
if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= 5)) {
if (params > 0) {
switch (XdrvMailbox.index) {
case 1:
// Reset Energy Today
Energy.kWhtoday_offset = lnum *100;
Energy.kWhtoday_offset = values[0];
Energy.kWhtoday = 0;
Energy.kWhtoday_delta = 0;
Energy.start_energy = 0;
@ -573,56 +575,55 @@ void CmndEnergyReset(void)
Settings.energy_kWhtoday = Energy.kWhtoday_offset;
RtcSettings.energy_kWhtoday = Energy.kWhtoday_offset;
Energy.daily = (float)Energy.kWhtoday_offset / 100000;
if (!RtcSettings.energy_kWhtotal && !Energy.kWhtoday_offset) {
Settings.energy_kWhtotal_time = LocalTime();
if( params > 1) {
Settings.energy_kWhtotal_time = values[1];
}
else {
if (!RtcSettings.energy_kWhtotal && !Energy.kWhtoday_offset) {
Settings.energy_kWhtotal_time = LocalTime();
}
}
break;
case 2:
// Reset Energy Yesterday
Settings.energy_kWhyesterday = lnum *100;
Settings.energy_kWhyesterday = values[0];
if( params > 1) {
Settings.energy_kWhtotal_time = values[1];
}
break;
case 3:
// Reset Energy Total
RtcSettings.energy_kWhtotal = lnum *100;
RtcSettings.energy_kWhtotal = values[0];
Settings.energy_kWhtotal = RtcSettings.energy_kWhtotal;
// Energy.total = (float)(RtcSettings.energy_kWhtotal + Energy.kWhtoday_offset + Energy.kWhtoday) / 100000;
Settings.energy_kWhtotal_time = (!Energy.kWhtoday_offset) ? LocalTime() : Midnight();
if( params > 1) {
Settings.energy_kWhtotal_time = values[1];
}
else {
Settings.energy_kWhtotal_time = (!Energy.kWhtoday_offset) ? LocalTime() : Midnight();
}
RtcSettings.energy_usage.last_usage_kWhtotal = (uint32_t)(Energy.total * 1000);
break;
}
}
}
else if ((XdrvMailbox.index > 3) && (XdrvMailbox.index <= 5)) {
uint32_t values[2] = { 0 };
uint32_t position = ParseParameters(2, values);
values[0] *= 100;
values[1] *= 100;
switch (XdrvMailbox.index)
{
case 4:
// Reset energy_usage.usage totals
if (position > 0) {
RtcSettings.energy_usage.usage1_kWhtotal = values[0];
}
if (position > 1) {
RtcSettings.energy_usage.usage2_kWhtotal = values[1];
RtcSettings.energy_usage.usage1_kWhtotal = values[0];
if (params > 1) {
RtcSettings.energy_usage.usage2_kWhtotal = values[1] * 100;
}
Settings.energy_usage.usage1_kWhtotal = RtcSettings.energy_usage.usage1_kWhtotal;
Settings.energy_usage.usage2_kWhtotal = RtcSettings.energy_usage.usage2_kWhtotal;
break;
case 5:
// Reset energy_usage.return totals
if (position > 0) {
RtcSettings.energy_usage.return1_kWhtotal = values[0];
}
if (position > 1) {
RtcSettings.energy_usage.return2_kWhtotal = values[1];
RtcSettings.energy_usage.return1_kWhtotal = values[0];
if (params > 1) {
RtcSettings.energy_usage.return2_kWhtotal = values[1] * 100;
}
Settings.energy_usage.return1_kWhtotal = RtcSettings.energy_usage.return1_kWhtotal;
Settings.energy_usage.return2_kWhtotal = RtcSettings.energy_usage.return2_kWhtotal;
break;
}
}
}
Energy.total = (float)(RtcSettings.energy_kWhtotal + Energy.kWhtoday_offset + Energy.kWhtoday) / 100000;

File diff suppressed because it is too large Load Diff

104
tasmota/xdrv_13_display.ino Normal file → Executable file
View File

@ -497,13 +497,13 @@ void DisplayText(void)
cp += var;
linebuf[fill] = 0;
break;
#if defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
case 'P':
{ char *ep=strchr(cp,':');
if (ep) {
*ep=0;
ep++;
Draw_RGB_Bitmap(cp,disp_xpos,disp_ypos);
Draw_RGB_Bitmap(cp,disp_xpos,disp_ypos, false);
cp=ep;
}
}
@ -682,7 +682,7 @@ void DisplayText(void)
RedrawGraph(temp,temp1);
break;
}
#if defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
if (*cp=='s') {
cp++;
var=atoiv(cp,&temp);
@ -1423,7 +1423,7 @@ void CmndDisplayDimmer(void)
void CmndDisplayBlinkrate(void)
{
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 3)) {
if (!renderer)
XdspCall(FUNC_DISPLAY_BLINKRATE);
}
@ -1540,20 +1540,39 @@ void CmndDisplayRows(void)
/*********************************************************************************************\
* optional drivers
\*********************************************************************************************/
#ifdef USE_TOUCH_BUTTONS
// very limited path size, so, add .jpg
void draw_picture(char *path, uint32_t xp, uint32_t yp, uint32_t xs, uint32_t ys, bool inverted) {
char ppath[16];
strcpy(ppath, path);
uint8_t plen = strlen(path) -1;
if (ppath[plen]=='1') {
// index mode
if (inverted) {
ppath[plen] = '2';
}
inverted = false;
}
strcat(ppath, ".jpg");
Draw_RGB_Bitmap(ppath, xp, yp, inverted);
}
#endif
#ifdef ESP32
#ifdef JPEG_PICTS
#include "img_converters.h"
#include "esp_jpg_decode.h"
bool jpg2rgb888(const uint8_t *src, size_t src_len, uint8_t * out, jpg_scale_t scale);
char get_jpeg_size(unsigned char* data, unsigned int data_size, unsigned short *width, unsigned short *height);
void rgb888_to_565(uint8_t *in, uint16_t *out, uint32_t len);
#endif // JPEG_PICTS
#endif // ESP32
#if defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)
extern FS *fsp;
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
extern FS *ufsp;
#define XBUFF_LEN 128
void Draw_RGB_Bitmap(char *file,uint16_t xp, uint16_t yp) {
void Draw_RGB_Bitmap(char *file,uint16_t xp, uint16_t yp, bool inverted ) {
if (!renderer) return;
File fp;
char *ending = strrchr(file,'.');
@ -1567,7 +1586,7 @@ void Draw_RGB_Bitmap(char *file,uint16_t xp, uint16_t yp) {
if (!strcmp(estr,"rgb")) {
// special rgb format
fp=fsp->open(file,FILE_READ);
fp=ufsp->open(file,FS_FILE_READ);
if (!fp) return;
uint16_t xsize;
fp.read((uint8_t*)&xsize,2);
@ -1602,34 +1621,41 @@ void Draw_RGB_Bitmap(char *file,uint16_t xp, uint16_t yp) {
// jpeg files on ESP32 with more memory
#ifdef ESP32
#ifdef JPEG_PICTS
if (psramFound()) {
fp=fsp->open(file,FILE_READ);
if (!fp) return;
uint32_t size = fp.size();
uint8_t *mem = (uint8_t *)heap_caps_malloc(size+4, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
if (mem) {
uint8_t res=fp.read(mem, size);
if (res) {
uint16_t xsize;
uint16_t ysize;
if (mem[0]==0xff && mem[1]==0xd8) {
get_jpeg_size(mem, size, &xsize, &ysize);
//Serial.printf(" x,y %d - %d\n",xsize, ysize );
if (xsize && ysize) {
uint8_t *out_buf = (uint8_t *)heap_caps_malloc((xsize*ysize*3)+4, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
if (out_buf) {
fp=ufsp->open(file,FS_FILE_READ);
if (!fp) return;
uint32_t size = fp.size();
uint8_t *mem = (uint8_t *)special_malloc(size+4);
if (mem) {
uint8_t res=fp.read(mem, size);
if (res) {
uint16_t xsize;
uint16_t ysize;
if (mem[0]==0xff && mem[1]==0xd8) {
get_jpeg_size(mem, size, &xsize, &ysize);
//Serial.printf(" x,y,fs %d - %d - %d\n",xsize, ysize, size );
if (xsize && ysize) {
uint8_t *out_buf = (uint8_t *)special_malloc((xsize*ysize*3)+4);
if (out_buf) {
uint16_t *pixb = (uint16_t *)special_malloc((xsize*2)+4);
if (pixb) {
uint8_t *ob=out_buf;
jpg2rgb888(mem, size, out_buf, (jpg_scale_t)JPG_SCALE_NONE);
uint16_t pixels=xsize*ysize/XBUFF_LEN;
renderer->setAddrWindow(xp,yp,xp+xsize,yp+ysize);
for(int32_t j=0; j<pixels; j++) {
uint16_t rbuff[XBUFF_LEN*2];
rgb888_to_565(ob, rbuff, XBUFF_LEN);
ob+=XBUFF_LEN*3;
renderer->pushColors(rbuff,XBUFF_LEN,true);
OsWatchLoop();
if (jpg2rgb888(mem, size, out_buf, (jpg_scale_t)JPG_SCALE_NONE)) {
renderer->setAddrWindow(xp,yp,xp+xsize,yp+ysize);
for(int32_t j=0; j<ysize; j++) {
if (inverted==false) {
rgb888_to_565(ob, pixb, xsize);
} else {
rgb888_to_565i(ob, pixb, xsize);
}
ob+=xsize*3;
renderer->pushColors(pixb, xsize, true);
OsWatchLoop();
}
renderer->setAddrWindow(0,0,0,0);
}
renderer->setAddrWindow(0,0,0,0);
free(out_buf);
free(pixb);
} else {
free(out_buf);
}
}
@ -1888,7 +1914,7 @@ void DisplayCheckGraph() {
}
#if defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
#ifdef ESP32
#include <SD.h>
#endif
@ -1899,8 +1925,8 @@ void Save_graph(uint8_t num, char *path) {
struct GRAPH *gp=graph[index];
if (!gp) return;
File fp;
fsp->remove(path);
fp=fsp->open(path,FILE_WRITE);
ufsp->remove(path);
fp=ufsp->open(path,FS_FILE_WRITE);
if (!fp) return;
char str[32];
sprintf_P(str,PSTR("%d\t%d\t%d\t"),gp->xcnt,gp->xs,gp->ys);
@ -1925,7 +1951,7 @@ void Restore_graph(uint8_t num, char *path) {
struct GRAPH *gp=graph[index];
if (!gp) return;
File fp;
fp=fsp->open(path,FILE_READ);
fp=ufsp->open(path,FS_FILE_READ);
if (!fp) return;
char vbuff[32];
char *cp=vbuff;

View File

@ -30,26 +30,145 @@
#define XDRV_20 20
const char HUE_RESPONSE[] PROGMEM =
#include "UnishoxStrings.h"
const char HUE_RESP_MSG_U[] PROGMEM =
//=HUE_RESP_RESPONSE
"HTTP/1.1 200 OK\r\n"
"HOST: 239.255.255.250:1900\r\n"
"CACHE-CONTROL: max-age=100\r\n"
"EXT:\r\n"
"LOCATION: http://%s:80/description.xml\r\n"
"SERVER: Linux/3.14.0 UPnP/1.0 IpBridge/1.24.0\r\n" // was 1.17
"hue-bridgeid: %s\r\n";
const char HUE_ST1[] PROGMEM =
"hue-bridgeid: %s\r\n"
"\0"
//=HUE_RESP_ST1
"ST: upnp:rootdevice\r\n"
"USN: uuid:%s::upnp:rootdevice\r\n"
"\r\n";
const char HUE_ST2[] PROGMEM =
"\r\n"
"\0"
//=HUE_RESP_ST2
"ST: uuid:%s\r\n"
"USN: uuid:%s\r\n"
"\r\n";
const char HUE_ST3[] PROGMEM =
"\r\n"
"\0"
//=HUE_RESP_ST3
"ST: urn:schemas-upnp-org:device:basic:1\r\n"
"USN: uuid:%s\r\n"
"\r\n";
"\r\n"
"\0";
// Use the tool at https://tasmota.hadinger.fr/util and choose "Compress Strings template with Unishox"
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++ DO NOT EDIT BELOW ++++++++++++++++++++
// ++++++++++++++++++++vvvvvvvvvvvvvvvvvvv++++++++++++++++++++
enum {
HUE_RESP_RESPONSE=0,
HUE_RESP_ST1=185,
HUE_RESP_ST2=240,
HUE_RESP_ST3=270,
};
// Compressed from 328 to 247, -24.7%
const char HUE_RESP_MSG[] PROGMEM = "\x00\x15\x21\x45\x45\x44\x30\xEC\x39\x0E\x90\xEE\x53\x67\x70\x8B\x08\xD2\x70\xA4"
"\x6E\x21\x45\x85\xE2\xA3\xCD\x1C\xAB\x47\x4A\xDD\x3A\x56\xE9\xD2\xB5\x9E\x71\x36"
"\x53\x85\x23\x71\x06\x56\x41\x90\xA2\x67\x59\x10\x79\xD5\xFC\x08\x8F\x34\x36\xCD"
"\x87\x5D\x8F\x33\xE1\xC8\xD9\x4E\x14\x8D\xC4\xC8\xD8\x54\x79\xCE\x14\x8D\xC4\x41"
"\x60\x77\x5B\x9C\x47\x9A\x15\x54\x30\xF3\x3B\x0E\xC3\xEB\xC7\x99\xCF\xB3\xB0\x84"
"\x7E\x0F\xFA\x32\xB7\x38\xE8\x6C\x1A\x14\xE1\x48\xDC\x45\xE7\xF3\x37\xF2\x3C\xD1"
"\x05\xBC\x2C\xD8\x76\x1C\xB3\xA4\xC3\xA3\x3B\x84\x42\xC8\x67\x10\xC3\xB0\xE4\x3A"
"\x33\xB8\x45\xA3\x08\x77\xF4\x41\xE6\x76\x1C\x87\x4A\xC3\xA3\x29\xC2\x91\xB8\x50"
"\xB6\x75\x8E\xFE\x88\x3C\xF4\x43\xCD\x1F\x5E\x9C\x29\x1B\xA7\x0B\xE5\xE2\xA3\xCD"
"\x0B\x19\xC3\x0F\x3F\xE6\x50\x8C\xCF\x43\x73\x85\x23\x71\x0B\x2F\x17\x1E\x68\x58"
"\xBD\x10\xF3\x3E\xBC\x79\x9E\x60\x99\x6C\x10\xF1\x30\x41\xBA\x09\x38\x58\x22\xDA"
"\xFF\x1E\x7E\x0C\x53\x1B\x7E\x3A\xC5\x8C\xE1\x87\x5E\x7C\x78\xF3\x04\x1C\x78\xF3"
"\x1D\x7E\xD0\xCF\x33\x90\x81\x3B\x16";
// ++++++++++++++++++++^^^^^^^^^^^^^^^^^^^++++++++++++++++++++
// ++++++++++++++++++++ DO NOT EDIT ABOVE ++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// const char HUE_RESPONSE[] PROGMEM =
// "HTTP/1.1 200 OK\r\n"
// "HOST: 239.255.255.250:1900\r\n"
// "CACHE-CONTROL: max-age=100\r\n"
// "EXT:\r\n"
// "LOCATION: http://%s:80/description.xml\r\n"
// "SERVER: Linux/3.14.0 UPnP/1.0 IpBridge/1.24.0\r\n" // was 1.17
// "hue-bridgeid: %s\r\n";
// const char HUE_ST1[] PROGMEM =
// "ST: upnp:rootdevice\r\n"
// "USN: uuid:%s::upnp:rootdevice\r\n"
// "\r\n";
// const char HUE_ST2[] PROGMEM =
// "ST: uuid:%s\r\n"
// "USN: uuid:%s\r\n"
// "\r\n";
// const char HUE_ST3[] PROGMEM =
// "ST: urn:schemas-upnp-org:device:basic:1\r\n"
// "USN: uuid:%s\r\n"
// "\r\n";
const char HUE_API_U[] PROGMEM =
//=HUE_INVALID
"/invalid/"
"\0"
//=HUE_ROOT
"/"
"\0"
//=HUE_CONFIG
"/config"
"\0"
//=HUE_LIGHTS_API
"/lights"
"\0"
//=HUE_GROUPS
"/groups"
"\0"
//=HUE_SCHEDULES
"/schedules"
"\0"
//=HUE_SENSORS
"/sensors"
"\0"
//=HUE_SCENES
"/scenes"
"\0"
//=HUE_RULES
"/rules"
"\0"
//=HUE_RESOURCELINKS
"/resourcelinks"
"\0"
;
// Use the tool at https://tasmota.hadinger.fr/util and choose "Compress Strings template with Unishox"
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++ DO NOT EDIT BELOW ++++++++++++++++++++
// ++++++++++++++++++++vvvvvvvvvvvvvvvvvvv++++++++++++++++++++
enum {
HUE_INVALID=0,
HUE_ROOT=10,
HUE_CONFIG=12,
HUE_LIGHTS_API=20,
HUE_GROUPS=28,
HUE_SCHEDULES=36,
HUE_SENSORS=47,
HUE_SCENES=56,
HUE_RULES=64,
HUE_RESOURCELINKS=71,
};
// Compressed from 86 to 74, -14.0%
const char HUE_API[] PROGMEM = "\x00\x06\x3B\x37\x8C\xEC\x2D\x10\xEC\x9C\x2F\x9D\x93\x85\xF3\xB0\x3C\xE3\x1A\x3D"
"\x38\x5F\x3B\x02\xD1\xE1\x55\xE9\xC2\xF9\xD8\x3D\xFC\x16\x33\xD3\x85\xF3\xB3\xC1"
"\x8A\x62\x0B\x09\xFA\x70\xBE\x76\x79\xF7\xB3\xFE\x9C\x2F\x9D\x9E\x0D\xF3\xF4\xE1"
"\x7C\xEC\xF8\x20\xD4\xFB\xF6\x0B\xF8\x6C\x2D\xE3\x4F\x4E\x17\xCD";
// ++++++++++++++++++++^^^^^^^^^^^^^^^^^^^++++++++++++++++++++
// ++++++++++++++++++++ DO NOT EDIT ABOVE ++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
String HueBridgeId(void)
{
@ -81,20 +200,21 @@ void HueRespondToMSearch(void)
char message[TOPSZ];
if (PortUdp.beginPacket(udp_remote_ip, udp_remote_port)) {
UnishoxStrings msg(HUE_RESP_MSG);
char response[320];
snprintf_P(response, sizeof(response), HUE_RESPONSE, WiFi.localIP().toString().c_str(), HueBridgeId().c_str());
snprintf_P(response, sizeof(response), msg[HUE_RESP_RESPONSE], WiFi.localIP().toString().c_str(), HueBridgeId().c_str());
int len = strlen(response);
String uuid = HueUuid();
snprintf_P(response + len, sizeof(response) - len, HUE_ST1, uuid.c_str());
snprintf_P(response + len, sizeof(response) - len, msg[HUE_RESP_ST1], uuid.c_str());
PortUdp.write(response);
PortUdp.endPacket();
snprintf_P(response + len, sizeof(response) - len, HUE_ST2, uuid.c_str(), uuid.c_str());
snprintf_P(response + len, sizeof(response) - len, msg[HUE_RESP_ST2], uuid.c_str(), uuid.c_str());
PortUdp.write(response);
PortUdp.endPacket();
snprintf_P(response + len, sizeof(response) - len, HUE_ST3, uuid.c_str());
snprintf_P(response + len, sizeof(response) - len, msg[HUE_RESP_ST3], uuid.c_str());
PortUdp.write(response);
PortUdp.endPacket();
@ -158,81 +278,135 @@ const char HUE_DESCRIPTION_XML_COMPRESSED[] PROGMEM = "\x3D\x0E\xD1\xB0\x68\x48\
// "</root>\r\n"
// "\r\n";
//%s"alert":"none","effect":"none","reachable":true}
//Successfully compressed from 50 to 34 bytes (-32%)
// const size_t HUE_LIGHTS_STATUS_JSON1_SUFFIX_size = 50;
// const char HUE_LIGHTS_STATUS_JSON1_SUFFIX[] PROGMEM = "\x3E\xBC\x7B\x2C\x27\xFA\x3D\x87\x99\xEC\xEC\xE6\x7B\x0E\xA3\xD8\xCC\x18\x61\x82"
// "\x34\xCF\xBB\x0C\x55\x8E\x09\x9E\xC3\xCE\xBE\x2D\x9E\xE3";
const char HUE_LIGHTS_STATUS_JSON1_SUFFIX[] PROGMEM =
const char HUE_LIGHTS_U[] PROGMEM =
//=HUE_LIGHTS_STATUS_JSON1_SUFFIX
"%s\"alert\":\"none\","
"\"effect\":\"none\","
"\"reachable\":true}";
//,"type":"Extended color light","name":"%s","modelid":"%s","manufacturername":"%s","uniqueid":"%s"}
//Successfully compressed from 98 to 64 bytes (-34.7%)
// const size_t HUE_LIGHTS_STATUS_JSON2_size = 98;
// const char HUE_LIGHTS_STATUS_JSON2[] PROGMEM = "\x3A\x8F\x65\x19\x0C\x67\xB0\xF3\x3D\x84\xCD\x94\xF8\x46\x22\x0F\x02\xCF\xA0\xB4"
// "\x78\x55\x1E\xC3\xA8\xF6\x75\x8D\x67\xB0\xF3\x3D\x87\xD7\x8F\x61\xD4\x7B\x06\xE0"
// "\x8C\x2D\x10\x11\x25\xDF\x0B\x31\x61\xD0\xBF\xBF\x82\x3E\x06\x2F\xB4\xD4\x2D\x82"
// "\x1E\x08\x7B\x8D";
const char HUE_LIGHTS_STATUS_JSON2[] PROGMEM =
"\"reachable\":true}"
"\0"
//=HUE_LIGHTS_STATUS_JSON2
",\"type\":\"Extended color light\","
"\"name\":\"%s\","
"\"modelid\":\"%s\","
"\"manufacturername\":\"%s\","
"\"uniqueid\":\"%s\"}";
//{"name":"Group 0","lights":[{l1],"type":"LightGroup","action":
//Successfully compressed from 62 to 61 bytes (-1.6%)
const char HUE_GROUP0_STATUS_JSON[] PROGMEM =
"\"uniqueid\":\"%s\"}"
"\0"
//=HUE_GROUP0_STATUS_JSON
"{\"name\":\"Group 0\","
"\"lights\":[{l1],"
"\"type\":\"LightGroup\","
"\"action\":";
// "\"scene\":\"none\",";
"\"action\":"
"\0"
//=HUE_ERROR_JSON
"[{\"error\":{\"type\":901,\"address\":\"/\",\"description\":\"Internal Error\"}}]"
"\0"
//=HUE_RESP_ON
"{\"success\":{\"/lights/%d/state/on\":%s}}"
"\0"
//=HUE_RESP_NUM
"{\"success\":{\"/lights/%d/state/%s\":%d}}"
"\0"
//=HUE_RESP_XY
"{\"success\":{\"/lights/%d/state/xy\":[%s,%s]}}"
"\0"
;
// Use the tool at https://tasmota.hadinger.fr/util and choose "Compress Strings template with Unishox"
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++ DO NOT EDIT BELOW ++++++++++++++++++++
// ++++++++++++++++++++vvvvvvvvvvvvvvvvvvv++++++++++++++++++++
enum {
HUE_LIGHTS_STATUS_JSON1_SUFFIX=0,
HUE_LIGHTS_STATUS_JSON2=51,
HUE_GROUP0_STATUS_JSON=150,
HUE_ERROR_JSON=213,
HUE_RESP_ON=283,
HUE_RESP_NUM=322,
HUE_RESP_XY=361,
};
// Compressed from 405 to 275, -32.1%
const char HUE_LIGHTS[] PROGMEM = "\x00\x1A\x3E\xBC\x7B\x2C\x27\xFA\x3D\x87\x99\xEC\xEC\xE6\x7B\x0E\xA3\xD8\xCC\x18"
"\x61\x82\x34\xCF\xBB\x0C\x55\x8E\x09\x9E\xC3\xCE\xBE\x2D\x9E\xE9\xC2\xF9\xD4\x7B"
"\x28\xC8\x63\x3D\x87\x99\xEC\x26\x6C\xA7\xC2\x31\x10\x78\x16\x7D\x05\xA3\xC2\xA8"
"\xF6\x1D\x47\xB3\xAC\x6B\x3D\x87\x99\xEC\x3E\xBC\x7B\x0E\xA3\xD8\x37\x04\x61\x68"
"\x80\x89\x2E\xF8\x59\x8B\x0E\x85\xFD\xFC\x11\xF0\x31\x7D\xA6\xA1\x6C\x10\xF0\x43"
"\xDD\x38\x5F\x3D\xA0\x87\x90\x90\xF7\xF0\x58\xC4\x71\x9E\xC3\xA8\xF6\x10\x5A\x3C"
"\x2A\x2B\xBC\x7B\x0F\x33\xDE\x3D\xA1\x1C\x87\xBE\x40\x89\xAF\x90\x5A\x3C\x2A\x2B"
"\x88\x7B\xF8\x2C\x61\xEC\x3A\x8F\x65\x87\x5B\x9C\x7B\x0F\x39\xC2\xF9\xEF\x1E\xD3"
"\xD8\xFF\xFC\xF9\xEC\x3C\xCF\x68\x21\x60\xA7\x13\x87\x51\xEC\x2B\x10\x4F\xBF\x78"
"\xF6\x1E\x67\xB0\xEC\x3D\x87\x51\xEC\x11\xF8\x3F\xE8\xC0\x41\xC3\xCF\x61\x6F\x53"
"\xFF\x58\x48\x9F\xFF\x9F\x3D\x87\xB8\xF7\x1E\xFC\xE1\x7C\xF6\x9E\xCF\x0B\x0C\x37"
"\xEF\x1E\xC3\xCC\xF6\x9E\xC3\xB0\x10\x75\xC3\xB0\xFA\x10\xEC\xF5\x5D\x33\xB3\x38"
"\xF6\x1E\x67\xD7\x8F\x71\xEE\x05\xAC\x0C\xFA\xF1\xEC\x3C\xCF\xA1\x01\x73\x03\x36"
"\x19\x1E\xC3\xCC\xF7\x8F\xAF\x1D\x47\xD7\x8F\x7C\xF7\x1E\xE9\xC2\xF9";
// ++++++++++++++++++++^^^^^^^^^^^^^^^^^^^++++++++++++++++++++
// ++++++++++++++++++++ DO NOT EDIT ABOVE ++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// const char HUE_LIGHTS_STATUS_JSON1_SUFFIX[] PROGMEM =
// "%s\"alert\":\"none\","
// "\"effect\":\"none\","
// "\"reachable\":true}";
// const char HUE_LIGHTS_STATUS_JSON2[] PROGMEM =
// ",\"type\":\"Extended color light\","
// "\"name\":\"%s\","
// "\"modelid\":\"%s\","
// "\"manufacturername\":\"%s\","
// "\"uniqueid\":\"%s\"}";
// const char HUE_GROUP0_STATUS_JSON[] PROGMEM =
// "{\"name\":\"Group 0\","
// "\"lights\":[{l1],"
// "\"type\":\"LightGroup\","
// "\"action\":";
// const char HueConfigResponse_JSON[] PROGMEM =
// "{\"name\":\"Philips hue\","
// "\"mac\":\"{ma\","
// "\"dhcp\":true,"
// "\"ipaddress\":\"{ip\","
// "\"netmask\":\"{ms\","
// "\"gateway\":\"{gw\","
// "\"proxyaddress\":\"none\","
// "\"proxyport\":0,"
// "\"bridgeid\":\"{br\","
// "\"UTC\":\"{dt\","
// "\"whitelist\":{\"{id\":{"
// "\"last use date\":\"{dt\","
// "\"create date\":\"{dt\","
// "\"name\":\"Remote\"}},"
// "\"swversion\":\"01041302\","
// "\"apiversion\":\"1.17.0\","
// "\"swupdate\":{\"updatestate\":0,\"url\":\"\",\"text\":\"\",\"notify\": false},"
// "\"linkbutton\":false,"
// "\"portalservices\":false"
// "}";
//{"name":"Philips hue","mac":"{ma","dhcp":true,"ipaddress":"{ip","netmask":"{ms","gateway":"{gw","proxyaddress":"none","proxyport":0,"bridgeid":"{br","UTC":"{dt","whitelist":{"{id":{"last use date":"{dt","create date":"{dt","name":"Remote"}},"swversion":"01041302","apiversion":"1.17.0","swupdate":{"updatestate":0,"url":"","text":"","notify": false},"linkbutton":false,"portalservices":false}
//Successfully compressed from 392 to 302 bytes (-23%)
// const size_t HueConfigResponse_JSON_size = 392;
// const char HueConfigResponse_JSON[] PROGMEM = "\x3D\xA7\xB3\xAC\x6B\x3D\x87\x99\xEC\x21\x82\xB4\x2D\x19\xE4\x28\x5B\x3D\x87\x51"
// "\xEC\x1B\x61\x9E\xC3\xCC\xF6\x1E\xD1\xB6\x7B\x0E\xA3\xD8\x20\xA0\xC6\x1E\xC3\xCE"
// "\xBE\x2D\x9D\x47\xB3\x46\x58\x82\x7D\xFB\xC7\xB0\xF3\x3D\x87\xB7\x46\x1E\xC3\xA8"
// "\xF6\x73\xA1\xB7\xE3\x43\xD8\x79\x9E\xC3\xDA\x37\xC7\xB0\xEA\x3D\x83\xD7\x4C\x7E"
// "\xCC\x8F\x61\xE6\x7B\x0F\x68\xF0\xF9\xEC\x3A\x8F\x60\xCF\xE1\xB0\xC8\x11\x71\x1E"
// "\xCE\x60\x87\x48\x66\x7E\x8F\x61\xE6\x71\x9D\x47\xB0\x87\x7F\x44\x1E\x7A\x21\xEC"
// "\x3C\xCF\x61\xED\x1D\xF3\xD8\x75\x1E\xC2\x16\x54\x41\x9E\xC3\xCC\xF6\x1E\xD1\x28"
// "\xF6\x1D\x47\xB0\x7C\x56\xD3\x0B\x7D\x47\xB0\xF3\x3D\xA7\xB0\xF6\xE8\x87\xB0\xF3"
// "\x3D\xA7\xB0\x2B\xF5\x21\x7E\x68\x4B\xA6\x08\x98\x30\x7F\x77\x40\x95\x40\x10\xB8"
// "\x3A\x2F\xB1\xB9\x4C\xF6\x1E\xE3\xDC\x75\x1E\xCF\x0F\x99\xBF\xFB\x73\x8F\x61\xE6"
// "\x7B\x0E\x38\xF2\x5B\xA3\xD8\x75\x1E\xC2\xB1\x9A\x08\xB5\x0E\x43\xA4\xF1\xD1\x9E"
// "\xC3\xA8\xF6\x17\x87\xC5\x8C\x04\x1C\xB0\xF6\x9E\xC0\x41\x8D\xEA\xBA\x67\xB0\xF3"
// "\x38\xCE\xA3\xD8\x42\xFE\x11\xEC\x3C\xCF\x61\xEC\x3A\x8F\x65\x33\x65\x02\x0C\x6E"
// "\xCA\xD3\x06\x47\xB0\xF3\x46\x2C\x2F\x33\xDC\x75\x1E\xC0\xB7\x8D\x07\x0B\xAA\xCE"
// "\x3D\x87\x99\x8B\x0B\xCC\xEA\x3D\x83\x33\xF5\x61\x79\xFC\xCF\x43\x7E\x04\x2A\x2B"
// "\x67\xB8";
const char HueConfigResponse_JSON[] PROGMEM =
"{\"name\":\"Philips hue\","
"\"mac\":\"{ma\","
"\"dhcp\":true,"
"\"ipaddress\":\"{ip\","
"\"netmask\":\"{ms\","
"\"gateway\":\"{gw\","
"\"proxyaddress\":\"none\","
"\"proxyport\":0,"
"\"bridgeid\":\"{br\","
"\"UTC\":\"{dt\","
"\"whitelist\":{\"{id\":{"
"\"last use date\":\"{dt\","
"\"create date\":\"{dt\","
"\"name\":\"Remote\"}},"
"\"swversion\":\"01041302\","
"\"apiversion\":\"1.17.0\","
"\"swupdate\":{\"updatestate\":0,\"url\":\"\",\"text\":\"\",\"notify\": false},"
"\"linkbutton\":false,"
"\"portalservices\":false"
"}";
const char HUE_ERROR_JSON[] PROGMEM =
"[{\"error\":{\"type\":901,\"address\":\"/\",\"description\":\"Internal Error\"}}]";
const size_t HueConfigResponse_JSON_SIZE = 392;
const char HueConfigResponse_JSON[] PROGMEM = "\x3D\xA7\xB3\xAC\x6B\x3D\x87\x99\xEC\x21\x82\xB4\x2D\x19\xE4\x28\x5B\x3D\x87\x51"
"\xEC\x1B\x61\x9E\xC3\xCC\xF6\x1E\xD1\xB6\x7B\x0E\xA3\xD8\x20\xA0\xC6\x1E\xC3\xCE"
"\xBE\x2D\x9D\x47\xB3\x46\x58\x82\x7D\xFB\xC7\xB0\xF3\x3D\x87\xB7\x46\x1E\xC3\xA8"
"\xF6\x73\xA1\xB7\xE3\x43\xD8\x79\x9E\xC3\xDA\x37\xC7\xB0\xEA\x3D\x83\xD7\x4C\x7E"
"\xCC\x8F\x61\xE6\x7B\x0F\x68\xF0\xF9\xEC\x3A\x8F\x60\xCF\xE1\xB0\xC8\x11\x71\x1E"
"\xCE\x60\x87\x48\x66\x7E\x8F\x61\xE6\x71\x9D\x47\xB0\x87\x7F\x44\x1E\x7A\x21\xEC"
"\x3C\xCF\x61\xED\x1D\xF3\xD8\x75\x1E\xC2\x16\x54\x41\x9E\xC3\xCC\xF6\x1E\xD1\x28"
"\xF6\x1D\x47\xB0\x7C\x56\xD3\x0B\x7D\x47\xB0\xF3\x3D\xA7\xB0\xF6\xE8\x87\xB0\xF3"
"\x3D\xA7\xB0\x2B\xF5\x21\x7E\x68\x4B\xA6\x08\x98\x30\x7F\x77\x40\x95\x40\x10\xB8"
"\x3A\x2F\xB1\xB9\x4C\xF6\x1E\xE3\xDC\x75\x1E\xCF\x0F\x99\xBF\xFB\x73\x8F\x61\xE6"
"\x7B\x0E\x38\xF2\x5B\xA3\xD8\x75\x1E\xC2\xB1\x9A\x08\xB5\x0E\x43\xA4\xF1\xD1\x9E"
"\xC3\xA8\xF6\x17\x87\xC5\x8C\x04\x1C\xB0\xF6\x9E\xC0\x41\x8D\xEA\xBA\x67\xB0\xF3"
"\x38\xCE\xA3\xD8\x42\xFE\x11\xEC\x3C\xCF\x61\xEC\x3A\x8F\x65\x33\x65\x02\x0C\x6E"
"\xCA\xD3\x06\x47\xB0\xF3\x46\x2C\x2F\x33\xDC\x75\x1E\xC0\xB7\x8D\x07\x0B\xAA\xCE"
"\x3D\x87\x99\x8B\x0B\xCC\xEA\x3D\x83\x33\xF5\x61\x79\xFC\xCF\x43\x7E\x04\x2A\x2B"
"\x67\xB8";
// const char HUE_ERROR_JSON[] PROGMEM =
// "[{\"error\":{\"type\":901,\"address\":\"/\",\"description\":\"Internal Error\"}}]";
/********************************************************************************************/
@ -272,7 +446,7 @@ void HueNotImplemented(String *path)
void HueConfigResponse(String *response)
{
*response += FPSTR(HueConfigResponse_JSON);
*response += Decompress(HueConfigResponse_JSON, HueConfigResponse_JSON_SIZE);
response->replace("{ma", WiFi.macAddress());
response->replace("{ip", WiFi.localIP().toString());
response->replace("{ms", WiFi.subnetMask().toString());
@ -360,6 +534,7 @@ void HueLightStatus1(uint8_t device, String *response)
const size_t buf_size = 256;
char * buf = (char*) malloc(buf_size); // temp buffer for strings, avoid stack
UnishoxStrings msg(HUE_LIGHTS);
snprintf_P(buf, buf_size, PSTR("{\"on\":%s,"), (TasmotaGlobal.power & (1 << (device-1))) ? "true" : "false");
// Brightness for all devices with PWM
@ -382,7 +557,7 @@ void HueLightStatus1(uint8_t device, String *response)
if (LST_COLDWARM == local_light_subtype || LST_RGBW <= local_light_subtype) { // white temp
snprintf_P(buf, buf_size, PSTR("%s\"ct\":%d,"), buf, ct > 0 ? ct : 284);
}
snprintf_P(buf, buf_size, HUE_LIGHTS_STATUS_JSON1_SUFFIX, buf);
snprintf_P(buf, buf_size, msg[HUE_LIGHTS_STATUS_JSON1_SUFFIX], buf);
*response += buf;
free(buf);
@ -415,7 +590,8 @@ void HueLightStatus2(uint8_t device, String *response)
}
fname[fname_len] = 0x00;
}
snprintf_P(buf, buf_size, HUE_LIGHTS_STATUS_JSON2,
UnishoxStrings msg(HUE_LIGHTS);
snprintf_P(buf, buf_size, msg[HUE_LIGHTS_STATUS_JSON2],
EscapeJSONString(fname).c_str(),
EscapeJSONString(Settings.user_template_name).c_str(),
PSTR("Tasmota"),
@ -548,6 +724,7 @@ void HueLightsCommand(uint8_t device, uint32_t device_id, String &response) {
const size_t buf_size = 100;
char * buf = (char*) malloc(buf_size);
UnishoxStrings msg(HUE_LIGHTS);
if (Webserver->args()) {
response = "[";
@ -559,7 +736,7 @@ void HueLightsCommand(uint8_t device, uint32_t device_id, String &response) {
if (hue_on) {
on = hue_on.getBool();
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/on\":%s}}"),
msg[HUE_RESP_ON],
device_id, on ? "true" : "false");
#ifdef USE_SHUTTER
@ -602,7 +779,7 @@ void HueLightsCommand(uint8_t device, uint32_t device_id, String &response) {
prev_bri = bri; // store command value
if (resp) { response += ","; }
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/%s\":%d}}"),
msg[HUE_RESP_NUM],
device_id, "bri", bri);
response += buf;
if (LST_SINGLE <= Light.subtype) {
@ -633,7 +810,7 @@ void HueLightsCommand(uint8_t device, uint32_t device_id, String &response) {
//AddLog_P(LOG_LEVEL_DEBUG_MORE, "XY RGB (%d %d %d) HS (%d %d)", rr,gg,bb,hue,sat);
if (resp) { response += ","; }
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/xy\":[%s,%s]}}"),
msg[HUE_RESP_XY],
device_id, prev_x_str, prev_y_str);
response += buf;
g_gotct = false;
@ -648,7 +825,7 @@ void HueLightsCommand(uint8_t device, uint32_t device_id, String &response) {
prev_hue = hue;
if (resp) { response += ","; }
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/%s\":%d}}"),
msg[HUE_RESP_NUM],
device_id, "hue", hue);
response += buf;
if (LST_RGB <= Light.subtype) {
@ -667,7 +844,7 @@ void HueLightsCommand(uint8_t device, uint32_t device_id, String &response) {
prev_sat = sat; // store command value
if (resp) { response += ","; }
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/%s\":%d}}"),
msg[HUE_RESP_NUM],
device_id, "sat", sat);
response += buf;
if (LST_RGB <= Light.subtype) {
@ -686,7 +863,7 @@ void HueLightsCommand(uint8_t device, uint32_t device_id, String &response) {
prev_ct = ct; // store commande value
if (resp) { response += ","; }
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/%s\":%d}}"),
msg[HUE_RESP_NUM],
device_id, "ct", ct);
response += buf;
if ((LST_COLDWARM == Light.subtype) || (LST_RGBW <= Light.subtype)) {
@ -725,11 +902,11 @@ void HueLightsCommand(uint8_t device, uint32_t device_id, String &response) {
}
response += "]";
if (2 == response.length()) {
response = FPSTR(HUE_ERROR_JSON);
response = msg[HUE_ERROR_JSON];
}
}
else {
response = FPSTR(HUE_ERROR_JSON);
response = msg[HUE_ERROR_JSON];
}
free(buf);
}
@ -835,7 +1012,8 @@ void HueGroups(String *path)
//AddLog_P(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_HTTP D_HUE " HueGroups (%s)"), path->c_str());
if (path->endsWith("/0")) {
response = FPSTR(HUE_GROUP0_STATUS_JSON);
UnishoxStrings msg(HUE_LIGHTS);
response = msg[HUE_GROUP0_STATUS_JSON];
String lights = F("\"1\"");
for (uint32_t i = 2; i <= maxhue; i++) {
lights += ",\"";
@ -881,17 +1059,18 @@ void HandleHueApi(String *path)
AddLog_P(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_HTTP D_HUE_POST_ARGS " (%s)"), json.c_str()); // HTP: Hue POST args ({"on":false})
}
if (path->endsWith(F("/invalid/"))) {} // Just ignore
UnishoxStrings msg(HUE_API);
if (path->endsWith(msg[HUE_INVALID])) {} // Just ignore
else if (!apilen) HueAuthentication(path); // New HUE App setup
else if (path->endsWith(F("/"))) HueAuthentication(path); // New HUE App setup
else if (path->endsWith(F("/config"))) HueConfig(path);
else if (path->indexOf(F("/lights")) >= 0) HueLights(path);
else if (path->indexOf(F("/groups")) >= 0) HueGroups(path);
else if (path->endsWith(F("/schedules"))) HueNotImplemented(path);
else if (path->endsWith(F("/sensors"))) HueNotImplemented(path);
else if (path->endsWith(F("/scenes"))) HueNotImplemented(path);
else if (path->endsWith(F("/rules"))) HueNotImplemented(path);
else if (path->endsWith(F("/resourcelinks"))) HueNotImplemented(path);
else if (path->endsWith(msg[HUE_ROOT])) HueAuthentication(path); // New HUE App setup
else if (path->endsWith(msg[HUE_CONFIG])) HueConfig(path);
else if (path->indexOf(msg[HUE_LIGHTS_API]) >= 0) HueLights(path);
else if (path->indexOf(msg[HUE_GROUPS]) >= 0) HueGroups(path);
else if (path->endsWith(msg[HUE_SCHEDULES])) HueNotImplemented(path);
else if (path->endsWith(msg[HUE_SENSORS])) HueNotImplemented(path);
else if (path->endsWith(msg[HUE_SCENES])) HueNotImplemented(path);
else if (path->endsWith(msg[HUE_RULES])) HueNotImplemented(path);
else if (path->endsWith(msg[HUE_RESOURCELINKS])) HueNotImplemented(path);
else HueGlobalConfig(path);
}

View File

@ -101,7 +101,8 @@ void HueLightStatus2Zigbee(uint16_t shortaddr, String *response)
char shortaddrname[8];
snprintf_P(shortaddrname, sizeof(shortaddrname), PSTR("0x%04X"), shortaddr);
snprintf_P(buf, buf_size, HUE_LIGHTS_STATUS_JSON2,
UnishoxStrings msg(HUE_LIGHTS);
snprintf_P(buf, buf_size, msg[HUE_LIGHTS_STATUS_JSON2],
(friendlyName) ? EscapeJSONString(friendlyName).c_str() : shortaddrname,
(modelId) ? EscapeJSONString(modelId).c_str() : PSTR("Unknown"),
(manufacturerId) ? EscapeJSONString(manufacturerId).c_str() : PSTR("Tasmota"),
@ -219,6 +220,7 @@ void ZigbeeHandleHue(uint16_t shortaddr, uint32_t device_id, String &response) {
const size_t buf_size = 100;
char * buf = (char*) malloc(buf_size);
UnishoxStrings msg(HUE_LIGHTS);
if (Webserver->args()) {
response = "[";
@ -230,7 +232,7 @@ void ZigbeeHandleHue(uint16_t shortaddr, uint32_t device_id, String &response) {
if (hue_on) {
on = hue_on.getBool();
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/on\":%s}}"),
msg[HUE_RESP_ON],
device_id, on ? "true" : "false");
if (on) {
@ -249,7 +251,7 @@ void ZigbeeHandleHue(uint16_t shortaddr, uint32_t device_id, String &response) {
prev_bri = bri; // store command value
if (resp) { response += ","; }
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/%s\":%d}}"),
msg[HUE_RESP_NUM],
device_id, "bri", bri);
response += buf;
if (LST_SINGLE <= bulbtype) {
@ -273,7 +275,7 @@ void ZigbeeHandleHue(uint16_t shortaddr, uint32_t device_id, String &response) {
strlcpy(prev_y_str, tok_y.getStr(), sizeof(prev_y_str));
if (resp) { response += ","; }
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/xy\":[%s,%s]}}"),
msg[HUE_RESP_XY],
device_id, prev_x_str, prev_y_str);
response += buf;
resp = true;
@ -290,7 +292,7 @@ void ZigbeeHandleHue(uint16_t shortaddr, uint32_t device_id, String &response) {
prev_hue = hue;
if (resp) { response += ","; }
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/%s\":%d}}"),
msg[HUE_RESP_NUM],
device_id, "hue", hue);
response += buf;
if (LST_RGB <= bulbtype) {
@ -308,7 +310,7 @@ void ZigbeeHandleHue(uint16_t shortaddr, uint32_t device_id, String &response) {
prev_sat = sat; // store command value
if (resp) { response += ","; }
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/%s\":%d}}"),
msg[HUE_RESP_NUM],
device_id, "sat", sat);
response += buf;
if (LST_RGB <= bulbtype) {
@ -329,7 +331,7 @@ void ZigbeeHandleHue(uint16_t shortaddr, uint32_t device_id, String &response) {
prev_ct = ct; // store commande value
if (resp) { response += ","; }
snprintf_P(buf, buf_size,
PSTR("{\"success\":{\"/lights/%d/state/%s\":%d}}"),
msg[HUE_RESP_NUM],
device_id, "ct", ct);
response += buf;
if ((LST_COLDWARM == bulbtype) || (LST_RGBW <= bulbtype)) {
@ -340,11 +342,11 @@ void ZigbeeHandleHue(uint16_t shortaddr, uint32_t device_id, String &response) {
response += "]";
if (2 == response.length()) {
response = FPSTR(HUE_ERROR_JSON);
response = msg[HUE_ERROR_JSON];
}
}
else {
response = FPSTR(HUE_ERROR_JSON);
response = msg[HUE_ERROR_JSON];
}
AddLog_P(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_HTTP D_HUE " Result (%s)"), response.c_str());
WSSend(code, CT_JSON, response);

View File

@ -69,6 +69,8 @@ AudioGeneratorMP3 *decoder = NULL;
void *mp3ram = NULL;
extern FS *ufsp;
#ifdef ESP8266
const int preallocateBufferSize = 5*1024;
const int preallocateCodecSize = 29192; // MP3 codec max mem needed
@ -391,7 +393,7 @@ static const uint8_t wavHTemplate[] PROGMEM = { // Hardcoded simple WAV header w
0x64, 0x61, 0x74, 0x61, 0xff, 0xff, 0xff, 0xff };
bool SaveWav(char *path, uint8_t *buff, uint32_t size) {
File fwp = fsp->open(path, FILE_WRITE);
File fwp = ufsp->open(path, FILE_WRITE);
uint8_t wavHeader[sizeof(wavHTemplate)];
memcpy_P(wavHeader, wavHTemplate, sizeof(wavHTemplate));
@ -552,7 +554,7 @@ void I2S_WR_Show(void) {
#ifdef ESP32
void Play_mp3(const char *path) {
#if defined(USE_SCRIPT) && defined(USE_SCRIPT_FATFS)
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
if (decoder || mp3) return;
if (!out) return;
@ -566,7 +568,7 @@ void Play_mp3(const char *path) {
I2S_Task = false;
}
file = new AudioFileSourceFS(*fsp,path);
file = new AudioFileSourceFS(*ufsp,path);
id3 = new AudioFileSourceID3(file);
if (mp3ram) {

View File

@ -70,6 +70,8 @@ The driver enabled by #define USE_UFILESYS
// global file system pointer
FS *ufsp;
// flash file system pointer on esp32
FS *ffsp;
char ufs_path[48];
File ufs_upload_file;
@ -83,6 +85,7 @@ uint8_t ufs_type;
void UFSInit(void) {
ufs_type = 0;
ffsp = 0;
// check for fs options,
// 1. check for SD card
// 2. check for littlefs or FAT
@ -98,12 +101,22 @@ void UFSInit(void) {
if (SD.begin(cs)) {
#ifdef ESP8266
ufsp = (FS*)&SD;
ufsp = &SDFS;
#endif // ESP8266
#ifdef ESP32
ufsp = &SD;
#endif // ESP32
ufs_type = UFS_TSDC;
// now detect ffs
ffsp = &LITTLEFS;
if (!LITTLEFS.begin()) {
// ffat is second
ffsp = &FFat;
if (!FFat.begin(true)) {
ffsp = 0;
return;
}
}
return;
}
}
@ -126,10 +139,12 @@ void UFSInit(void) {
return;
}
ufs_type = UFS_TFAT;
ffsp = ufsp;
return;
}
#endif // ESP32
ufs_type = UFS_TLFS;
ffsp = ufsp;
return;
}
@ -267,7 +282,7 @@ void UFS_free(void) {
const char UFS_WEB_DIR[] PROGMEM =
"<p><form action='" "ufsd" "' method='get'><button>" "%s" "</button></form></p>";
const char UFS_FILE_UPLOAD[] PROGMEM = D_SDCARD_DIR;
const char UFS_FILE_UPLOAD[] PROGMEM = D_UFSDIR;
const char UFS_FORM_FILE_UPLOAD[] PROGMEM =
"<div id='f1' name='f1' style='display:block;'>"
"<fieldset><legend><b>&nbsp;%s" "&nbsp;</b></legend>";
@ -278,7 +293,7 @@ const char UFS_FORM_FILE_UPG[] PROGMEM =
const char UFS_FORM_FILE_UPGc[] PROGMEM =
"<div style='text-align:left;color:green;'>total size: %s kB - free: %s kB</div>";
const char UFS_FORM_SDC_DIRa[] PROGMEM =
"<div style='text-align:left'>";
"<div style='text-align:left;overflow:scroll;height:400px;'>";
const char UFS_FORM_SDC_DIRc[] PROGMEM =
"</div>";
const char UFS_FORM_FILE_UPGb[] PROGMEM =
@ -309,7 +324,7 @@ void UFSdirectory(void) {
WSContentStart_P(UFS_FILE_UPLOAD);
WSContentSendStyle();
WSContentSend_P(UFS_FORM_FILE_UPLOAD,D_SDCARD_DIR);
WSContentSend_P(UFS_FORM_FILE_UPLOAD, D_UFSDIR);
WSContentSend_P(UFS_FORM_FILE_UPG, D_SCRIPT_UPLOAD);
char ts[16];
char fs[16];
@ -495,7 +510,7 @@ void UFSFileUploadSuccess(void) {
WSContentStop();
}
#define D_UFSDIR "UFS directory"
/*********************************************************************************************\
* Interface

View File

@ -83,6 +83,7 @@ void EpdInitDriver29(void) {
#ifdef SHOW_SPLASH
// Welcome text
delay(100);
renderer->setTextFont(1);
renderer->DrawStringAt(50, 50, "Waveshare E-Paper Display!", COLORED,0);
renderer->Updateframe();

View File

@ -112,14 +112,8 @@ void ST7789_InitDriver(void) {
#ifdef SHOW_SPLASH
// Welcome text
renderer->setTextColor(ST7789_WHITE,ST7789_BLACK);
int fontSize = 2;
renderer->setTextFont(2);
if (Settings.display_width<240) {
fontSize = 1;
}
renderer->setTextFont(fontSize);
int fontHeight = 12 * fontSize;
renderer->DrawStringAt(30, (Settings.display_height-fontHeight)/2, "ST7789 TFT!", ST7789_WHITE,0);
renderer->DrawStringAt(30, (Settings.display_height-12)/2, "ST7789 TFT!", ST7789_WHITE,0);
delay(1000);
#endif
@ -131,8 +125,8 @@ void ST7789_InitDriver(void) {
#define SDA_2 23
#define SCL_2 32
#ifdef USE_LANBON_L8
#undef SDA_2
#undef SCL_2
#undef SDA_2
#undef SCL_2
#define SDA_2 4
#define SCL_2 0
#endif // USE_LANBON_L8

View File

@ -94,10 +94,9 @@ void ILI9341_2_InitDriver()
#ifdef SHOW_SPLASH
// Welcome text
renderer->setTextFont(2);
renderer->setTextColor(ILI9341_2_WHITE,ILI9341_2_BLACK);
renderer->DrawStringAt(20, 140, "ILI9341 TFT!", ILI9341_2_RED,0);
renderer->setTextColor(ILI9341_2_WHITE, ILI9341_2_BLACK);
renderer->DrawStringAt(30, (Settings.display_height/2)-12, "ILI9341 TFT!", ILI9341_2_WHITE, 0);
delay(1000);
renderer->clearDisplay();
#endif
color_type = COLOR_COLOR;

View File

@ -1 +1 @@
esptool.py --chip esp32 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 bootloader_dout_40m.bin 0x8000 partitions_ffat_12M.bin 0xe000 boot_app0.bin 0x10000 tasmota32-odroid.bin
esptool.py --chip esp32 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 bootloader_dout_40m.bin 0x8000 partitions_spiffs_12M.bin 0xe000 boot_app0.bin 0x10000 tasmota32-odroid.bin