From 767643f6d3973953dc294be227ce8c7e891aec23 Mon Sep 17 00:00:00 2001 From: Piyush Shah Date: Thu, 18 May 2023 16:20:09 +0530 Subject: [PATCH] homekit_switch: Fixes for idf v5.x Also updated the cli and rmaker_common submodules --- .gitlab-ci.yml | 2 -- cli | 2 +- components/rmaker_common | 2 +- examples/homekit_switch/components/app_wifi/CMakeLists.txt | 2 +- .../components/app_wifi/app_wifi_with_homekit.c | 4 ++-- examples/homekit_switch/main/app_homekit.c | 6 +++--- examples/homekit_switch/sdkconfig.defaults | 7 +++---- examples/homekit_switch/sdkconfig.defaults.esp32 | 3 +++ 8 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 examples/homekit_switch/sdkconfig.defaults.esp32 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a36b81..d323686 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,14 +86,12 @@ build_idf_v5.0: image: espressif/idf:release-v5.0 variables: EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3 esp32s3" - EXAMPLES: "switch led_light fan temperature_sensor multi_device gpio" build_idf_v5.1: extends: .build_template image: espressif/idf:release-v5.1 variables: EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3 esp32s3" - EXAMPLES: "switch led_light fan temperature_sensor multi_device gpio" build_docs: stage: build diff --git a/cli b/cli index 01add85..2865233 160000 --- a/cli +++ b/cli @@ -1 +1 @@ -Subproject commit 01add85ea880471ce3892c94ccb417e4364e0d34 +Subproject commit 28652330527985f1e5f9f0f3ffd4a58df6a8d8a2 diff --git a/components/rmaker_common b/components/rmaker_common index 27556e1..5ab4c7c 160000 --- a/components/rmaker_common +++ b/components/rmaker_common @@ -1 +1 @@ -Subproject commit 27556e17239523e9f3a5c6b472d0fcbfc38b394c +Subproject commit 5ab4c7c19f6a61ff2a2e489193c012d6caa887bd diff --git a/examples/homekit_switch/components/app_wifi/CMakeLists.txt b/examples/homekit_switch/components/app_wifi/CMakeLists.txt index e382faa..e15f4f9 100644 --- a/examples/homekit_switch/components/app_wifi/CMakeLists.txt +++ b/examples/homekit_switch/components/app_wifi/CMakeLists.txt @@ -1,3 +1,3 @@ idf_component_register(SRCS "app_wifi_with_homekit.c" INCLUDE_DIRS "." - REQUIRES wifi_provisioning qrcode esp_hap_core esp_hap_platform) + PRIV_REQUIRES wifi_provisioning qrcode esp_hap_core esp_hap_platform nvs_flash) diff --git a/examples/homekit_switch/components/app_wifi/app_wifi_with_homekit.c b/examples/homekit_switch/components/app_wifi/app_wifi_with_homekit.c index 5062626..91e1e18 100644 --- a/examples/homekit_switch/components/app_wifi/app_wifi_with_homekit.c +++ b/examples/homekit_switch/components/app_wifi/app_wifi_with_homekit.c @@ -80,10 +80,10 @@ static void app_wifi_print_qr(const char *name, const char *pop, const char *tra PROV_QR_VERSION, name, transport); } #ifdef CONFIG_APP_WIFI_PROV_SHOW_QR - ESP_LOGI(TAG, "Scan this QR code from the phone app for Provisioning."); + printf("Scan this QR code from the phone app for Provisioning.\n"); qrcode_display(payload); #endif /* CONFIG_APP_WIFI_PROV_SHOW_QR */ - ESP_LOGI(TAG, "If QR code is not visible, copy paste the below URL in a browser.\n%s?data=%s", QRCODE_BASE_URL, payload); + printf("If QR code is not visible, copy paste the below URL in a browser.\n%s?data=%s\n", QRCODE_BASE_URL, payload); esp_event_post(APP_WIFI_EVENT, APP_WIFI_EVENT_QR_DISPLAY, payload, strlen(payload) + 1, portMAX_DELAY); } diff --git a/examples/homekit_switch/main/app_homekit.c b/examples/homekit_switch/main/app_homekit.c index 05c017d..f438ae7 100644 --- a/examples/homekit_switch/main/app_homekit.c +++ b/examples/homekit_switch/main/app_homekit.c @@ -34,10 +34,10 @@ static void app_homekit_show_qr(void) char *setup_payload = esp_hap_get_setup_payload(CONFIG_EXAMPLE_SETUP_CODE, CONFIG_EXAMPLE_SETUP_ID, false, HAP_CID_SWITCH); if (setup_payload) { - ESP_LOGI(TAG, "-----QR Code for HomeKit-----"); - ESP_LOGI(TAG, "Scan this QR code from the Home app on iOS"); + printf("-----QR Code for HomeKit-----\n"); + printf("Scan this QR code from the Home app on iOS\n"); qrcode_display(setup_payload); - ESP_LOGI(TAG, "If QR code is not visible, copy paste the below URL in a browser.\n%s?data=%s", + printf("If QR code is not visible, copy paste the below URL in a browser.\n%s?data=%s\n", QRCODE_BASE_URL, setup_payload); free(setup_payload); } diff --git a/examples/homekit_switch/sdkconfig.defaults b/examples/homekit_switch/sdkconfig.defaults index cd0e1cf..be26eac 100644 --- a/examples/homekit_switch/sdkconfig.defaults +++ b/examples/homekit_switch/sdkconfig.defaults @@ -34,9 +34,8 @@ CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=3120 # For additional security on reset to factory CONFIG_ESP_RMAKER_USER_ID_CHECK=y -# Secure Local Control -CONFIG_ESP_RMAKER_LOCAL_CTRL_ENABLE=y -CONFIG_ESP_RMAKER_LOCAL_CTRL_SECURITY_1=y - # Application Rollback CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y + +# Change default log level to reduce binary size +CONFIG_LOG_DEFAULT_LEVEL_WARN=y diff --git a/examples/homekit_switch/sdkconfig.defaults.esp32 b/examples/homekit_switch/sdkconfig.defaults.esp32 new file mode 100644 index 0000000..857a874 --- /dev/null +++ b/examples/homekit_switch/sdkconfig.defaults.esp32 @@ -0,0 +1,3 @@ +# To prevent IRAM overflow errors +CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y +CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y