diff --git a/components/net_sntp/src/net_sntp.c b/components/net_sntp/src/net_sntp.c index feaa0562..e460e446 100644 --- a/components/net_sntp/src/net_sntp.c +++ b/components/net_sntp/src/net_sntp.c @@ -8,9 +8,15 @@ #include "esp_log.h" #include "esp_netif_sntp.h" #include "esp_sntp.h" -#include "esp_wifi.h" #include "freertos/FreeRTOS.h" +#if defined(ESP_PLATFORM) +# include "sdkconfig.h" +# if CONFIG_APP_ENABLE_WIFI_HOSTED +# include "esp_wifi.h" +# endif +#endif + static const char* TAG = "net_sntp"; esp_err_t net_sntp_start(const char* server, bool wait_for_sync) @@ -47,9 +53,20 @@ esp_err_t net_sntp_start(const char* server, bool wait_for_sync) ESP_LOGW(TAG, "SNTP sync wait timed out: 0x%x", (unsigned int)err); } } + ESP_LOGI(TAG, "SNTP running"); + +#if defined(ESP_PLATFORM) && CONFIG_APP_ENABLE_WIFI_HOSTED wifi_mode_t mode = WIFI_MODE_NULL; - esp_wifi_get_mode(&mode); - ESP_LOGI(TAG, "SNTP running (wifi mode=%d)", mode); + esp_err_t wifi_err = esp_wifi_get_mode(&mode); + if (wifi_err == ESP_OK) + { + ESP_LOGI(TAG, "Wi-Fi mode: %d", mode); + } + else + { + ESP_LOGW(TAG, "Failed to query Wi-Fi mode: 0x%x", (unsigned int)wifi_err); + } +#endif return err; } diff --git a/custom/integration/settings_controller.cpp b/custom/integration/settings_controller.cpp index 09d5d859..8e74b90a 100644 --- a/custom/integration/settings_controller.cpp +++ b/custom/integration/settings_controller.cpp @@ -907,7 +907,7 @@ namespace custom::integration void SettingsController::Impl::test_wifi_connection() { -#if defined(ESP_PLATFORM) +#if defined(ESP_PLATFORM) && CONFIG_APP_ENABLE_WIFI_HOSTED wifi_ap_record_t ap_info{}; esp_err_t err = esp_wifi_sta_get_ap_info(&ap_info); if (err == ESP_OK) @@ -923,6 +923,8 @@ namespace custom::integration { post_connection_result("wifi", UI_PAGE_SETTINGS_STATUS_UNKNOWN, "Unavailable"); } +#elif defined(ESP_PLATFORM) + post_connection_result("wifi", UI_PAGE_SETTINGS_STATUS_UNKNOWN, "ESP-Hosted disabled"); #else post_connection_result("wifi", UI_PAGE_SETTINGS_STATUS_WARNING, "Not supported on host"); #endif diff --git a/platforms/tab5/dependencies.lock b/platforms/tab5/dependencies.lock index 7d30e71c..02baeaa9 100644 --- a/platforms/tab5/dependencies.lock +++ b/platforms/tab5/dependencies.lock @@ -126,7 +126,7 @@ dependencies: registry_url: https://components.espressif.com/ type: service rules: - - if: CONFIG_APP_ENABLE_WIFI_HOSTED + - if: $CONFIG{CONFIG_APP_ENABLE_WIFI_HOSTED} == y version: 1.4.0 espressif/esp_lcd_ili9881c: component_hash: eb9ba0484d1d14171b69e5d192716fb1cdd6ef068aa4014dc3202486e124498e @@ -228,7 +228,7 @@ dependencies: registry_url: https://components.espressif.com/ type: service rules: - - if: CONFIG_APP_ENABLE_WIFI_HOSTED + - if: $CONFIG{CONFIG_APP_ENABLE_WIFI_HOSTED} == y version: 0.8.5 espressif/led_strip: component_hash: f907c58f722c58ab8545366668cfd8769cefb7d97a631a14e9d16234cc72bdff diff --git a/platforms/tab5/main/idf_component.yml b/platforms/tab5/main/idf_component.yml index 4d891390..3161c6dd 100644 --- a/platforms/tab5/main/idf_component.yml +++ b/platforms/tab5/main/idf_component.yml @@ -5,11 +5,11 @@ dependencies: espressif/esp_hosted: version: 1.4.0 rules: - - if: "CONFIG_APP_ENABLE_WIFI_HOSTED" + - if: "$CONFIG{CONFIG_APP_ENABLE_WIFI_HOSTED} == y" espressif/esp_wifi_remote: version: 0.8.5 rules: - - if: "CONFIG_APP_ENABLE_WIFI_HOSTED" + - if: "$CONFIG{CONFIG_APP_ENABLE_WIFI_HOSTED} == y" chmorgan/esp-audio-player: 1.0.7 chmorgan/esp-file-iterator: 1.0.0 espressif/led_strip: 3.0.0