From e95b91615703edd6514ff3c7d01be7b74fc05b60 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Fri, 2 Feb 2024 16:36:57 +0100 Subject: [PATCH] Downgrade to Tasmota core 2023.10.02 --- CHANGELOG.md | 1 + platformio.ini | 2 +- src/hasp/hasp_mem.cpp | 5 +++++ src/sys/net/hasp_time.cpp | 18 ++++++++++++++---- src/sys/svc/hasp_ota.cpp | 11 ++++++----- user_setups/esp32/_esp32.ini | 4 +++- 6 files changed, 30 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16a22aef..fa53d7b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ - Add Sunton ESP32-2432S028R ESP32-3248S035C ESP32-3248S035R - Add support for Wireless-Tag WT32-SC01 Plus and WT32S3-86V - Deprecate support for WT-86-32-3ZW1 with ESP32-S2 +- Fade backlight on ESP32 devices (thanks @presslab-us) ## Bug fixes - Fix for first touch not working properly diff --git a/platformio.ini b/platformio.ini index c28cea8c..62acd29b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -75,7 +75,7 @@ build_flags = -D HASP_VER_MAJ=0 -D HASP_VER_MIN=7 ;-D HASP_VER_REV=4 - -D HASP_VER_REV=0-rc9 + -D HASP_VER_REV=0-rc10 ;-D HASP_VER_REV=4-rc1 ${override.build_flags} diff --git a/src/hasp/hasp_mem.cpp b/src/hasp/hasp_mem.cpp index 51942271..f0859a36 100644 --- a/src/hasp/hasp_mem.cpp +++ b/src/hasp/hasp_mem.cpp @@ -53,6 +53,11 @@ void* lodepng_malloc(size_t size) if(size > LODEPNG_MAX_ALLOC) return 0; #endif + // void* ptr = hasp_malloc(size); + // if(ptr) return ptr; + + // /* PSram was full retry after clearing cache*/ + // lv_img_cache_invalidate_src(NULL); return hasp_malloc(size); } diff --git a/src/sys/net/hasp_time.cpp b/src/sys/net/hasp_time.cpp index 37beca4e..0087a35c 100644 --- a/src/sys/net/hasp_time.cpp +++ b/src/sys/net/hasp_time.cpp @@ -18,6 +18,7 @@ #include "Preferences.h" #include "nvs.h" #include "nvs_flash.h" +#include "esp_sntp.h" #endif #if defined(ARDUINO_ARCH_ESP32) @@ -26,6 +27,11 @@ String mytz((char*)0); String ntp1((char*)0); String ntp2((char*)0); String ntp3((char*)0); + +void timeSyncCallback(struct timeval* tv) +{ + LOG_VERBOSE(TAG_TIME, "NTP Synced: %s", ctime(&tv->tv_sec)); +} #endif void timeSetup() @@ -41,15 +47,19 @@ void timeSetup() String zone((char*)0); zone = preferences.getString("zone", TIMEZONE); - mytz = time_zone_to_possix(zone.c_str()); - ntp1 = preferences.getString("ntp1", NTPSERVER1); - ntp2 = preferences.getString("ntp2", NTPSERVER2); - ntp3 = preferences.getString("ntp3", NTPSERVER3); + mytz = time_zone_to_possix(zone.c_str()); + ntp1 = preferences.getString("ntp1", NTPSERVER1); + ntp2 = preferences.getString("ntp2", NTPSERVER2); + ntp3 = preferences.getString("ntp3", NTPSERVER3); + bool enable = preferences.getBool("enable", true); + bool dhcp = preferences.getBool("dhcp", true); LOG_VERBOSE(TAG_TIME, F("%s => %s"), zone.c_str(), mytz.c_str()); LOG_VERBOSE(TAG_TIME, F("NTP: %s %s %s"), ntp1.c_str(), ntp2.c_str(), ntp3.c_str()); + sntp_set_time_sync_notification_cb(timeSyncCallback); configTzTime(mytz.c_str(), ntp1.c_str(), ntp2.c_str(), ntp3.c_str()); + sntp_servermode_dhcp(enable && dhcp ? 1 : 0); preferences.end(); #endif } diff --git a/src/sys/svc/hasp_ota.cpp b/src/sys/svc/hasp_ota.cpp index 48d9fb9e..f4c18f12 100644 --- a/src/sys/svc/hasp_ota.cpp +++ b/src/sys/svc/hasp_ota.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #ifndef HASP_ARDUINOOTA_PORT #define HASP_ARDUINOOTA_PORT 3232 @@ -76,14 +77,14 @@ extern const uint8_t rootca_crt_bundle_start[] asm("_binary_data_cert_x509_crt_b #endif // ARDUINO_ARCH_ESP32 static WiFiClientSecure secureClient; -std::string otaUrl = "http://ota.netwize.be"; +/*std::string otaUrl = "http://ota.netwize.be";*/ uint16_t arduinoOtaPort = HASP_ARDUINOOTA_PORT; int8_t otaPrecentageComplete = -1; bool otaUpdateCheck() { // firmware update check - WiFiClientSecure wifiUpdateClientSecure; + /*WiFiClientSecure wifiUpdateClientSecure; HTTPClient updateClient; LOG_TRACE(TAG_OTA, F(D_OTA_CHECK_UPDATE), otaUrl.c_str()); @@ -115,7 +116,7 @@ bool otaUpdateCheck() // } } LOG_VERBOSE(TAG_OTA, F(D_OTA_CHECK_COMPLETE)); - } + }*/ return true; } @@ -210,9 +211,9 @@ void otaSetup(void) secureClient.setTimeout(12); // timeout argument is defined in seconds #if HASP_USE_ARDUINOOTA > 0 - if(strlen(otaUrl.c_str())) { + /*if(strlen(otaUrl.c_str())) { LOG_INFO(TAG_OTA, otaUrl.c_str()); - } + }*/ if(arduinoOtaPort > 0) { ArduinoOTA.onStart(ota_on_start); diff --git a/user_setups/esp32/_esp32.ini b/user_setups/esp32/_esp32.ini index 5c17abc8..a7440eae 100644 --- a/user_setups/esp32/_esp32.ini +++ b/user_setups/esp32/_esp32.ini @@ -141,7 +141,9 @@ extends = esp32 framework = arduino ; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.05.01/platform-espressif32.zip ; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.08.01/platform-espressif32.zip -platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip +;platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip +;;;platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.01/platform-espressif32.zip +platform = https://github.com/Jason2866/platform-espressif32/releases/download/2023.10.02/platform-espressif32-2023.10.02.zip lib_ignore = ${esp32.lib_ignore}