From b5213b01af318e0721f7d624b40a02acef074f22 Mon Sep 17 00:00:00 2001 From: CaCO3 Date: Mon, 1 Jan 2024 22:00:23 +0100 Subject: [PATCH] Update platform-espressif32 to 6.5.0 (#2770) * Update ESP IDF to 6.5.0 * Migration to new IDF * Correct smtp vor v5.1 --------- Co-authored-by: CaCO3 Co-authored-by: jomjol <30766535+jomjol@users.noreply.github.com> --- .../jomjol_fileserver_ota/miniz/miniz.h | 2 +- .../jomjol_fileserver_ota/server_file.cpp | 2 +- .../components/jomjol_helper/sdcard_check.cpp | 1 + .../jomjol_time_sntp/CMakeLists.txt | 2 +- .../components/jomjol_time_sntp/time_sntp.cpp | 20 +++++++------------ code/components/jomjol_wlan/connect_wlan.cpp | 4 ++-- code/dependencies.lock | 6 +++--- code/platformio.ini | 2 +- 8 files changed, 17 insertions(+), 22 deletions(-) diff --git a/code/components/jomjol_fileserver_ota/miniz/miniz.h b/code/components/jomjol_fileserver_ota/miniz/miniz.h index 35c740c72..278898d15 100644 --- a/code/components/jomjol_fileserver_ota/miniz/miniz.h +++ b/code/components/jomjol_fileserver_ota/miniz/miniz.h @@ -153,7 +153,7 @@ /*#define MINIZ_NO_MALLOC */ #ifdef MINIZ_NO_INFLATE_APIS -#define MINIZ_NO_ARCHIVE_APIS +//#define MINIZ_NO_ARCHIVE_APIS #endif #ifdef MINIZ_NO_DEFLATE_APIS diff --git a/code/components/jomjol_fileserver_ota/server_file.cpp b/code/components/jomjol_fileserver_ota/server_file.cpp index 8da898736..50e2c8f2d 100644 --- a/code/components/jomjol_fileserver_ota/server_file.cpp +++ b/code/components/jomjol_fileserver_ota/server_file.cpp @@ -547,7 +547,7 @@ static esp_err_t download_get_handler(httpd_req_t *req) /* Get value of expected key from query string */ if (httpd_query_key_value(buf, "readonly", param, sizeof(param)) == ESP_OK) { ESP_LOGI(TAG, "Found URL query parameter => readonly=%s", param); - readonly = param && strcmp(param,"true")==0; + readonly = (strcmp(param,"true") == 0); } } } diff --git a/code/components/jomjol_helper/sdcard_check.cpp b/code/components/jomjol_helper/sdcard_check.cpp index e8ac9d241..39c5d4798 100644 --- a/code/components/jomjol_helper/sdcard_check.cpp +++ b/code/components/jomjol_helper/sdcard_check.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include diff --git a/code/components/jomjol_time_sntp/CMakeLists.txt b/code/components/jomjol_time_sntp/CMakeLists.txt index 1be7fbcab..4988e2a71 100644 --- a/code/components/jomjol_time_sntp/CMakeLists.txt +++ b/code/components/jomjol_time_sntp/CMakeLists.txt @@ -2,6 +2,6 @@ FILE(GLOB_RECURSE app_sources ${CMAKE_CURRENT_SOURCE_DIR}/*.*) idf_component_register(SRCS ${app_sources} INCLUDE_DIRS "." - REQUIRES esp-tflite-micro jomjol_logfile jomjol_configfile) + REQUIRES esp_netif esp-tflite-micro jomjol_logfile jomjol_configfile) diff --git a/code/components/jomjol_time_sntp/time_sntp.cpp b/code/components/jomjol_time_sntp/time_sntp.cpp index 7560bcd75..736003fcf 100644 --- a/code/components/jomjol_time_sntp/time_sntp.cpp +++ b/code/components/jomjol_time_sntp/time_sntp.cpp @@ -10,7 +10,8 @@ #include "esp_log.h" #include "esp_attr.h" #include "esp_sleep.h" -#include "esp_sntp.h" +#include "esp_netif_sntp.h" + #include "../../include/defines.h" #include "ClassLogFile.h" @@ -274,21 +275,13 @@ bool setupTime() { if (useNtp) { LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Configuring NTP Client..."); - sntp_setoperatingmode(SNTP_OPMODE_POLL); - sntp_setservername(0, timeServer.c_str()); - sntp_set_time_sync_notification_cb(time_sync_notification_cb); - setTimeZone(timeZone); + esp_sntp_config_t config = ESP_NETIF_SNTP_DEFAULT_CONFIG(timeServer.c_str()); + config.sync_cb = time_sync_notification_cb; + esp_netif_sntp_init(&config); - sntp_init(); -/* - if (!wait_for_timesync()) - { - LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Timesync at startup failed."); - } -*/ + setTimeZone(timeZone); } - /* The RTC keeps the time after a restart (Except on Power On or Pin Reset) * There should only be a minor correction through NTP */ @@ -297,6 +290,7 @@ bool setupTime() { localtime_r(&now, &timeinfo); strftime(strftime_buf, sizeof(strftime_buf), "%Y-%m-%d %H:%M:%S", &timeinfo); + if (getTimeIsSet()) { LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Time is already set: " + std::string(strftime_buf)); } diff --git a/code/components/jomjol_wlan/connect_wlan.cpp b/code/components/jomjol_wlan/connect_wlan.cpp index 085e4b676..603751265 100644 --- a/code/components/jomjol_wlan/connect_wlan.cpp +++ b/code/components/jomjol_wlan/connect_wlan.cpp @@ -378,7 +378,7 @@ void wifi_scan(void) else { if (esp_wifi_scan_get_ap_records(&max_number_of_ap_found, wifi_ap_records) != ESP_OK) { // Retrieve results (and free internal heap) LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "wifi_scan: esp_wifi_scan_get_ap_records: Error retrieving datasets"); - delete wifi_ap_records; + delete[] wifi_ap_records; return; } } @@ -401,7 +401,7 @@ void wifi_scan(void) APWithBetterRSSI = true; } } - delete wifi_ap_records; + delete[] wifi_ap_records; } diff --git a/code/dependencies.lock b/code/dependencies.lock index 24725511d..6e49cb194 100644 --- a/code/dependencies.lock +++ b/code/dependencies.lock @@ -1,3 +1,3 @@ -manifest_hash: 63f5c6c9f0bcebc7b9ca12d2aa8b26b2c5f5218d377dc4b2375d9b9ca1df7815 -target: esp32 -version: 1.0.0 +manifest_hash: 63f5c6c9f0bcebc7b9ca12d2aa8b26b2c5f5218d377dc4b2375d9b9ca1df7815 +target: esp32 +version: 1.0.0 \ No newline at end of file diff --git a/code/platformio.ini b/code/platformio.ini index ea924fb2f..38012347d 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -19,7 +19,7 @@ [common:esp32-idf] extends = common:idf - platform = platformio/espressif32 @ 6.3.2 + platform = platformio/espressif32 @ 6.5.0 framework = espidf lib_deps = ${common:idf.lib_deps}