diff --git a/code/components/jomjol_fileserver_ota/server_file.cpp b/code/components/jomjol_fileserver_ota/server_file.cpp index 9562d3a7a..c9e72d30b 100644 --- a/code/components/jomjol_fileserver_ota/server_file.cpp +++ b/code/components/jomjol_fileserver_ota/server_file.cpp @@ -573,7 +573,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_flowcontroll/ClassFlow.cpp b/code/components/jomjol_flowcontroll/ClassFlow.cpp index 195b2f6b0..7cf5d6494 100644 --- a/code/components/jomjol_flowcontroll/ClassFlow.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlow.cpp @@ -109,12 +109,6 @@ std::string ClassFlow::getHTMLSingleStep(std::string host) } -std::string ClassFlow::getReadout() -{ - return std::string(); -} - - std::string ClassFlow::GetParameterName(std::string _input) { std::string _param; diff --git a/code/components/jomjol_flowcontroll/ClassFlow.h b/code/components/jomjol_flowcontroll/ClassFlow.h index 40e188cc7..bf2ba0e85 100644 --- a/code/components/jomjol_flowcontroll/ClassFlow.h +++ b/code/components/jomjol_flowcontroll/ClassFlow.h @@ -60,7 +60,6 @@ class ClassFlow virtual bool ReadParameter(FILE* pfile, std::string &aktparamgraph); virtual bool doFlow(std::string time); virtual std::string getHTMLSingleStep(std::string host); - virtual std::string getReadout(); virtual std::string name() {return "ClassFlow";}; }; diff --git a/code/components/jomjol_flowcontroll/ClassFlowControll.cpp b/code/components/jomjol_flowcontroll/ClassFlowControll.cpp index 4e8209a17..90ed11119 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowControll.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowControll.cpp @@ -1058,22 +1058,7 @@ std::string ClassFlowControll::getReadout(bool _rawvalue = false, bool _noerror if (flowpostprocessing) return flowpostprocessing->getReadoutParam(_rawvalue, _noerror, _number); - std::string zw = ""; - std::string result = ""; - - for (int i = 0; i < FlowControll.size(); ++i) - { - zw = FlowControll[i]->getReadout(); - if (zw.length() > 0) - { - if (result.length() == 0) - result = zw; - else - result = result + "\t" + zw; - } - } - - return result; + return std::string(""); } diff --git a/code/components/jomjol_helper/sdcard_check.cpp b/code/components/jomjol_helper/sdcard_check.cpp index 444971e06..46963d566 100644 --- a/code/components/jomjol_helper/sdcard_check.cpp +++ b/code/components/jomjol_helper/sdcard_check.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include diff --git a/code/components/jomjol_helper/system.cpp b/code/components/jomjol_helper/system.cpp index a5e096f21..f0e7df05e 100644 --- a/code/components/jomjol_helper/system.cpp +++ b/code/components/jomjol_helper/system.cpp @@ -147,14 +147,7 @@ bool setCPUFrequency(void) { ConfigFile configFile = ConfigFile(CONFIG_FILE); std::string cpuFrequency = "160"; - - #ifdef CONFIG_IDF_TARGET_ESP32 - esp_pm_config_esp32_t pm_config; - #elif defined(CONFIG_IDF_TARGET_ESP32S3) - esp_pm_config_esp32s3_t pm_config; - #else - #error "esp_pm_config_* not defined" - #endif + esp_pm_config_t pm_config; if (!configFile.ConfigFileExists()){ LogFile.WriteToFile(ESP_LOG_WARN, TAG, "No config file - exit setCpuFrequency"); diff --git a/code/components/jomjol_time_sntp/CMakeLists.txt b/code/components/jomjol_time_sntp/CMakeLists.txt index d7409600e..296e6152f 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 jomjol_logfile jomjol_configfile) + REQUIRES esp_netif 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 1c32d8538..e811c6e8d 100644 --- a/code/components/jomjol_time_sntp/time_sntp.cpp +++ b/code/components/jomjol_time_sntp/time_sntp.cpp @@ -1,19 +1,9 @@ #include "time_sntp.h" #include "../../include/defines.h" -#include -#include -#include - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/event_groups.h" - -#include "esp_system.h" #include "esp_log.h" -#include "esp_attr.h" -#include "esp_sleep.h" #include "esp_sntp.h" +#include "esp_netif_sntp.h" #include "ClassLogFile.h" #include "configFile.h" @@ -145,25 +135,25 @@ bool getTimeWasSetOnce(void) std::string getServerName(void) { - char buf[100]; + char buf[128]; - if (sntp_getservername(0)){ - snprintf(buf, sizeof(buf), "%s", sntp_getservername(0)); + if (esp_sntp_getservername(0)){ + snprintf(buf, sizeof(buf), "%s", esp_sntp_getservername(0)); return std::string(buf); } - else { // we have either IPv4 or IPv6 address - ip_addr_t const *ip = sntp_getserver(0); + else { // Use IPv4 or IPv6 address instead + ip_addr_t const *ip = esp_sntp_getserver(0); if (ipaddr_ntoa_r(ip, buf, sizeof(buf)) != NULL) { return std::string(buf); } } - return ""; + return "Unknown SNTP server"; } /** - * Load the Time zone and Time server from the config file and initialize the NTP client - * The RTC keeps the time after a restart (Except on Power On or Pin Reset) + * Load the time zone and time server from the config file and initialize the NTP client + * The RTC keeps the time after a restart (except on Power On or Pin Reset) * There should only be a minor correction through NTP */ bool setupTime() @@ -235,10 +225,9 @@ bool setupTime() if (useNtp) { LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Init NTP service"); - sntp_setoperatingmode(SNTP_OPMODE_POLL); - sntp_setservername(0, timeServer.c_str()); - sntp_set_time_sync_notification_cb(timeSyncNotificationCallback); - sntp_init(); + esp_sntp_config_t sntpConfig = ESP_NETIF_SNTP_DEFAULT_CONFIG(timeServer.c_str()); + sntpConfig.sync_cb = timeSyncNotificationCallback; + esp_netif_sntp_init(&sntpConfig); // Wait for time sync to ensure start with proper time if (!waitingForTimeSync() || !getTimeIsSet()) { @@ -298,7 +287,7 @@ void setupTimeServer(std::string _timeServer) if (_timeServer == "") { LogFile.WriteToFile(ESP_LOG_INFO, TAG, "NTP service disabled"); useNtp = false; - sntp_stop(); + esp_netif_sntp_deinit(); } else { LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Time server: " + _timeServer); @@ -308,18 +297,13 @@ void setupTimeServer(std::string _timeServer) timeServer = _timeServer; if (useNtp) { - sntp_setoperatingmode(SNTP_OPMODE_POLL); - sntp_setservername(0, timeServer.c_str()); - sntp_set_time_sync_notification_cb(timeSyncNotificationCallback); + setTimeZone(timeZone); LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Init NTP service"); - if (!sntp_enabled()) { - setTimeZone(timeZone); - sntp_init(); - } - else { - sntp_restart(); - } + esp_netif_sntp_deinit(); + esp_sntp_config_t sntpConfig = ESP_NETIF_SNTP_DEFAULT_CONFIG(timeServer.c_str()); + sntpConfig.sync_cb = timeSyncNotificationCallback; + esp_netif_sntp_init(&sntpConfig); // Wait for time sync to ensure start with proper time if (!waitingForTimeSync() || !getTimeIsSet()) { diff --git a/code/components/jomjol_time_sntp/time_sntp.h b/code/components/jomjol_time_sntp/time_sntp.h index a763e7e70..e6fb08e46 100644 --- a/code/components/jomjol_time_sntp/time_sntp.h +++ b/code/components/jomjol_time_sntp/time_sntp.h @@ -2,18 +2,7 @@ #define TIMESNTP_H #include -#include -#include - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/event_groups.h" - -#include "esp_system.h" -#include "esp_log.h" -#include "esp_attr.h" -#include "esp_sleep.h" -#include "esp_sntp.h" +#include std::string getCurrentTimeString(const char * frm); diff --git a/code/components/jomjol_wlan/connect_wlan.cpp b/code/components/jomjol_wlan/connect_wlan.cpp index 3ae3db3c2..8a5b34bc3 100644 --- a/code/components/jomjol_wlan/connect_wlan.cpp +++ b/code/components/jomjol_wlan/connect_wlan.cpp @@ -484,8 +484,11 @@ static void event_handler(void* arg, esp_event_base_t event_base, int32_t event_ } else { WIFIConnected = false; - if (disconn->reason == WIFI_REASON_NO_AP_FOUND) { - LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Disconnected (" + std::to_string(disconn->reason) + ", No AP)"); + if (disconn->reason == WIFI_REASON_NO_AP_FOUND || + disconn->reason == WIFI_REASON_NO_AP_FOUND_W_COMPATIBLE_SECURITY || + disconn->reason == WIFI_REASON_NO_AP_FOUND_IN_AUTHMODE_THRESHOLD || + disconn->reason == WIFI_REASON_NO_AP_FOUND_IN_RSSI_THRESHOLD) { + LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Disconnected (" + std::to_string(disconn->reason) + ", No AP found)"); StatusLED(WLAN_CONN, 1, false); } else if (disconn->reason == WIFI_REASON_AUTH_EXPIRE || diff --git a/code/dependencies.lock b/code/dependencies.lock deleted file mode 100644 index 538c84615..000000000 --- a/code/dependencies.lock +++ /dev/null @@ -1,16 +0,0 @@ -dependencies: - espressif/esp-nn: - component_hash: b32869798bdb40dec6bc99caca48cd65d42f8a9f506b9ab9c598a076f891ede9 - source: - pre_release: true - service_url: https://api.components.espressif.com/ - type: service - version: 1.0.2 - idf: - component_hash: null - source: - type: idf - version: 5.0.2 -manifest_hash: 025d12c4c28f3880609a76bce0513603277176217ec72828090f5f48cb7eb486 -target: esp32 -version: 1.0.0 diff --git a/code/platformio.ini b/code/platformio.ini index ae66aaf4e..98fba7a30 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -19,7 +19,7 @@ lib_deps = [common:esp32-idf] extends = common:idf -platform = platformio/espressif32 @ 6.3.2 +platform = platformio/espressif32 @ 6.7.0 framework = espidf lib_deps = ${common:idf.lib_deps}